mt-sdk 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +67 -60
- data/lib/modern_treasury/{controllers/account_collection_flow_controller.rb → apis/account_collection_flow_api.rb} +19 -13
- data/lib/modern_treasury/{controllers/account_detail_controller.rb → apis/account_detail_api.rb} +25 -11
- data/lib/modern_treasury/{controllers/balance_report_controller.rb → apis/balance_report_api.rb} +11 -6
- data/lib/modern_treasury/{controllers/base_controller.rb → apis/base_api.rb} +10 -3
- data/lib/modern_treasury/{controllers/connection_controller.rb → apis/connection_api.rb} +10 -9
- data/lib/modern_treasury/{controllers/counterparty_controller.rb → apis/counterparty_api.rb} +25 -15
- data/lib/modern_treasury/{controllers/document_controller.rb → apis/document_api.rb} +52 -28
- data/lib/modern_treasury/{controllers/event_controller.rb → apis/event_api.rb} +13 -10
- data/lib/modern_treasury/{controllers/expected_payment_controller.rb → apis/expected_payment_api.rb} +26 -19
- data/lib/modern_treasury/{controllers/external_account_controller.rb → apis/external_account_api.rb} +28 -16
- data/lib/modern_treasury/{controllers/incoming_payment_detail_controller.rb → apis/incoming_payment_detail_api.rb} +22 -16
- data/lib/modern_treasury/{controllers/internal_account_controller.rb → apis/internal_account_api.rb} +21 -15
- data/lib/modern_treasury/{controllers/invoice_controller.rb → apis/invoice_api.rb} +20 -14
- data/lib/modern_treasury/{controllers/invoice_line_item_controller.rb → apis/invoice_line_item_api.rb} +24 -11
- data/lib/modern_treasury/{controllers/ledger_account_controller.rb → apis/ledger_account_api.rb} +21 -13
- data/lib/modern_treasury/{controllers/ledger_account_category_controller.rb → apis/ledger_account_category_api.rb} +37 -17
- data/lib/modern_treasury/{controllers/ledger_account_payout_controller.rb → apis/ledger_account_payout_api.rb} +18 -12
- data/lib/modern_treasury/{controllers/ledger_account_statement_controller.rb → apis/ledger_account_statement_api.rb} +7 -4
- data/lib/modern_treasury/{controllers/ledger_controller.rb → apis/ledger_api.rb} +21 -13
- data/lib/modern_treasury/{controllers/ledger_entry_controller.rb → apis/ledger_entry_api.rb} +17 -15
- data/lib/modern_treasury/{controllers/ledger_event_handler_controller.rb → apis/ledger_event_handler_api.rb} +18 -12
- data/lib/modern_treasury/{controllers/ledger_transaction_controller.rb → apis/ledger_transaction_api.rb} +34 -24
- data/lib/modern_treasury/{controllers/ledgerable_event_controller.rb → apis/ledgerable_event_api.rb} +7 -4
- data/lib/modern_treasury/{controllers/line_item_controller.rb → apis/line_item_api.rb} +20 -9
- data/lib/modern_treasury/{controllers/paper_item_controller.rb → apis/paper_item_api.rb} +12 -9
- data/lib/modern_treasury/{controllers/payment_flow_controller.rb → apis/payment_flow_api.rb} +19 -13
- data/lib/modern_treasury/{controllers/payment_order_controller.rb → apis/payment_order_api.rb} +47 -36
- data/lib/modern_treasury/{controllers/payment_reference_controller.rb → apis/payment_reference_api.rb} +16 -13
- data/lib/modern_treasury/{controllers/ping_controller.rb → apis/ping_api.rb} +4 -3
- data/lib/modern_treasury/{controllers/return_controller.rb → apis/return_api.rb} +16 -12
- data/lib/modern_treasury/{controllers/reversal_controller.rb → apis/reversal_api.rb} +12 -5
- data/lib/modern_treasury/{controllers/routing_detail_controller.rb → apis/routing_detail_api.rb} +25 -11
- data/lib/modern_treasury/{controllers/transaction_controller.rb → apis/transaction_api.rb} +16 -11
- data/lib/modern_treasury/{controllers/transaction_line_item_controller.rb → apis/transaction_line_item_api.rb} +6 -4
- data/lib/modern_treasury/{controllers/validation_controller.rb → apis/validation_api.rb} +10 -7
- data/lib/modern_treasury/{controllers/virtual_account_controller.rb → apis/virtual_account_api.rb} +23 -15
- data/lib/modern_treasury/client.rb +80 -78
- data/lib/modern_treasury/configuration.rb +18 -47
- data/lib/modern_treasury/http/api_response.rb +19 -0
- data/lib/modern_treasury/logging/configuration/api_logging_configuration.rb +186 -0
- data/lib/modern_treasury/logging/sdk_logger.rb +17 -0
- data/lib/modern_treasury/models/account.rb +26 -26
- data/lib/modern_treasury/models/account1.rb +34 -21
- data/lib/modern_treasury/models/account_collection_flow.rb +15 -16
- data/lib/modern_treasury/models/account_collection_flow_create_request.rb +18 -5
- data/lib/modern_treasury/models/account_collection_flow_update_request.rb +16 -4
- data/lib/modern_treasury/models/account_detail.rb +15 -16
- data/lib/modern_treasury/models/account_detail1.rb +19 -6
- data/lib/modern_treasury/models/account_detail_create_request.rb +19 -6
- data/lib/modern_treasury/models/{account_number_type_enum.rb → account_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{account_number_type2_enum.rb → account_number_type2.rb} +3 -3
- data/lib/modern_treasury/models/{account_type_enum.rb → account_type.rb} +3 -3
- data/lib/modern_treasury/models/{account_type5_enum.rb → account_type5.rb} +3 -3
- data/lib/modern_treasury/models/accounting.rb +19 -5
- data/lib/modern_treasury/models/accounting1.rb +17 -5
- data/lib/modern_treasury/models/{accounts_type_enum.rb → accounts_type.rb} +3 -3
- data/lib/modern_treasury/models/{accounts_type1_enum.rb → accounts_type1.rb} +3 -3
- data/lib/modern_treasury/models/address.rb +13 -14
- data/lib/modern_treasury/models/address_request.rb +23 -10
- data/lib/modern_treasury/models/async_response.rb +3 -3
- data/lib/modern_treasury/models/balance.rb +15 -17
- data/lib/modern_treasury/models/balance_report.rb +14 -15
- data/lib/modern_treasury/models/{balance_report_type_enum.rb → balance_report_type.rb} +3 -3
- data/lib/modern_treasury/models/{balance_report_type1_enum.rb → balance_report_type1.rb} +3 -3
- data/lib/modern_treasury/models/{balance_type_enum.rb → balance_type.rb} +3 -3
- data/lib/modern_treasury/models/balances.rb +2 -2
- data/lib/modern_treasury/models/balances1.rb +3 -3
- data/lib/modern_treasury/models/balances2.rb +7 -7
- data/lib/modern_treasury/models/balances3.rb +8 -8
- data/lib/modern_treasury/models/{charge_bearer_enum.rb → charge_bearer.rb} +3 -3
- data/lib/modern_treasury/models/{code_enum.rb → code.rb} +3 -3
- data/lib/modern_treasury/models/{code1_enum.rb → code1.rb} +3 -3
- data/lib/modern_treasury/models/connection.rb +11 -12
- data/lib/modern_treasury/models/contact_detail.rb +13 -14
- data/lib/modern_treasury/models/contact_detail_create_request.rb +20 -6
- data/lib/modern_treasury/models/{contact_identifier_type_enum.rb → contact_identifier_type.rb} +3 -3
- data/lib/modern_treasury/models/{content_type_enum.rb → content_type.rb} +3 -3
- data/lib/modern_treasury/models/counterparty.rb +16 -17
- data/lib/modern_treasury/models/counterparty_billing_address.rb +23 -10
- data/lib/modern_treasury/models/counterparty_collect_account_request.rb +23 -10
- data/lib/modern_treasury/models/counterparty_collect_account_response.rb +4 -4
- data/lib/modern_treasury/models/counterparty_create_request.rb +31 -17
- data/lib/modern_treasury/models/counterparty_shipping_address.rb +23 -10
- data/lib/modern_treasury/models/counterparty_update_request.rb +23 -9
- data/lib/modern_treasury/models/{created_at_enum.rb → created_at.rb} +3 -3
- data/lib/modern_treasury/models/{currency_enum.rb → currency.rb} +3 -3
- data/lib/modern_treasury/models/{currency1_enum.rb → currency1.rb} +3 -3
- data/lib/modern_treasury/models/{direction_enum.rb → direction.rb} +3 -3
- data/lib/modern_treasury/models/{direction1_enum.rb → direction1.rb} +3 -3
- data/lib/modern_treasury/models/{direction10_enum.rb → direction10.rb} +3 -3
- data/lib/modern_treasury/models/{direction14_enum.rb → direction14.rb} +3 -3
- data/lib/modern_treasury/models/{direction15_enum.rb → direction15.rb} +3 -3
- data/lib/modern_treasury/models/{direction4_enum.rb → direction4.rb} +3 -3
- data/lib/modern_treasury/models/{direction5_enum.rb → direction5.rb} +3 -3
- data/lib/modern_treasury/models/{direction9_enum.rb → direction9.rb} +3 -3
- data/lib/modern_treasury/models/document.rb +16 -17
- data/lib/modern_treasury/models/document_create_request.rb +22 -9
- data/lib/modern_treasury/models/document_detail.rb +11 -11
- data/lib/modern_treasury/models/{documentable_type_enum.rb → documentable_type.rb} +3 -3
- data/lib/modern_treasury/models/{documentable_type1_enum.rb → documentable_type1.rb} +3 -3
- data/lib/modern_treasury/models/{documentable_type2_enum.rb → documentable_type2.rb} +3 -3
- data/lib/modern_treasury/models/{effective_at_enum.rb → effective_at.rb} +3 -3
- data/lib/modern_treasury/models/errors.rb +21 -7
- data/lib/modern_treasury/models/event.rb +12 -13
- data/lib/modern_treasury/models/expected_payment.rb +38 -41
- data/lib/modern_treasury/models/expected_payment_create_request.rb +43 -29
- data/lib/modern_treasury/models/expected_payment_update_request.rb +40 -27
- data/lib/modern_treasury/models/external_account.rb +26 -28
- data/lib/modern_treasury/models/external_account_complete_verification_request.rb +17 -4
- data/lib/modern_treasury/models/external_account_create_request.rb +36 -23
- data/lib/modern_treasury/models/external_account_update_request.rb +27 -14
- data/lib/modern_treasury/models/external_account_verify_request.rb +23 -9
- data/lib/modern_treasury/models/{fallback_type_enum.rb → fallback_type.rb} +3 -3
- data/lib/modern_treasury/models/{field_enum.rb → field.rb} +3 -3
- data/lib/modern_treasury/models/file.rb +4 -4
- data/lib/modern_treasury/models/{foreign_exchange_indicator_enum.rb → foreign_exchange_indicator.rb} +3 -3
- data/lib/modern_treasury/models/incoming_payment_detail.rb +41 -43
- data/lib/modern_treasury/models/incoming_payment_detail_create_request.rb +31 -17
- data/lib/modern_treasury/models/incoming_payment_detail_update_request.rb +17 -4
- data/lib/modern_treasury/models/internal_account.rb +32 -34
- data/lib/modern_treasury/models/internal_account_create_request.rb +28 -15
- data/lib/modern_treasury/models/internal_account_update_request.rb +22 -8
- data/lib/modern_treasury/models/invoice.rb +36 -38
- data/lib/modern_treasury/models/invoice_create_request.rb +38 -25
- data/lib/modern_treasury/models/invoice_line_item.rb +13 -15
- data/lib/modern_treasury/models/invoice_line_item_create_request.rb +22 -9
- data/lib/modern_treasury/models/invoice_line_item_update_request.rb +38 -25
- data/lib/modern_treasury/models/invoice_update_request.rb +40 -26
- data/lib/modern_treasury/models/invoicer_address.rb +23 -10
- data/lib/modern_treasury/models/{itemizable_type_enum.rb → itemizable_type.rb} +3 -3
- data/lib/modern_treasury/models/{itemizable_type1_enum.rb → itemizable_type1.rb} +3 -3
- data/lib/modern_treasury/models/ledger.rb +28 -14
- data/lib/modern_treasury/models/ledger_account.rb +21 -22
- data/lib/modern_treasury/models/ledger_account_category.rb +16 -17
- data/lib/modern_treasury/models/ledger_account_category_create_request.rb +26 -13
- data/lib/modern_treasury/models/ledger_account_category_update_request.rb +20 -6
- data/lib/modern_treasury/models/ledger_account_create_request.rb +30 -17
- data/lib/modern_treasury/models/{ledger_account_normal_balance_enum.rb → ledger_account_normal_balance.rb} +3 -3
- data/lib/modern_treasury/models/ledger_account_payout.rb +22 -24
- data/lib/modern_treasury/models/ledger_account_payout_create_request.rb +29 -14
- data/lib/modern_treasury/models/ledger_account_payout_update_request.rb +21 -7
- data/lib/modern_treasury/models/ledger_account_statement.rb +21 -23
- data/lib/modern_treasury/models/ledger_account_statement_create_request.rb +24 -10
- data/lib/modern_treasury/models/ledger_account_update_request.rb +20 -6
- data/lib/modern_treasury/models/ledger_balance.rb +6 -7
- data/lib/modern_treasury/models/ledger_balances.rb +4 -5
- data/lib/modern_treasury/models/ledger_balances_with_effective_at.rb +7 -8
- data/lib/modern_treasury/models/ledger_create_request.rb +20 -6
- data/lib/modern_treasury/models/ledger_entry.rb +24 -26
- data/lib/modern_treasury/models/ledger_entry_create_request.rb +30 -18
- data/lib/modern_treasury/models/ledger_entry_of_transaction_version.rb +21 -23
- data/lib/modern_treasury/models/ledger_event_handler.rb +14 -15
- data/lib/modern_treasury/models/ledger_event_handler_conditions.rb +4 -4
- data/lib/modern_treasury/models/ledger_event_handler_create_request.rb +23 -11
- data/lib/modern_treasury/models/ledger_event_handler_ledger_entries.rb +4 -4
- data/lib/modern_treasury/models/ledger_event_handler_ledger_transaction_template.rb +5 -6
- data/lib/modern_treasury/models/ledger_transaction.rb +24 -25
- data/lib/modern_treasury/models/ledger_transaction_create_request.rb +29 -17
- data/lib/modern_treasury/models/ledger_transaction_reversal_create_request.rb +27 -14
- data/lib/modern_treasury/models/ledger_transaction_update_request.rb +24 -10
- data/lib/modern_treasury/models/ledger_transaction_version.rb +24 -25
- data/lib/modern_treasury/models/{ledger_type_enum.rb → ledger_type.rb} +3 -3
- data/lib/modern_treasury/models/ledger_update_request.rb +20 -6
- data/lib/modern_treasury/models/ledgerable_event.rb +18 -19
- data/lib/modern_treasury/models/ledgerable_event_create_request.rb +26 -13
- data/lib/modern_treasury/models/{ledgerable_type_enum.rb → ledgerable_type.rb} +3 -3
- data/lib/modern_treasury/models/{ledgerable_type2_enum.rb → ledgerable_type2.rb} +3 -3
- data/lib/modern_treasury/models/{ledgerable_type5_enum.rb → ledgerable_type5.rb} +3 -3
- data/lib/modern_treasury/models/{ledgerable_type6_enum.rb → ledgerable_type6.rb} +3 -3
- data/lib/modern_treasury/models/legacy_document_create_request.rb +19 -5
- data/lib/modern_treasury/models/line_item.rb +18 -19
- data/lib/modern_treasury/models/line_item_request.rb +22 -8
- data/lib/modern_treasury/models/line_item_update_request.rb +17 -4
- data/lib/modern_treasury/models/mreturn.rb +48 -50
- data/lib/modern_treasury/models/{normal_balance_enum.rb → normal_balance.rb} +3 -3
- data/lib/modern_treasury/models/{normal_balance2_enum.rb → normal_balance2.rb} +3 -3
- data/lib/modern_treasury/models/order_by.rb +5 -5
- data/lib/modern_treasury/models/{originating_account_number_type_enum.rb → originating_account_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{originating_routing_number_type_enum.rb → originating_routing_number_type.rb} +3 -3
- data/lib/modern_treasury/models/paper_item.rb +25 -27
- data/lib/modern_treasury/models/party_address.rb +23 -10
- data/lib/modern_treasury/models/{party_type_enum.rb → party_type.rb} +3 -3
- data/lib/modern_treasury/models/{party_type5_enum.rb → party_type5.rb} +3 -3
- data/lib/modern_treasury/models/{payment_direction_enum.rb → payment_direction.rb} +3 -3
- data/lib/modern_treasury/models/payment_flow.rb +21 -22
- data/lib/modern_treasury/models/payment_flow_create_request.rb +24 -10
- data/lib/modern_treasury/models/payment_flow_update_request.rb +16 -4
- data/lib/modern_treasury/models/{payment_method_enum.rb → payment_method.rb} +3 -3
- data/lib/modern_treasury/models/{payment_method1_enum.rb → payment_method1.rb} +3 -3
- data/lib/modern_treasury/models/payment_order.rb +90 -95
- data/lib/modern_treasury/models/payment_order_async_create_request.rb +75 -62
- data/lib/modern_treasury/models/payment_order_create_request.rb +77 -63
- data/lib/modern_treasury/models/payment_order_update_request.rb +77 -62
- data/lib/modern_treasury/models/payment_reference.rb +12 -13
- data/lib/modern_treasury/models/payment_reference_object.rb +14 -15
- data/lib/modern_treasury/models/{payment_type_enum.rb → payment_type.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type1_enum.rb → payment_type1.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type13_enum.rb → payment_type13.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type2_enum.rb → payment_type2.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type4_enum.rb → payment_type4.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type5_enum.rb → payment_type5.rb} +3 -3
- data/lib/modern_treasury/models/{payment_type6_enum.rb → payment_type6.rb} +3 -3
- data/lib/modern_treasury/models/ping_response.rb +2 -2
- data/lib/modern_treasury/models/{priority_enum.rb → priority.rb} +3 -3
- data/lib/modern_treasury/models/{priority4_enum.rb → priority4.rb} +3 -3
- data/lib/modern_treasury/models/{reason_enum.rb → reason.rb} +3 -3
- data/lib/modern_treasury/models/{reason1_enum.rb → reason1.rb} +3 -3
- data/lib/modern_treasury/models/receiving_account.rb +43 -28
- data/lib/modern_treasury/models/receiving_account1.rb +34 -21
- data/lib/modern_treasury/models/{receiving_account_type_enum.rb → receiving_account_type.rb} +3 -3
- data/lib/modern_treasury/models/{reconciliation_method_enum.rb → reconciliation_method.rb} +3 -3
- data/lib/modern_treasury/models/{reference_number_type_enum.rb → reference_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{reference_number_type1_enum.rb → reference_number_type1.rb} +3 -3
- data/lib/modern_treasury/models/{referenceable_type_enum.rb → referenceable_type.rb} +3 -3
- data/lib/modern_treasury/models/{referenceable_type1_enum.rb → referenceable_type1.rb} +3 -3
- data/lib/modern_treasury/models/return_create_request.rb +24 -10
- data/lib/modern_treasury/models/{returnable_type_enum.rb → returnable_type.rb} +3 -3
- data/lib/modern_treasury/models/{returnable_type1_enum.rb → returnable_type1.rb} +3 -3
- data/lib/modern_treasury/models/reversal.rb +13 -14
- data/lib/modern_treasury/models/reversal_create_request.rb +21 -7
- data/lib/modern_treasury/models/{role_enum.rb → role.rb} +3 -3
- data/lib/modern_treasury/models/routing_detail.rb +20 -21
- data/lib/modern_treasury/models/routing_detail1.rb +23 -9
- data/lib/modern_treasury/models/routing_detail_create_request.rb +23 -9
- data/lib/modern_treasury/models/routing_number_lookup_request.rb +11 -11
- data/lib/modern_treasury/models/{routing_number_type_enum.rb → routing_number_type.rb} +3 -3
- data/lib/modern_treasury/models/{routing_number_type1_enum.rb → routing_number_type1.rb} +3 -3
- data/lib/modern_treasury/models/{routing_number_type7_enum.rb → routing_number_type7.rb} +3 -3
- data/lib/modern_treasury/models/{routing_number_type8_enum.rb → routing_number_type8.rb} +3 -3
- data/lib/modern_treasury/models/{status_enum.rb → status.rb} +3 -3
- data/lib/modern_treasury/models/{status1_enum.rb → status1.rb} +3 -3
- data/lib/modern_treasury/models/{status11_enum.rb → status11.rb} +3 -3
- data/lib/modern_treasury/models/{status12_enum.rb → status12.rb} +3 -3
- data/lib/modern_treasury/models/{status15_enum.rb → status15.rb} +3 -3
- data/lib/modern_treasury/models/{status16_enum.rb → status16.rb} +3 -3
- data/lib/modern_treasury/models/{status17_enum.rb → status17.rb} +3 -3
- data/lib/modern_treasury/models/{status18_enum.rb → status18.rb} +3 -3
- data/lib/modern_treasury/models/{status19_enum.rb → status19.rb} +3 -3
- data/lib/modern_treasury/models/{status2_enum.rb → status2.rb} +3 -3
- data/lib/modern_treasury/models/{status20_enum.rb → status20.rb} +3 -3
- data/lib/modern_treasury/models/{status21_enum.rb → status21.rb} +3 -3
- data/lib/modern_treasury/models/{status22_enum.rb → status22.rb} +3 -3
- data/lib/modern_treasury/models/{status24_enum.rb → status24.rb} +3 -3
- data/lib/modern_treasury/models/{status3_enum.rb → status3.rb} +3 -3
- data/lib/modern_treasury/models/{status4_enum.rb → status4.rb} +3 -3
- data/lib/modern_treasury/models/{status5_enum.rb → status5.rb} +3 -3
- data/lib/modern_treasury/models/{status6_enum.rb → status6.rb} +3 -3
- data/lib/modern_treasury/models/{status7_enum.rb → status7.rb} +3 -3
- data/lib/modern_treasury/models/{status8_enum.rb → status8.rb} +3 -3
- data/lib/modern_treasury/models/{status9_enum.rb → status9.rb} +3 -3
- data/lib/modern_treasury/models/{subtype_enum.rb → subtype.rb} +3 -3
- data/lib/modern_treasury/models/{supported_payment_type_enum.rb → supported_payment_type.rb} +3 -3
- data/lib/modern_treasury/models/{transactable_type_enum.rb → transactable_type.rb} +3 -3
- data/lib/modern_treasury/models/transaction.rb +31 -33
- data/lib/modern_treasury/models/transaction_line_item.rb +19 -20
- data/lib/modern_treasury/models/{type_enum.rb → type.rb} +3 -3
- data/lib/modern_treasury/models/{type1_enum.rb → type1.rb} +3 -3
- data/lib/modern_treasury/models/{type10_enum.rb → type10.rb} +3 -3
- data/lib/modern_treasury/models/{type11_enum.rb → type11.rb} +3 -3
- data/lib/modern_treasury/models/{type12_enum.rb → type12.rb} +3 -3
- data/lib/modern_treasury/models/{type13_enum.rb → type13.rb} +3 -3
- data/lib/modern_treasury/models/{type14_enum.rb → type14.rb} +3 -3
- data/lib/modern_treasury/models/{type16_enum.rb → type16.rb} +3 -3
- data/lib/modern_treasury/models/{type4_enum.rb → type4.rb} +3 -3
- data/lib/modern_treasury/models/{type5_enum.rb → type5.rb} +3 -3
- data/lib/modern_treasury/models/{type6_enum.rb → type6.rb} +3 -3
- data/lib/modern_treasury/models/{vendor_code_type_enum.rb → vendor_code_type.rb} +3 -3
- data/lib/modern_treasury/models/{vendor_code_type1_enum.rb → vendor_code_type1.rb} +3 -3
- data/lib/modern_treasury/models/{verification_status_enum.rb → verification_status.rb} +3 -3
- data/lib/modern_treasury/models/{verification_status1_enum.rb → verification_status1.rb} +3 -3
- data/lib/modern_treasury/models/virtual_account.rb +20 -21
- data/lib/modern_treasury/models/virtual_account_create_request.rb +29 -15
- data/lib/modern_treasury/models/virtual_account_update_request.rb +19 -6
- data/lib/modern_treasury.rb +153 -152
- metadata +152 -206
- data/test/controllers/controller_test_base.rb +0 -23
- data/test/controllers/test_account_collection_flow_controller.rb +0 -64
- data/test/controllers/test_connection_controller.rb +0 -41
- data/test/controllers/test_counterparty_controller.rb +0 -65
- data/test/controllers/test_document_controller.rb +0 -41
- data/test/controllers/test_event_controller.rb +0 -46
- data/test/controllers/test_expected_payment_controller.rb +0 -71
- data/test/controllers/test_external_account_controller.rb +0 -63
- data/test/controllers/test_incoming_payment_detail_controller.rb +0 -68
- data/test/controllers/test_internal_account_controller.rb +0 -65
- data/test/controllers/test_invoice_controller.rb +0 -56
- data/test/controllers/test_ledger_account_category_controller.rb +0 -67
- data/test/controllers/test_ledger_account_controller.rb +0 -70
- data/test/controllers/test_ledger_account_payout_controller.rb +0 -62
- data/test/controllers/test_ledger_account_statement_controller.rb +0 -36
- data/test/controllers/test_ledger_controller.rb +0 -59
- data/test/controllers/test_ledger_entry_controller.rb +0 -65
- data/test/controllers/test_ledger_event_handler_controller.rb +0 -63
- data/test/controllers/test_ledger_transaction_controller.rb +0 -112
- data/test/controllers/test_ledgerable_event_controller.rb +0 -36
- data/test/controllers/test_paper_item_controller.rb +0 -43
- data/test/controllers/test_payment_flow_controller.rb +0 -67
- data/test/controllers/test_payment_order_controller.rb +0 -76
- data/test/controllers/test_payment_reference_controller.rb +0 -43
- data/test/controllers/test_ping_controller.rb +0 -31
- data/test/controllers/test_return_controller.rb +0 -64
- data/test/controllers/test_transaction_controller.rb +0 -56
- data/test/controllers/test_virtual_account_controller.rb +0 -63
- data/test/http_response_catcher.rb +0 -19
|
@@ -45,7 +45,7 @@ module ModernTreasury
|
|
|
45
45
|
|
|
46
46
|
# This field will be true if this object exists in the live environment or
|
|
47
47
|
# false if it exists in the test environment.
|
|
48
|
-
# @return [
|
|
48
|
+
# @return [ContactIdentifierType]
|
|
49
49
|
attr_accessor :contact_identifier_type
|
|
50
50
|
|
|
51
51
|
# A mapping from model property names to API property names.
|
|
@@ -74,9 +74,8 @@ module ModernTreasury
|
|
|
74
74
|
]
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
def initialize(id
|
|
78
|
-
|
|
79
|
-
contact_identifier = nil, contact_identifier_type = nil)
|
|
77
|
+
def initialize(id:, object:, live_mode:, created_at:, updated_at:,
|
|
78
|
+
discarded_at:, contact_identifier:, contact_identifier_type:)
|
|
80
79
|
@id = id
|
|
81
80
|
@object = object
|
|
82
81
|
@live_mode = live_mode
|
|
@@ -110,14 +109,14 @@ module ModernTreasury
|
|
|
110
109
|
hash.key?('contact_identifier_type') ? hash['contact_identifier_type'] : nil
|
|
111
110
|
|
|
112
111
|
# Create object from extracted values.
|
|
113
|
-
ContactDetail.new(id,
|
|
114
|
-
object,
|
|
115
|
-
live_mode,
|
|
116
|
-
created_at,
|
|
117
|
-
updated_at,
|
|
118
|
-
discarded_at,
|
|
119
|
-
contact_identifier,
|
|
120
|
-
contact_identifier_type)
|
|
112
|
+
ContactDetail.new(id: id,
|
|
113
|
+
object: object,
|
|
114
|
+
live_mode: live_mode,
|
|
115
|
+
created_at: created_at,
|
|
116
|
+
updated_at: updated_at,
|
|
117
|
+
discarded_at: discarded_at,
|
|
118
|
+
contact_identifier: contact_identifier,
|
|
119
|
+
contact_identifier_type: contact_identifier_type)
|
|
121
120
|
end
|
|
122
121
|
|
|
123
122
|
def to_custom_created_at
|
|
@@ -152,7 +151,7 @@ module ModernTreasury
|
|
|
152
151
|
APIHelper.valid_type?(value.contact_identifier,
|
|
153
152
|
->(val) { val.instance_of? String }) and
|
|
154
153
|
APIHelper.valid_type?(value.contact_identifier_type,
|
|
155
|
-
->(val) {
|
|
154
|
+
->(val) { ContactIdentifierType.validate(val) })
|
|
156
155
|
)
|
|
157
156
|
end
|
|
158
157
|
|
|
@@ -174,7 +173,7 @@ module ModernTreasury
|
|
|
174
173
|
APIHelper.valid_type?(value['contact_identifier'],
|
|
175
174
|
->(val) { val.instance_of? String }) and
|
|
176
175
|
APIHelper.valid_type?(value['contact_identifier_type'],
|
|
177
|
-
->(val) {
|
|
176
|
+
->(val) { ContactIdentifierType.validate(val) })
|
|
178
177
|
)
|
|
179
178
|
end
|
|
180
179
|
|
|
@@ -14,7 +14,7 @@ module ModernTreasury
|
|
|
14
14
|
attr_accessor :contact_identifier
|
|
15
15
|
|
|
16
16
|
# TODO: Write general description for this method
|
|
17
|
-
# @return [
|
|
17
|
+
# @return [ContactIdentifierType]
|
|
18
18
|
attr_accessor :contact_identifier_type
|
|
19
19
|
|
|
20
20
|
# A mapping from model property names to API property names.
|
|
@@ -38,9 +38,14 @@ module ModernTreasury
|
|
|
38
38
|
[]
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
def initialize(contact_identifier
|
|
41
|
+
def initialize(contact_identifier: SKIP, contact_identifier_type: SKIP,
|
|
42
|
+
additional_properties: nil)
|
|
43
|
+
# Add additional model properties to the instance
|
|
44
|
+
additional_properties = {} if additional_properties.nil?
|
|
45
|
+
|
|
42
46
|
@contact_identifier = contact_identifier unless contact_identifier == SKIP
|
|
43
47
|
@contact_identifier_type = contact_identifier_type unless contact_identifier_type == SKIP
|
|
48
|
+
@additional_properties = additional_properties
|
|
44
49
|
end
|
|
45
50
|
|
|
46
51
|
# Creates an instance of the object from a hash.
|
|
@@ -53,23 +58,32 @@ module ModernTreasury
|
|
|
53
58
|
contact_identifier_type =
|
|
54
59
|
hash.key?('contact_identifier_type') ? hash['contact_identifier_type'] : SKIP
|
|
55
60
|
|
|
61
|
+
# Create a new hash for additional properties, removing known properties.
|
|
62
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
63
|
+
|
|
64
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
65
|
+
new_hash, proc { |value| value }
|
|
66
|
+
)
|
|
67
|
+
|
|
56
68
|
# Create object from extracted values.
|
|
57
|
-
ContactDetailCreateRequest.new(contact_identifier,
|
|
58
|
-
contact_identifier_type
|
|
69
|
+
ContactDetailCreateRequest.new(contact_identifier: contact_identifier,
|
|
70
|
+
contact_identifier_type: contact_identifier_type,
|
|
71
|
+
additional_properties: additional_properties)
|
|
59
72
|
end
|
|
60
73
|
|
|
61
74
|
# Provides a human-readable string representation of the object.
|
|
62
75
|
def to_s
|
|
63
76
|
class_name = self.class.name.split('::').last
|
|
64
77
|
"<#{class_name} contact_identifier: #{@contact_identifier}, contact_identifier_type:"\
|
|
65
|
-
" #{@contact_identifier_type}>"
|
|
78
|
+
" #{@contact_identifier_type}, additional_properties: #{@additional_properties}>"
|
|
66
79
|
end
|
|
67
80
|
|
|
68
81
|
# Provides a debugging-friendly string with detailed object information.
|
|
69
82
|
def inspect
|
|
70
83
|
class_name = self.class.name.split('::').last
|
|
71
84
|
"<#{class_name} contact_identifier: #{@contact_identifier.inspect},"\
|
|
72
|
-
" contact_identifier_type: #{@contact_identifier_type.inspect}
|
|
85
|
+
" contact_identifier_type: #{@contact_identifier_type.inspect}, additional_properties:"\
|
|
86
|
+
" #{@additional_properties}>"
|
|
73
87
|
end
|
|
74
88
|
end
|
|
75
89
|
end
|
data/lib/modern_treasury/models/{contact_identifier_type_enum.rb → contact_identifier_type.rb}
RENAMED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# ContactIdentifierType.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ContactIdentifierType
|
|
9
|
+
CONTACT_IDENTIFIER_TYPE = [
|
|
10
10
|
# TODO: Write general description for EMAIL
|
|
11
11
|
EMAIL = 'email'.freeze,
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ module ModernTreasury
|
|
|
20
20
|
def self.validate(value)
|
|
21
21
|
return false if value.nil?
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
CONTACT_IDENTIFIER_TYPE.include?(value)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def self.from_value(value, default_value = EMAIL)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# Content-Type.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class ContentType
|
|
9
|
+
CONTENT_TYPE = [
|
|
10
10
|
# TODO: Write general description for ENUM_APPLICATIONJSON
|
|
11
11
|
ENUM_APPLICATIONJSON = 'application/json'.freeze,
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ module ModernTreasury
|
|
|
17
17
|
def self.validate(value)
|
|
18
18
|
return false if value.nil?
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
CONTENT_TYPE.include?(value)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.from_value(value, default_value = ENUM_APPLICATIONJSON)
|
|
@@ -61,7 +61,7 @@ module ModernTreasury
|
|
|
61
61
|
attr_accessor :send_remittance_advice
|
|
62
62
|
|
|
63
63
|
# The verification status of the counterparty.
|
|
64
|
-
# @return [
|
|
64
|
+
# @return [VerificationStatus1]
|
|
65
65
|
attr_accessor :verification_status
|
|
66
66
|
|
|
67
67
|
# A mapping from model property names to API property names.
|
|
@@ -96,10 +96,9 @@ module ModernTreasury
|
|
|
96
96
|
]
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
-
def initialize(id
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
send_remittance_advice = nil, verification_status = nil)
|
|
99
|
+
def initialize(id:, object:, live_mode:, created_at:, updated_at:,
|
|
100
|
+
discarded_at:, name:, accounts:, email:, metadata:,
|
|
101
|
+
send_remittance_advice:, verification_status:)
|
|
103
102
|
@id = id
|
|
104
103
|
@object = object
|
|
105
104
|
@live_mode = live_mode
|
|
@@ -150,18 +149,18 @@ module ModernTreasury
|
|
|
150
149
|
hash.key?('verification_status') ? hash['verification_status'] : nil
|
|
151
150
|
|
|
152
151
|
# Create object from extracted values.
|
|
153
|
-
Counterparty.new(id,
|
|
154
|
-
object,
|
|
155
|
-
live_mode,
|
|
156
|
-
created_at,
|
|
157
|
-
updated_at,
|
|
158
|
-
discarded_at,
|
|
159
|
-
name,
|
|
160
|
-
accounts,
|
|
161
|
-
email,
|
|
162
|
-
metadata,
|
|
163
|
-
send_remittance_advice,
|
|
164
|
-
verification_status)
|
|
152
|
+
Counterparty.new(id: id,
|
|
153
|
+
object: object,
|
|
154
|
+
live_mode: live_mode,
|
|
155
|
+
created_at: created_at,
|
|
156
|
+
updated_at: updated_at,
|
|
157
|
+
discarded_at: discarded_at,
|
|
158
|
+
name: name,
|
|
159
|
+
accounts: accounts,
|
|
160
|
+
email: email,
|
|
161
|
+
metadata: metadata,
|
|
162
|
+
send_remittance_advice: send_remittance_advice,
|
|
163
|
+
verification_status: verification_status)
|
|
165
164
|
end
|
|
166
165
|
|
|
167
166
|
def to_custom_created_at
|
|
@@ -57,14 +57,18 @@ module ModernTreasury
|
|
|
57
57
|
[]
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
def initialize(line1
|
|
61
|
-
|
|
60
|
+
def initialize(line1:, locality:, region:, postal_code:, country:,
|
|
61
|
+
line2: SKIP, additional_properties: nil)
|
|
62
|
+
# Add additional model properties to the instance
|
|
63
|
+
additional_properties = {} if additional_properties.nil?
|
|
64
|
+
|
|
62
65
|
@line1 = line1
|
|
63
66
|
@line2 = line2 unless line2 == SKIP
|
|
64
67
|
@locality = locality
|
|
65
68
|
@region = region
|
|
66
69
|
@postal_code = postal_code
|
|
67
70
|
@country = country
|
|
71
|
+
@additional_properties = additional_properties
|
|
68
72
|
end
|
|
69
73
|
|
|
70
74
|
# Creates an instance of the object from a hash.
|
|
@@ -79,20 +83,29 @@ module ModernTreasury
|
|
|
79
83
|
country = hash.key?('country') ? hash['country'] : nil
|
|
80
84
|
line2 = hash.key?('line2') ? hash['line2'] : SKIP
|
|
81
85
|
|
|
86
|
+
# Create a new hash for additional properties, removing known properties.
|
|
87
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
88
|
+
|
|
89
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
90
|
+
new_hash, proc { |value| value }
|
|
91
|
+
)
|
|
92
|
+
|
|
82
93
|
# Create object from extracted values.
|
|
83
|
-
CounterpartyBillingAddress.new(line1,
|
|
84
|
-
locality,
|
|
85
|
-
region,
|
|
86
|
-
postal_code,
|
|
87
|
-
country,
|
|
88
|
-
line2
|
|
94
|
+
CounterpartyBillingAddress.new(line1: line1,
|
|
95
|
+
locality: locality,
|
|
96
|
+
region: region,
|
|
97
|
+
postal_code: postal_code,
|
|
98
|
+
country: country,
|
|
99
|
+
line2: line2,
|
|
100
|
+
additional_properties: additional_properties)
|
|
89
101
|
end
|
|
90
102
|
|
|
91
103
|
# Provides a human-readable string representation of the object.
|
|
92
104
|
def to_s
|
|
93
105
|
class_name = self.class.name.split('::').last
|
|
94
106
|
"<#{class_name} line1: #{@line1}, line2: #{@line2}, locality: #{@locality}, region:"\
|
|
95
|
-
" #{@region}, postal_code: #{@postal_code}, country: #{@country}
|
|
107
|
+
" #{@region}, postal_code: #{@postal_code}, country: #{@country}, additional_properties:"\
|
|
108
|
+
" #{@additional_properties}>"
|
|
96
109
|
end
|
|
97
110
|
|
|
98
111
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -100,7 +113,7 @@ module ModernTreasury
|
|
|
100
113
|
class_name = self.class.name.split('::').last
|
|
101
114
|
"<#{class_name} line1: #{@line1.inspect}, line2: #{@line2.inspect}, locality:"\
|
|
102
115
|
" #{@locality.inspect}, region: #{@region.inspect}, postal_code: #{@postal_code.inspect},"\
|
|
103
|
-
" country: #{@country.inspect}>"
|
|
116
|
+
" country: #{@country.inspect}, additional_properties: #{@additional_properties}>"
|
|
104
117
|
end
|
|
105
118
|
end
|
|
106
119
|
end
|
|
@@ -12,7 +12,7 @@ module ModernTreasury
|
|
|
12
12
|
# One of `credit` or `debit`. Use `credit` when you want to pay a
|
|
13
13
|
# counterparty. Use `debit` when you need to charge a counterparty. This
|
|
14
14
|
# field helps us send a more tailored email to your counterparties."
|
|
15
|
-
# @return [
|
|
15
|
+
# @return [Direction]
|
|
16
16
|
attr_accessor :direction
|
|
17
17
|
|
|
18
18
|
# By default, Modern Treasury will send an email to your counterparty that
|
|
@@ -28,7 +28,7 @@ module ModernTreasury
|
|
|
28
28
|
# options is [\"name\", \"nameOnAccount\", \"taxpayerIdentifier\",
|
|
29
29
|
# \"accountType\", \"accountNumber\", \"routingNumber\", \"address\",
|
|
30
30
|
# \"ibanNumber\", \"swiftCode\"].
|
|
31
|
-
# @return [Array[
|
|
31
|
+
# @return [Array[Field]]
|
|
32
32
|
attr_accessor :fields
|
|
33
33
|
|
|
34
34
|
# The URL you want your customer to visit upon filling out the form. By
|
|
@@ -61,12 +61,16 @@ module ModernTreasury
|
|
|
61
61
|
[]
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
def initialize(direction
|
|
65
|
-
custom_redirect
|
|
64
|
+
def initialize(direction:, send_email: SKIP, fields: SKIP,
|
|
65
|
+
custom_redirect: SKIP, additional_properties: nil)
|
|
66
|
+
# Add additional model properties to the instance
|
|
67
|
+
additional_properties = {} if additional_properties.nil?
|
|
68
|
+
|
|
66
69
|
@direction = direction
|
|
67
70
|
@send_email = send_email unless send_email == SKIP
|
|
68
71
|
@fields = fields unless fields == SKIP
|
|
69
72
|
@custom_redirect = custom_redirect unless custom_redirect == SKIP
|
|
73
|
+
@additional_properties = additional_properties
|
|
70
74
|
end
|
|
71
75
|
|
|
72
76
|
# Creates an instance of the object from a hash.
|
|
@@ -80,25 +84,34 @@ module ModernTreasury
|
|
|
80
84
|
custom_redirect =
|
|
81
85
|
hash.key?('custom_redirect') ? hash['custom_redirect'] : SKIP
|
|
82
86
|
|
|
87
|
+
# Create a new hash for additional properties, removing known properties.
|
|
88
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
89
|
+
|
|
90
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
91
|
+
new_hash, proc { |value| value }
|
|
92
|
+
)
|
|
93
|
+
|
|
83
94
|
# Create object from extracted values.
|
|
84
|
-
CounterpartyCollectAccountRequest.new(direction,
|
|
85
|
-
send_email,
|
|
86
|
-
fields,
|
|
87
|
-
custom_redirect
|
|
95
|
+
CounterpartyCollectAccountRequest.new(direction: direction,
|
|
96
|
+
send_email: send_email,
|
|
97
|
+
fields: fields,
|
|
98
|
+
custom_redirect: custom_redirect,
|
|
99
|
+
additional_properties: additional_properties)
|
|
88
100
|
end
|
|
89
101
|
|
|
90
102
|
# Provides a human-readable string representation of the object.
|
|
91
103
|
def to_s
|
|
92
104
|
class_name = self.class.name.split('::').last
|
|
93
105
|
"<#{class_name} direction: #{@direction}, send_email: #{@send_email}, fields: #{@fields},"\
|
|
94
|
-
" custom_redirect: #{@custom_redirect}>"
|
|
106
|
+
" custom_redirect: #{@custom_redirect}, additional_properties: #{@additional_properties}>"
|
|
95
107
|
end
|
|
96
108
|
|
|
97
109
|
# Provides a debugging-friendly string with detailed object information.
|
|
98
110
|
def inspect
|
|
99
111
|
class_name = self.class.name.split('::').last
|
|
100
112
|
"<#{class_name} direction: #{@direction.inspect}, send_email: #{@send_email.inspect},"\
|
|
101
|
-
" fields: #{@fields.inspect}, custom_redirect: #{@custom_redirect.inspect}
|
|
113
|
+
" fields: #{@fields.inspect}, custom_redirect: #{@custom_redirect.inspect},"\
|
|
114
|
+
" additional_properties: #{@additional_properties}>"
|
|
102
115
|
end
|
|
103
116
|
end
|
|
104
117
|
end
|
|
@@ -45,7 +45,7 @@ module ModernTreasury
|
|
|
45
45
|
[]
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
def initialize(id
|
|
48
|
+
def initialize(id:, is_resend:, form_link:)
|
|
49
49
|
@id = id
|
|
50
50
|
@is_resend = is_resend
|
|
51
51
|
@form_link = form_link
|
|
@@ -61,9 +61,9 @@ module ModernTreasury
|
|
|
61
61
|
form_link = hash.key?('form_link') ? hash['form_link'] : nil
|
|
62
62
|
|
|
63
63
|
# Create object from extracted values.
|
|
64
|
-
CounterpartyCollectAccountResponse.new(id,
|
|
65
|
-
is_resend,
|
|
66
|
-
form_link)
|
|
64
|
+
CounterpartyCollectAccountResponse.new(id: id,
|
|
65
|
+
is_resend: is_resend,
|
|
66
|
+
form_link: form_link)
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
# Provides a human-readable string representation of the object.
|
|
@@ -32,7 +32,7 @@ module ModernTreasury
|
|
|
32
32
|
attr_accessor :send_remittance_advice
|
|
33
33
|
|
|
34
34
|
# The verification status of the counterparty.
|
|
35
|
-
# @return [
|
|
35
|
+
# @return [VerificationStatus1]
|
|
36
36
|
attr_accessor :verification_status
|
|
37
37
|
|
|
38
38
|
# The verification status of the counterparty.
|
|
@@ -41,7 +41,7 @@ module ModernTreasury
|
|
|
41
41
|
|
|
42
42
|
# An optional type to auto-sync the counterparty to your ledger. Either
|
|
43
43
|
# `customer` or `vendor`.
|
|
44
|
-
# @return [
|
|
44
|
+
# @return [LedgerType]
|
|
45
45
|
attr_accessor :ledger_type
|
|
46
46
|
|
|
47
47
|
# Either a valid SSN or EIN.
|
|
@@ -85,10 +85,13 @@ module ModernTreasury
|
|
|
85
85
|
]
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
def initialize(name
|
|
89
|
-
send_remittance_advice
|
|
90
|
-
accounting
|
|
91
|
-
taxpayer_identifier
|
|
88
|
+
def initialize(name:, accounts: SKIP, email: SKIP, metadata: SKIP,
|
|
89
|
+
send_remittance_advice: SKIP, verification_status: SKIP,
|
|
90
|
+
accounting: SKIP, ledger_type: SKIP,
|
|
91
|
+
taxpayer_identifier: SKIP, additional_properties: nil)
|
|
92
|
+
# Add additional model properties to the instance
|
|
93
|
+
additional_properties = {} if additional_properties.nil?
|
|
94
|
+
|
|
92
95
|
@name = name
|
|
93
96
|
@accounts = accounts unless accounts == SKIP
|
|
94
97
|
@email = email unless email == SKIP
|
|
@@ -98,6 +101,7 @@ module ModernTreasury
|
|
|
98
101
|
@accounting = accounting unless accounting == SKIP
|
|
99
102
|
@ledger_type = ledger_type unless ledger_type == SKIP
|
|
100
103
|
@taxpayer_identifier = taxpayer_identifier unless taxpayer_identifier == SKIP
|
|
104
|
+
@additional_properties = additional_properties
|
|
101
105
|
end
|
|
102
106
|
|
|
103
107
|
# Creates an instance of the object from a hash.
|
|
@@ -127,16 +131,24 @@ module ModernTreasury
|
|
|
127
131
|
taxpayer_identifier =
|
|
128
132
|
hash.key?('taxpayer_identifier') ? hash['taxpayer_identifier'] : SKIP
|
|
129
133
|
|
|
134
|
+
# Create a new hash for additional properties, removing known properties.
|
|
135
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
136
|
+
|
|
137
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
138
|
+
new_hash, proc { |value| value }
|
|
139
|
+
)
|
|
140
|
+
|
|
130
141
|
# Create object from extracted values.
|
|
131
|
-
CounterpartyCreateRequest.new(name,
|
|
132
|
-
accounts,
|
|
133
|
-
email,
|
|
134
|
-
metadata,
|
|
135
|
-
send_remittance_advice,
|
|
136
|
-
verification_status,
|
|
137
|
-
accounting,
|
|
138
|
-
ledger_type,
|
|
139
|
-
taxpayer_identifier
|
|
142
|
+
CounterpartyCreateRequest.new(name: name,
|
|
143
|
+
accounts: accounts,
|
|
144
|
+
email: email,
|
|
145
|
+
metadata: metadata,
|
|
146
|
+
send_remittance_advice: send_remittance_advice,
|
|
147
|
+
verification_status: verification_status,
|
|
148
|
+
accounting: accounting,
|
|
149
|
+
ledger_type: ledger_type,
|
|
150
|
+
taxpayer_identifier: taxpayer_identifier,
|
|
151
|
+
additional_properties: additional_properties)
|
|
140
152
|
end
|
|
141
153
|
|
|
142
154
|
# Provides a human-readable string representation of the object.
|
|
@@ -145,7 +157,8 @@ module ModernTreasury
|
|
|
145
157
|
"<#{class_name} name: #{@name}, accounts: #{@accounts}, email: #{@email}, metadata:"\
|
|
146
158
|
" #{@metadata}, send_remittance_advice: #{@send_remittance_advice}, verification_status:"\
|
|
147
159
|
" #{@verification_status}, accounting: #{@accounting}, ledger_type: #{@ledger_type},"\
|
|
148
|
-
" taxpayer_identifier: #{@taxpayer_identifier}
|
|
160
|
+
" taxpayer_identifier: #{@taxpayer_identifier}, additional_properties:"\
|
|
161
|
+
" #{@additional_properties}>"
|
|
149
162
|
end
|
|
150
163
|
|
|
151
164
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -155,7 +168,8 @@ module ModernTreasury
|
|
|
155
168
|
" #{@email.inspect}, metadata: #{@metadata.inspect}, send_remittance_advice:"\
|
|
156
169
|
" #{@send_remittance_advice.inspect}, verification_status: #{@verification_status.inspect},"\
|
|
157
170
|
" accounting: #{@accounting.inspect}, ledger_type: #{@ledger_type.inspect},"\
|
|
158
|
-
" taxpayer_identifier: #{@taxpayer_identifier.inspect}
|
|
171
|
+
" taxpayer_identifier: #{@taxpayer_identifier.inspect}, additional_properties:"\
|
|
172
|
+
" #{@additional_properties}>"
|
|
159
173
|
end
|
|
160
174
|
end
|
|
161
175
|
end
|
|
@@ -58,14 +58,18 @@ module ModernTreasury
|
|
|
58
58
|
[]
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def initialize(line1
|
|
62
|
-
|
|
61
|
+
def initialize(line1:, locality:, region:, postal_code:, country:,
|
|
62
|
+
line2: SKIP, additional_properties: nil)
|
|
63
|
+
# Add additional model properties to the instance
|
|
64
|
+
additional_properties = {} if additional_properties.nil?
|
|
65
|
+
|
|
63
66
|
@line1 = line1
|
|
64
67
|
@line2 = line2 unless line2 == SKIP
|
|
65
68
|
@locality = locality
|
|
66
69
|
@region = region
|
|
67
70
|
@postal_code = postal_code
|
|
68
71
|
@country = country
|
|
72
|
+
@additional_properties = additional_properties
|
|
69
73
|
end
|
|
70
74
|
|
|
71
75
|
# Creates an instance of the object from a hash.
|
|
@@ -80,20 +84,29 @@ module ModernTreasury
|
|
|
80
84
|
country = hash.key?('country') ? hash['country'] : nil
|
|
81
85
|
line2 = hash.key?('line2') ? hash['line2'] : SKIP
|
|
82
86
|
|
|
87
|
+
# Create a new hash for additional properties, removing known properties.
|
|
88
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
89
|
+
|
|
90
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
91
|
+
new_hash, proc { |value| value }
|
|
92
|
+
)
|
|
93
|
+
|
|
83
94
|
# Create object from extracted values.
|
|
84
|
-
CounterpartyShippingAddress.new(line1,
|
|
85
|
-
locality,
|
|
86
|
-
region,
|
|
87
|
-
postal_code,
|
|
88
|
-
country,
|
|
89
|
-
line2
|
|
95
|
+
CounterpartyShippingAddress.new(line1: line1,
|
|
96
|
+
locality: locality,
|
|
97
|
+
region: region,
|
|
98
|
+
postal_code: postal_code,
|
|
99
|
+
country: country,
|
|
100
|
+
line2: line2,
|
|
101
|
+
additional_properties: additional_properties)
|
|
90
102
|
end
|
|
91
103
|
|
|
92
104
|
# Provides a human-readable string representation of the object.
|
|
93
105
|
def to_s
|
|
94
106
|
class_name = self.class.name.split('::').last
|
|
95
107
|
"<#{class_name} line1: #{@line1}, line2: #{@line2}, locality: #{@locality}, region:"\
|
|
96
|
-
" #{@region}, postal_code: #{@postal_code}, country: #{@country}
|
|
108
|
+
" #{@region}, postal_code: #{@postal_code}, country: #{@country}, additional_properties:"\
|
|
109
|
+
" #{@additional_properties}>"
|
|
97
110
|
end
|
|
98
111
|
|
|
99
112
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -101,7 +114,7 @@ module ModernTreasury
|
|
|
101
114
|
class_name = self.class.name.split('::').last
|
|
102
115
|
"<#{class_name} line1: #{@line1.inspect}, line2: #{@line2.inspect}, locality:"\
|
|
103
116
|
" #{@locality.inspect}, region: #{@region.inspect}, postal_code: #{@postal_code.inspect},"\
|
|
104
|
-
" country: #{@country.inspect}>"
|
|
117
|
+
" country: #{@country.inspect}, additional_properties: #{@additional_properties}>"
|
|
105
118
|
end
|
|
106
119
|
end
|
|
107
120
|
end
|
|
@@ -58,13 +58,18 @@ module ModernTreasury
|
|
|
58
58
|
[]
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def initialize(name
|
|
62
|
-
send_remittance_advice
|
|
61
|
+
def initialize(name: SKIP, email: SKIP, metadata: SKIP,
|
|
62
|
+
send_remittance_advice: SKIP, taxpayer_identifier: SKIP,
|
|
63
|
+
additional_properties: nil)
|
|
64
|
+
# Add additional model properties to the instance
|
|
65
|
+
additional_properties = {} if additional_properties.nil?
|
|
66
|
+
|
|
63
67
|
@name = name unless name == SKIP
|
|
64
68
|
@email = email unless email == SKIP
|
|
65
69
|
@metadata = metadata unless metadata == SKIP
|
|
66
70
|
@send_remittance_advice = send_remittance_advice unless send_remittance_advice == SKIP
|
|
67
71
|
@taxpayer_identifier = taxpayer_identifier unless taxpayer_identifier == SKIP
|
|
72
|
+
@additional_properties = additional_properties
|
|
68
73
|
end
|
|
69
74
|
|
|
70
75
|
# Creates an instance of the object from a hash.
|
|
@@ -80,12 +85,20 @@ module ModernTreasury
|
|
|
80
85
|
taxpayer_identifier =
|
|
81
86
|
hash.key?('taxpayer_identifier') ? hash['taxpayer_identifier'] : SKIP
|
|
82
87
|
|
|
88
|
+
# Create a new hash for additional properties, removing known properties.
|
|
89
|
+
new_hash = hash.reject { |k, _| names.value?(k) }
|
|
90
|
+
|
|
91
|
+
additional_properties = APIHelper.get_additional_properties(
|
|
92
|
+
new_hash, proc { |value| value }
|
|
93
|
+
)
|
|
94
|
+
|
|
83
95
|
# Create object from extracted values.
|
|
84
|
-
CounterpartyUpdateRequest.new(name,
|
|
85
|
-
email,
|
|
86
|
-
metadata,
|
|
87
|
-
send_remittance_advice,
|
|
88
|
-
taxpayer_identifier
|
|
96
|
+
CounterpartyUpdateRequest.new(name: name,
|
|
97
|
+
email: email,
|
|
98
|
+
metadata: metadata,
|
|
99
|
+
send_remittance_advice: send_remittance_advice,
|
|
100
|
+
taxpayer_identifier: taxpayer_identifier,
|
|
101
|
+
additional_properties: additional_properties)
|
|
89
102
|
end
|
|
90
103
|
|
|
91
104
|
# Provides a human-readable string representation of the object.
|
|
@@ -93,7 +106,7 @@ module ModernTreasury
|
|
|
93
106
|
class_name = self.class.name.split('::').last
|
|
94
107
|
"<#{class_name} name: #{@name}, email: #{@email}, metadata: #{@metadata},"\
|
|
95
108
|
" send_remittance_advice: #{@send_remittance_advice}, taxpayer_identifier:"\
|
|
96
|
-
" #{@taxpayer_identifier}>"
|
|
109
|
+
" #{@taxpayer_identifier}, additional_properties: #{@additional_properties}>"
|
|
97
110
|
end
|
|
98
111
|
|
|
99
112
|
# Provides a debugging-friendly string with detailed object information.
|
|
@@ -101,7 +114,8 @@ module ModernTreasury
|
|
|
101
114
|
class_name = self.class.name.split('::').last
|
|
102
115
|
"<#{class_name} name: #{@name.inspect}, email: #{@email.inspect}, metadata:"\
|
|
103
116
|
" #{@metadata.inspect}, send_remittance_advice: #{@send_remittance_advice.inspect},"\
|
|
104
|
-
" taxpayer_identifier: #{@taxpayer_identifier.inspect}
|
|
117
|
+
" taxpayer_identifier: #{@taxpayer_identifier.inspect}, additional_properties:"\
|
|
118
|
+
" #{@additional_properties}>"
|
|
105
119
|
end
|
|
106
120
|
end
|
|
107
121
|
end
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# CreatedAt.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class CreatedAt
|
|
9
|
+
CREATED_AT = [
|
|
10
10
|
# TODO: Write general description for ASC
|
|
11
11
|
ASC = 'asc'.freeze,
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ module ModernTreasury
|
|
|
17
17
|
def self.validate(value)
|
|
18
18
|
return false if value.nil?
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
CREATED_AT.include?(value)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.from_value(value, default_value = ASC)
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
module ModernTreasury
|
|
7
7
|
# Three-letter ISO currency code.
|
|
8
|
-
class
|
|
9
|
-
|
|
8
|
+
class Currency
|
|
9
|
+
CURRENCY = [
|
|
10
10
|
# TODO: Write general description for AED
|
|
11
11
|
AED = 'AED'.freeze,
|
|
12
12
|
|
|
@@ -578,7 +578,7 @@ module ModernTreasury
|
|
|
578
578
|
def self.validate(value)
|
|
579
579
|
return false if value.nil?
|
|
580
580
|
|
|
581
|
-
|
|
581
|
+
CURRENCY.include?(value)
|
|
582
582
|
end
|
|
583
583
|
|
|
584
584
|
def self.from_value(value, default_value = AED)
|