mt-sdk 0.0.1
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 +7 -0
- data/LICENSE +28 -0
- data/README.md +188 -0
- data/bin/console +15 -0
- data/lib/modern_treasury/api_helper.rb +10 -0
- data/lib/modern_treasury/client.rb +275 -0
- data/lib/modern_treasury/configuration.rb +206 -0
- data/lib/modern_treasury/controllers/account_collection_flow_controller.rb +130 -0
- data/lib/modern_treasury/controllers/account_detail_controller.rb +131 -0
- data/lib/modern_treasury/controllers/balance_report_controller.rb +76 -0
- data/lib/modern_treasury/controllers/base_controller.rb +60 -0
- data/lib/modern_treasury/controllers/connection_controller.rb +40 -0
- data/lib/modern_treasury/controllers/counterparty_controller.rb +188 -0
- data/lib/modern_treasury/controllers/document_controller.rb +285 -0
- data/lib/modern_treasury/controllers/event_controller.rb +72 -0
- data/lib/modern_treasury/controllers/expected_payment_controller.rb +162 -0
- data/lib/modern_treasury/controllers/external_account_controller.rb +202 -0
- data/lib/modern_treasury/controllers/incoming_payment_detail_controller.rb +150 -0
- data/lib/modern_treasury/controllers/internal_account_controller.rb +134 -0
- data/lib/modern_treasury/controllers/invoice_controller.rb +98 -0
- data/lib/modern_treasury/controllers/invoice_line_item_controller.rb +136 -0
- data/lib/modern_treasury/controllers/ledger_account_category_controller.rb +292 -0
- data/lib/modern_treasury/controllers/ledger_account_controller.rb +202 -0
- data/lib/modern_treasury/controllers/ledger_account_payout_controller.rb +126 -0
- data/lib/modern_treasury/controllers/ledger_account_statement_controller.rb +60 -0
- data/lib/modern_treasury/controllers/ledger_controller.rb +152 -0
- data/lib/modern_treasury/controllers/ledger_entry_controller.rb +148 -0
- data/lib/modern_treasury/controllers/ledger_event_handler_controller.rb +119 -0
- data/lib/modern_treasury/controllers/ledger_transaction_controller.rb +328 -0
- data/lib/modern_treasury/controllers/ledgerable_event_controller.rb +61 -0
- data/lib/modern_treasury/controllers/line_item_controller.rb +107 -0
- data/lib/modern_treasury/controllers/paper_item_controller.rb +69 -0
- data/lib/modern_treasury/controllers/payment_flow_controller.rb +138 -0
- data/lib/modern_treasury/controllers/payment_order_controller.rb +368 -0
- data/lib/modern_treasury/controllers/payment_reference_controller.rb +64 -0
- data/lib/modern_treasury/controllers/ping_controller.rb +34 -0
- data/lib/modern_treasury/controllers/return_controller.rb +105 -0
- data/lib/modern_treasury/controllers/reversal_controller.rb +99 -0
- data/lib/modern_treasury/controllers/routing_detail_controller.rb +131 -0
- data/lib/modern_treasury/controllers/transaction_controller.rb +133 -0
- data/lib/modern_treasury/controllers/transaction_line_item_controller.rb +39 -0
- data/lib/modern_treasury/controllers/validation_controller.rb +41 -0
- data/lib/modern_treasury/controllers/virtual_account_controller.rb +142 -0
- data/lib/modern_treasury/exceptions/api_exception.rb +21 -0
- data/lib/modern_treasury/exceptions/error_message_exception.rb +46 -0
- data/lib/modern_treasury/http/auth/basic_auth.rb +62 -0
- data/lib/modern_treasury/http/http_call_back.rb +10 -0
- data/lib/modern_treasury/http/http_method_enum.rb +10 -0
- data/lib/modern_treasury/http/http_request.rb +10 -0
- data/lib/modern_treasury/http/http_response.rb +10 -0
- data/lib/modern_treasury/http/proxy_settings.rb +22 -0
- data/lib/modern_treasury/models/account.rb +304 -0
- data/lib/modern_treasury/models/account1.rb +217 -0
- data/lib/modern_treasury/models/account_collection_flow.rb +178 -0
- data/lib/modern_treasury/models/account_collection_flow_create_request.rb +70 -0
- data/lib/modern_treasury/models/account_collection_flow_update_request.rb +61 -0
- data/lib/modern_treasury/models/account_detail.rb +211 -0
- data/lib/modern_treasury/models/account_detail1.rb +74 -0
- data/lib/modern_treasury/models/account_detail_create_request.rb +75 -0
- data/lib/modern_treasury/models/account_number_type2_enum.rb +48 -0
- data/lib/modern_treasury/models/account_number_type_enum.rb +49 -0
- data/lib/modern_treasury/models/account_type5_enum.rb +56 -0
- data/lib/modern_treasury/models/account_type_enum.rb +56 -0
- data/lib/modern_treasury/models/accounting.rb +88 -0
- data/lib/modern_treasury/models/accounting1.rb +63 -0
- data/lib/modern_treasury/models/accounts_type1_enum.rb +26 -0
- data/lib/modern_treasury/models/accounts_type_enum.rb +36 -0
- data/lib/modern_treasury/models/address.rb +231 -0
- data/lib/modern_treasury/models/address_request.rb +118 -0
- data/lib/modern_treasury/models/async_response.rb +68 -0
- data/lib/modern_treasury/models/balance.rb +164 -0
- data/lib/modern_treasury/models/balance_report.rb +178 -0
- data/lib/modern_treasury/models/balance_report_type1_enum.rb +44 -0
- data/lib/modern_treasury/models/balance_report_type_enum.rb +45 -0
- data/lib/modern_treasury/models/balance_type_enum.rb +63 -0
- data/lib/modern_treasury/models/balances.rb +71 -0
- data/lib/modern_treasury/models/balances1.rb +81 -0
- data/lib/modern_treasury/models/balances2.rb +120 -0
- data/lib/modern_treasury/models/balances3.rb +130 -0
- data/lib/modern_treasury/models/base_model.rb +110 -0
- data/lib/modern_treasury/models/charge_bearer_enum.rb +42 -0
- data/lib/modern_treasury/models/code1_enum.rb +200 -0
- data/lib/modern_treasury/models/code_enum.rb +68 -0
- data/lib/modern_treasury/models/connection.rb +209 -0
- data/lib/modern_treasury/models/contact_detail.rb +200 -0
- data/lib/modern_treasury/models/contact_detail_create_request.rb +75 -0
- data/lib/modern_treasury/models/contact_identifier_type_enum.rb +40 -0
- data/lib/modern_treasury/models/content_type_enum.rb +36 -0
- data/lib/modern_treasury/models/counterparty.rb +200 -0
- data/lib/modern_treasury/models/counterparty_billing_address.rb +106 -0
- data/lib/modern_treasury/models/counterparty_collect_account_request.rb +104 -0
- data/lib/modern_treasury/models/counterparty_collect_account_response.rb +82 -0
- data/lib/modern_treasury/models/counterparty_create_request.rb +161 -0
- data/lib/modern_treasury/models/counterparty_shipping_address.rb +107 -0
- data/lib/modern_treasury/models/counterparty_update_request.rb +107 -0
- data/lib/modern_treasury/models/created_at_enum.rb +36 -0
- data/lib/modern_treasury/models/currency1_enum.rb +37 -0
- data/lib/modern_treasury/models/currency_enum.rb +784 -0
- data/lib/modern_treasury/models/direction10_enum.rb +38 -0
- data/lib/modern_treasury/models/direction14_enum.rb +36 -0
- data/lib/modern_treasury/models/direction15_enum.rb +36 -0
- data/lib/modern_treasury/models/direction1_enum.rb +37 -0
- data/lib/modern_treasury/models/direction4_enum.rb +36 -0
- data/lib/modern_treasury/models/direction5_enum.rb +39 -0
- data/lib/modern_treasury/models/direction9_enum.rb +37 -0
- data/lib/modern_treasury/models/direction_enum.rb +38 -0
- data/lib/modern_treasury/models/document.rb +207 -0
- data/lib/modern_treasury/models/document_create_request.rb +92 -0
- data/lib/modern_treasury/models/document_detail.rb +154 -0
- data/lib/modern_treasury/models/documentable_type1_enum.rb +72 -0
- data/lib/modern_treasury/models/documentable_type2_enum.rb +72 -0
- data/lib/modern_treasury/models/documentable_type_enum.rb +75 -0
- data/lib/modern_treasury/models/effective_at_enum.rb +36 -0
- data/lib/modern_treasury/models/errors.rb +81 -0
- data/lib/modern_treasury/models/event.rb +162 -0
- data/lib/modern_treasury/models/expected_payment.rb +343 -0
- data/lib/modern_treasury/models/expected_payment_create_request.rb +254 -0
- data/lib/modern_treasury/models/expected_payment_update_request.rb +239 -0
- data/lib/modern_treasury/models/external_account.rb +283 -0
- data/lib/modern_treasury/models/external_account_complete_verification_request.rb +62 -0
- data/lib/modern_treasury/models/external_account_create_request.rb +230 -0
- data/lib/modern_treasury/models/external_account_update_request.rb +132 -0
- data/lib/modern_treasury/models/external_account_verify_request.rb +83 -0
- data/lib/modern_treasury/models/fallback_type_enum.rb +28 -0
- data/lib/modern_treasury/models/field_enum.rb +112 -0
- data/lib/modern_treasury/models/file.rb +81 -0
- data/lib/modern_treasury/models/foreign_exchange_indicator_enum.rb +38 -0
- data/lib/modern_treasury/models/incoming_payment_detail.rb +348 -0
- data/lib/modern_treasury/models/incoming_payment_detail_create_request.rb +141 -0
- data/lib/modern_treasury/models/incoming_payment_detail_update_request.rb +63 -0
- data/lib/modern_treasury/models/internal_account.rb +361 -0
- data/lib/modern_treasury/models/internal_account_create_request.rb +135 -0
- data/lib/modern_treasury/models/internal_account_update_request.rb +95 -0
- data/lib/modern_treasury/models/invoice.rb +342 -0
- data/lib/modern_treasury/models/invoice_create_request.rb +235 -0
- data/lib/modern_treasury/models/invoice_line_item.rb +171 -0
- data/lib/modern_treasury/models/invoice_line_item_create_request.rb +104 -0
- data/lib/modern_treasury/models/invoice_line_item_update_request.rb +240 -0
- data/lib/modern_treasury/models/invoice_update_request.rb +251 -0
- data/lib/modern_treasury/models/invoicer_address.rb +106 -0
- data/lib/modern_treasury/models/itemizable_type1_enum.rb +36 -0
- data/lib/modern_treasury/models/itemizable_type_enum.rb +36 -0
- data/lib/modern_treasury/models/ledger.rb +158 -0
- data/lib/modern_treasury/models/ledger_account.rb +220 -0
- data/lib/modern_treasury/models/ledger_account_category.rb +187 -0
- data/lib/modern_treasury/models/ledger_account_category_create_request.rb +125 -0
- data/lib/modern_treasury/models/ledger_account_category_update_request.rb +84 -0
- data/lib/modern_treasury/models/ledger_account_create_request.rb +150 -0
- data/lib/modern_treasury/models/ledger_account_normal_balance_enum.rb +36 -0
- data/lib/modern_treasury/models/ledger_account_payout.rb +238 -0
- data/lib/modern_treasury/models/ledger_account_payout_create_request.rb +152 -0
- data/lib/modern_treasury/models/ledger_account_payout_update_request.rb +85 -0
- data/lib/modern_treasury/models/ledger_account_statement.rb +233 -0
- data/lib/modern_treasury/models/ledger_account_statement_create_request.rb +122 -0
- data/lib/modern_treasury/models/ledger_account_update_request.rb +84 -0
- data/lib/modern_treasury/models/ledger_balance.rb +97 -0
- data/lib/modern_treasury/models/ledger_balances.rb +81 -0
- data/lib/modern_treasury/models/ledger_balances_with_effective_at.rb +123 -0
- data/lib/modern_treasury/models/ledger_create_request.rb +83 -0
- data/lib/modern_treasury/models/ledger_entry.rb +247 -0
- data/lib/modern_treasury/models/ledger_entry_create_request.rb +177 -0
- data/lib/modern_treasury/models/ledger_entry_of_transaction_version.rb +214 -0
- data/lib/modern_treasury/models/ledger_event_handler.rb +182 -0
- data/lib/modern_treasury/models/ledger_event_handler_conditions.rb +78 -0
- data/lib/modern_treasury/models/ledger_event_handler_create_request.rb +119 -0
- data/lib/modern_treasury/models/ledger_event_handler_ledger_entries.rb +80 -0
- data/lib/modern_treasury/models/ledger_event_handler_ledger_transaction_template.rb +103 -0
- data/lib/modern_treasury/models/ledger_transaction.rb +259 -0
- data/lib/modern_treasury/models/ledger_transaction_create_request.rb +164 -0
- data/lib/modern_treasury/models/ledger_transaction_reversal_create_request.rb +142 -0
- data/lib/modern_treasury/models/ledger_transaction_update_request.rb +115 -0
- data/lib/modern_treasury/models/ledger_transaction_version.rb +254 -0
- data/lib/modern_treasury/models/ledger_type_enum.rb +37 -0
- data/lib/modern_treasury/models/ledger_update_request.rb +84 -0
- data/lib/modern_treasury/models/ledgerable_event.rb +206 -0
- data/lib/modern_treasury/models/ledgerable_event_create_request.rb +140 -0
- data/lib/modern_treasury/models/ledgerable_type2_enum.rb +71 -0
- data/lib/modern_treasury/models/ledgerable_type5_enum.rb +69 -0
- data/lib/modern_treasury/models/ledgerable_type6_enum.rb +68 -0
- data/lib/modern_treasury/models/ledgerable_type_enum.rb +38 -0
- data/lib/modern_treasury/models/legacy_document_create_request.rb +70 -0
- data/lib/modern_treasury/models/line_item.rb +200 -0
- data/lib/modern_treasury/models/line_item_request.rb +98 -0
- data/lib/modern_treasury/models/line_item_update_request.rb +63 -0
- data/lib/modern_treasury/models/mreturn.rb +425 -0
- data/lib/modern_treasury/models/normal_balance2_enum.rb +36 -0
- data/lib/modern_treasury/models/normal_balance_enum.rb +36 -0
- data/lib/modern_treasury/models/order_by.rb +72 -0
- data/lib/modern_treasury/models/originating_account_number_type_enum.rb +48 -0
- data/lib/modern_treasury/models/originating_routing_number_type_enum.rb +68 -0
- data/lib/modern_treasury/models/paper_item.rb +249 -0
- data/lib/modern_treasury/models/party_address.rb +106 -0
- data/lib/modern_treasury/models/party_type5_enum.rb +36 -0
- data/lib/modern_treasury/models/party_type_enum.rb +36 -0
- data/lib/modern_treasury/models/payment_direction_enum.rb +36 -0
- data/lib/modern_treasury/models/payment_flow.rb +230 -0
- data/lib/modern_treasury/models/payment_flow_create_request.rb +103 -0
- data/lib/modern_treasury/models/payment_flow_update_request.rb +61 -0
- data/lib/modern_treasury/models/payment_method1_enum.rb +46 -0
- data/lib/modern_treasury/models/payment_method_enum.rb +42 -0
- data/lib/modern_treasury/models/payment_order.rb +820 -0
- data/lib/modern_treasury/models/payment_order_async_create_request.rb +536 -0
- data/lib/modern_treasury/models/payment_order_create_request.rb +556 -0
- data/lib/modern_treasury/models/payment_order_update_request.rb +543 -0
- data/lib/modern_treasury/models/payment_reference.rb +175 -0
- data/lib/modern_treasury/models/payment_reference_object.rb +156 -0
- data/lib/modern_treasury/models/payment_type13_enum.rb +96 -0
- data/lib/modern_treasury/models/payment_type1_enum.rb +97 -0
- data/lib/modern_treasury/models/payment_type2_enum.rb +96 -0
- data/lib/modern_treasury/models/payment_type4_enum.rb +96 -0
- data/lib/modern_treasury/models/payment_type5_enum.rb +36 -0
- data/lib/modern_treasury/models/payment_type6_enum.rb +97 -0
- data/lib/modern_treasury/models/payment_type_enum.rb +37 -0
- data/lib/modern_treasury/models/ping_response.rb +60 -0
- data/lib/modern_treasury/models/priority4_enum.rb +36 -0
- data/lib/modern_treasury/models/priority_enum.rb +38 -0
- data/lib/modern_treasury/models/reason1_enum.rb +50 -0
- data/lib/modern_treasury/models/reason_enum.rb +48 -0
- data/lib/modern_treasury/models/receiving_account.rb +304 -0
- data/lib/modern_treasury/models/receiving_account1.rb +219 -0
- data/lib/modern_treasury/models/receiving_account_type_enum.rb +36 -0
- data/lib/modern_treasury/models/reconciliation_method_enum.rb +38 -0
- data/lib/modern_treasury/models/reference_number_type1_enum.rb +248 -0
- data/lib/modern_treasury/models/reference_number_type_enum.rb +248 -0
- data/lib/modern_treasury/models/referenceable_type1_enum.rb +40 -0
- data/lib/modern_treasury/models/referenceable_type_enum.rb +41 -0
- data/lib/modern_treasury/models/return_create_request.rb +119 -0
- data/lib/modern_treasury/models/returnable_type1_enum.rb +48 -0
- data/lib/modern_treasury/models/returnable_type_enum.rb +48 -0
- data/lib/modern_treasury/models/reversal.rb +151 -0
- data/lib/modern_treasury/models/reversal_create_request.rb +86 -0
- data/lib/modern_treasury/models/role_enum.rb +36 -0
- data/lib/modern_treasury/models/routing_detail.rb +242 -0
- data/lib/modern_treasury/models/routing_detail1.rb +83 -0
- data/lib/modern_treasury/models/routing_detail_create_request.rb +87 -0
- data/lib/modern_treasury/models/routing_number_lookup_request.rb +124 -0
- data/lib/modern_treasury/models/routing_number_type1_enum.rb +68 -0
- data/lib/modern_treasury/models/routing_number_type7_enum.rb +55 -0
- data/lib/modern_treasury/models/routing_number_type8_enum.rb +68 -0
- data/lib/modern_treasury/models/routing_number_type_enum.rb +69 -0
- data/lib/modern_treasury/models/status11_enum.rb +40 -0
- data/lib/modern_treasury/models/status12_enum.rb +40 -0
- data/lib/modern_treasury/models/status15_enum.rb +41 -0
- data/lib/modern_treasury/models/status16_enum.rb +41 -0
- data/lib/modern_treasury/models/status17_enum.rb +45 -0
- data/lib/modern_treasury/models/status18_enum.rb +74 -0
- data/lib/modern_treasury/models/status19_enum.rb +52 -0
- data/lib/modern_treasury/models/status1_enum.rb +40 -0
- data/lib/modern_treasury/models/status20_enum.rb +40 -0
- data/lib/modern_treasury/models/status21_enum.rb +40 -0
- data/lib/modern_treasury/models/status22_enum.rb +40 -0
- data/lib/modern_treasury/models/status24_enum.rb +72 -0
- data/lib/modern_treasury/models/status2_enum.rb +41 -0
- data/lib/modern_treasury/models/status3_enum.rb +72 -0
- data/lib/modern_treasury/models/status4_enum.rb +52 -0
- data/lib/modern_treasury/models/status5_enum.rb +48 -0
- data/lib/modern_treasury/models/status6_enum.rb +49 -0
- data/lib/modern_treasury/models/status7_enum.rb +37 -0
- data/lib/modern_treasury/models/status8_enum.rb +37 -0
- data/lib/modern_treasury/models/status9_enum.rb +41 -0
- data/lib/modern_treasury/models/status_enum.rb +45 -0
- data/lib/modern_treasury/models/subtype_enum.rb +71 -0
- data/lib/modern_treasury/models/supported_payment_type_enum.rb +96 -0
- data/lib/modern_treasury/models/transactable_type_enum.rb +53 -0
- data/lib/modern_treasury/models/transaction.rb +311 -0
- data/lib/modern_treasury/models/transaction_line_item.rb +211 -0
- data/lib/modern_treasury/models/type10_enum.rb +64 -0
- data/lib/modern_treasury/models/type11_enum.rb +97 -0
- data/lib/modern_treasury/models/type12_enum.rb +37 -0
- data/lib/modern_treasury/models/type13_enum.rb +96 -0
- data/lib/modern_treasury/models/type14_enum.rb +64 -0
- data/lib/modern_treasury/models/type16_enum.rb +36 -0
- data/lib/modern_treasury/models/type1_enum.rb +97 -0
- data/lib/modern_treasury/models/type4_enum.rb +65 -0
- data/lib/modern_treasury/models/type5_enum.rb +97 -0
- data/lib/modern_treasury/models/type6_enum.rb +77 -0
- data/lib/modern_treasury/models/type_enum.rb +37 -0
- data/lib/modern_treasury/models/vendor_code_type1_enum.rb +111 -0
- data/lib/modern_treasury/models/vendor_code_type_enum.rb +108 -0
- data/lib/modern_treasury/models/verification_status1_enum.rb +44 -0
- data/lib/modern_treasury/models/verification_status_enum.rb +40 -0
- data/lib/modern_treasury/models/virtual_account.rb +247 -0
- data/lib/modern_treasury/models/virtual_account_create_request.rb +172 -0
- data/lib/modern_treasury/models/virtual_account_update_request.rb +85 -0
- data/lib/modern_treasury/utilities/date_time_helper.rb +11 -0
- data/lib/modern_treasury/utilities/file_wrapper.rb +28 -0
- data/lib/modern_treasury/utilities/union_type_lookup.rb +32 -0
- data/lib/modern_treasury.rb +316 -0
- data/test/controllers/controller_test_base.rb +23 -0
- data/test/controllers/test_account_collection_flow_controller.rb +64 -0
- data/test/controllers/test_connection_controller.rb +41 -0
- data/test/controllers/test_counterparty_controller.rb +65 -0
- data/test/controllers/test_document_controller.rb +41 -0
- data/test/controllers/test_event_controller.rb +46 -0
- data/test/controllers/test_expected_payment_controller.rb +71 -0
- data/test/controllers/test_external_account_controller.rb +63 -0
- data/test/controllers/test_incoming_payment_detail_controller.rb +68 -0
- data/test/controllers/test_internal_account_controller.rb +65 -0
- data/test/controllers/test_invoice_controller.rb +56 -0
- data/test/controllers/test_ledger_account_category_controller.rb +67 -0
- data/test/controllers/test_ledger_account_controller.rb +70 -0
- data/test/controllers/test_ledger_account_payout_controller.rb +62 -0
- data/test/controllers/test_ledger_account_statement_controller.rb +36 -0
- data/test/controllers/test_ledger_controller.rb +59 -0
- data/test/controllers/test_ledger_entry_controller.rb +65 -0
- data/test/controllers/test_ledger_event_handler_controller.rb +63 -0
- data/test/controllers/test_ledger_transaction_controller.rb +112 -0
- data/test/controllers/test_ledgerable_event_controller.rb +36 -0
- data/test/controllers/test_paper_item_controller.rb +43 -0
- data/test/controllers/test_payment_flow_controller.rb +67 -0
- data/test/controllers/test_payment_order_controller.rb +76 -0
- data/test/controllers/test_payment_reference_controller.rb +43 -0
- data/test/controllers/test_ping_controller.rb +31 -0
- data/test/controllers/test_return_controller.rb +64 -0
- data/test/controllers/test_transaction_controller.rb +56 -0
- data/test/controllers/test_virtual_account_controller.rb +63 -0
- data/test/http_response_catcher.rb +19 -0
- metadata +429 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# modern_treasury
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module ModernTreasury
|
|
8
|
+
# LedgerBalancesWithEffectiveAt Model.
|
|
9
|
+
class LedgerBalancesWithEffectiveAt < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# The inclusive lower bound of the effective_at timestamp for the returned
|
|
14
|
+
# balances.
|
|
15
|
+
# @return [DateTime]
|
|
16
|
+
attr_accessor :effective_at_lower_bound
|
|
17
|
+
|
|
18
|
+
# The exclusive upper bound of the effective_at timestamp for the returned
|
|
19
|
+
# balances.
|
|
20
|
+
# @return [DateTime]
|
|
21
|
+
attr_accessor :effective_at_upper_bound
|
|
22
|
+
|
|
23
|
+
# The exclusive upper bound of the effective_at timestamp for the returned
|
|
24
|
+
# balances.
|
|
25
|
+
# @return [LedgerBalance]
|
|
26
|
+
attr_accessor :pending_balance
|
|
27
|
+
|
|
28
|
+
# The exclusive upper bound of the effective_at timestamp for the returned
|
|
29
|
+
# balances.
|
|
30
|
+
# @return [LedgerBalance]
|
|
31
|
+
attr_accessor :posted_balance
|
|
32
|
+
|
|
33
|
+
# The exclusive upper bound of the effective_at timestamp for the returned
|
|
34
|
+
# balances.
|
|
35
|
+
# @return [LedgerBalance]
|
|
36
|
+
attr_accessor :available_balance
|
|
37
|
+
|
|
38
|
+
# A mapping from model property names to API property names.
|
|
39
|
+
def self.names
|
|
40
|
+
@_hash = {} if @_hash.nil?
|
|
41
|
+
@_hash['effective_at_lower_bound'] = 'effective_at_lower_bound'
|
|
42
|
+
@_hash['effective_at_upper_bound'] = 'effective_at_upper_bound'
|
|
43
|
+
@_hash['pending_balance'] = 'pending_balance'
|
|
44
|
+
@_hash['posted_balance'] = 'posted_balance'
|
|
45
|
+
@_hash['available_balance'] = 'available_balance'
|
|
46
|
+
@_hash
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# An array for optional fields
|
|
50
|
+
def self.optionals
|
|
51
|
+
[]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# An array for nullable fields
|
|
55
|
+
def self.nullables
|
|
56
|
+
%w[
|
|
57
|
+
effective_at_lower_bound
|
|
58
|
+
effective_at_upper_bound
|
|
59
|
+
]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def initialize(effective_at_lower_bound = nil,
|
|
63
|
+
effective_at_upper_bound = nil, pending_balance = nil,
|
|
64
|
+
posted_balance = nil, available_balance = nil)
|
|
65
|
+
@effective_at_lower_bound = effective_at_lower_bound
|
|
66
|
+
@effective_at_upper_bound = effective_at_upper_bound
|
|
67
|
+
@pending_balance = pending_balance
|
|
68
|
+
@posted_balance = posted_balance
|
|
69
|
+
@available_balance = available_balance
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Creates an instance of the object from a hash.
|
|
73
|
+
def self.from_hash(hash)
|
|
74
|
+
return nil unless hash
|
|
75
|
+
|
|
76
|
+
# Extract variables from the hash.
|
|
77
|
+
effective_at_lower_bound = if hash.key?('effective_at_lower_bound')
|
|
78
|
+
(DateTimeHelper.from_rfc3339(hash['effective_at_lower_bound']) if hash['effective_at_lower_bound'])
|
|
79
|
+
end
|
|
80
|
+
effective_at_upper_bound = if hash.key?('effective_at_upper_bound')
|
|
81
|
+
(DateTimeHelper.from_rfc3339(hash['effective_at_upper_bound']) if hash['effective_at_upper_bound'])
|
|
82
|
+
end
|
|
83
|
+
pending_balance = LedgerBalance.from_hash(hash['pending_balance']) if
|
|
84
|
+
hash['pending_balance']
|
|
85
|
+
posted_balance = LedgerBalance.from_hash(hash['posted_balance']) if hash['posted_balance']
|
|
86
|
+
available_balance = LedgerBalance.from_hash(hash['available_balance']) if
|
|
87
|
+
hash['available_balance']
|
|
88
|
+
|
|
89
|
+
# Create object from extracted values.
|
|
90
|
+
LedgerBalancesWithEffectiveAt.new(effective_at_lower_bound,
|
|
91
|
+
effective_at_upper_bound,
|
|
92
|
+
pending_balance,
|
|
93
|
+
posted_balance,
|
|
94
|
+
available_balance)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def to_custom_effective_at_lower_bound
|
|
98
|
+
DateTimeHelper.to_rfc3339(effective_at_lower_bound)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def to_custom_effective_at_upper_bound
|
|
102
|
+
DateTimeHelper.to_rfc3339(effective_at_upper_bound)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Provides a human-readable string representation of the object.
|
|
106
|
+
def to_s
|
|
107
|
+
class_name = self.class.name.split('::').last
|
|
108
|
+
"<#{class_name} effective_at_lower_bound: #{@effective_at_lower_bound},"\
|
|
109
|
+
" effective_at_upper_bound: #{@effective_at_upper_bound}, pending_balance:"\
|
|
110
|
+
" #{@pending_balance}, posted_balance: #{@posted_balance}, available_balance:"\
|
|
111
|
+
" #{@available_balance}>"
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
115
|
+
def inspect
|
|
116
|
+
class_name = self.class.name.split('::').last
|
|
117
|
+
"<#{class_name} effective_at_lower_bound: #{@effective_at_lower_bound.inspect},"\
|
|
118
|
+
" effective_at_upper_bound: #{@effective_at_upper_bound.inspect}, pending_balance:"\
|
|
119
|
+
" #{@pending_balance.inspect}, posted_balance: #{@posted_balance.inspect},"\
|
|
120
|
+
" available_balance: #{@available_balance.inspect}>"
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# modern_treasury
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ModernTreasury
|
|
7
|
+
# LedgerCreateRequest Model.
|
|
8
|
+
class LedgerCreateRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# The name of the ledger.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :name
|
|
15
|
+
|
|
16
|
+
# An optional free-form description for internal use.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :description
|
|
19
|
+
|
|
20
|
+
# Additional data represented as key-value pairs. Both the key and value
|
|
21
|
+
# must be strings.
|
|
22
|
+
# @return [Hash[String, String]]
|
|
23
|
+
attr_accessor :metadata
|
|
24
|
+
|
|
25
|
+
# A mapping from model property names to API property names.
|
|
26
|
+
def self.names
|
|
27
|
+
@_hash = {} if @_hash.nil?
|
|
28
|
+
@_hash['name'] = 'name'
|
|
29
|
+
@_hash['description'] = 'description'
|
|
30
|
+
@_hash['metadata'] = 'metadata'
|
|
31
|
+
@_hash
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# An array for optional fields
|
|
35
|
+
def self.optionals
|
|
36
|
+
%w[
|
|
37
|
+
description
|
|
38
|
+
metadata
|
|
39
|
+
]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# An array for nullable fields
|
|
43
|
+
def self.nullables
|
|
44
|
+
%w[
|
|
45
|
+
description
|
|
46
|
+
]
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def initialize(name = nil, description = SKIP, metadata = SKIP)
|
|
50
|
+
@name = name
|
|
51
|
+
@description = description unless description == SKIP
|
|
52
|
+
@metadata = metadata unless metadata == SKIP
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Creates an instance of the object from a hash.
|
|
56
|
+
def self.from_hash(hash)
|
|
57
|
+
return nil unless hash
|
|
58
|
+
|
|
59
|
+
# Extract variables from the hash.
|
|
60
|
+
name = hash.key?('name') ? hash['name'] : nil
|
|
61
|
+
description = hash.key?('description') ? hash['description'] : SKIP
|
|
62
|
+
metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
|
|
63
|
+
|
|
64
|
+
# Create object from extracted values.
|
|
65
|
+
LedgerCreateRequest.new(name,
|
|
66
|
+
description,
|
|
67
|
+
metadata)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Provides a human-readable string representation of the object.
|
|
71
|
+
def to_s
|
|
72
|
+
class_name = self.class.name.split('::').last
|
|
73
|
+
"<#{class_name} name: #{@name}, description: #{@description}, metadata: #{@metadata}>"
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
77
|
+
def inspect
|
|
78
|
+
class_name = self.class.name.split('::').last
|
|
79
|
+
"<#{class_name} name: #{@name.inspect}, description: #{@description.inspect}, metadata:"\
|
|
80
|
+
" #{@metadata.inspect}>"
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# modern_treasury
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
require 'date'
|
|
7
|
+
module ModernTreasury
|
|
8
|
+
# LedgerEntry Model.
|
|
9
|
+
class LedgerEntry < BaseModel
|
|
10
|
+
SKIP = Object.new
|
|
11
|
+
private_constant :SKIP
|
|
12
|
+
|
|
13
|
+
# TODO: Write general description for this method
|
|
14
|
+
# @return [UUID | String]
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# TODO: Write general description for this method
|
|
18
|
+
# @return [String]
|
|
19
|
+
attr_accessor :object
|
|
20
|
+
|
|
21
|
+
# This field will be true if this object exists in the live environment or
|
|
22
|
+
# false if it exists in the test environment.
|
|
23
|
+
# @return [TrueClass | FalseClass]
|
|
24
|
+
attr_accessor :live_mode
|
|
25
|
+
|
|
26
|
+
# This field will be true if this object exists in the live environment or
|
|
27
|
+
# false if it exists in the test environment.
|
|
28
|
+
# @return [DateTime]
|
|
29
|
+
attr_accessor :created_at
|
|
30
|
+
|
|
31
|
+
# This field will be true if this object exists in the live environment or
|
|
32
|
+
# false if it exists in the test environment.
|
|
33
|
+
# @return [DateTime]
|
|
34
|
+
attr_accessor :updated_at
|
|
35
|
+
|
|
36
|
+
# This field will be true if this object exists in the live environment or
|
|
37
|
+
# false if it exists in the test environment.
|
|
38
|
+
# @return [DateTime]
|
|
39
|
+
attr_accessor :discarded_at
|
|
40
|
+
|
|
41
|
+
# Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
42
|
+
# as 1000. Can be any integer up to 36 digits.
|
|
43
|
+
# @return [Integer]
|
|
44
|
+
attr_accessor :amount
|
|
45
|
+
|
|
46
|
+
# One of `credit`, `debit`. Describes the direction money is flowing in the
|
|
47
|
+
# transaction. A `credit` moves money from your account to someone else's. A
|
|
48
|
+
# `debit` pulls money from someone else's account to your own. Note that
|
|
49
|
+
# wire, rtp, and check payments will always be `credit`.
|
|
50
|
+
# @return [Direction5Enum]
|
|
51
|
+
attr_accessor :direction
|
|
52
|
+
|
|
53
|
+
# Equal to the state of the ledger transaction when the ledger entry was
|
|
54
|
+
# created. One of `pending`, `posted`, or `archived`.
|
|
55
|
+
# @return [Status9Enum]
|
|
56
|
+
attr_accessor :status
|
|
57
|
+
|
|
58
|
+
# The ledger account that this ledger entry is associated with.
|
|
59
|
+
# @return [UUID | String]
|
|
60
|
+
attr_accessor :ledger_account_id
|
|
61
|
+
|
|
62
|
+
# Lock version of the ledger account. This can be passed when creating a
|
|
63
|
+
# ledger transaction to only succeed if no ledger transactions have posted
|
|
64
|
+
# since the given version. See our post about Designing the Ledgers API with
|
|
65
|
+
# Optimistic Locking for more details.
|
|
66
|
+
# @return [Integer]
|
|
67
|
+
attr_accessor :ledger_account_lock_version
|
|
68
|
+
|
|
69
|
+
# The currency of the ledger account.
|
|
70
|
+
# @return [String]
|
|
71
|
+
attr_accessor :ledger_account_currency
|
|
72
|
+
|
|
73
|
+
# The currency exponent of the ledger account.
|
|
74
|
+
# @return [Integer]
|
|
75
|
+
attr_accessor :ledger_account_currency_exponent
|
|
76
|
+
|
|
77
|
+
# The ledger transaction that this ledger entry is associated with.
|
|
78
|
+
# @return [String]
|
|
79
|
+
attr_accessor :ledger_transaction_id
|
|
80
|
+
|
|
81
|
+
# The ledger transaction that this ledger entry is associated with.
|
|
82
|
+
# @return [LedgerBalances]
|
|
83
|
+
attr_accessor :resulting_ledger_account_balances
|
|
84
|
+
|
|
85
|
+
# Additional data represented as key-value pairs. Both the key and value
|
|
86
|
+
# must be strings.
|
|
87
|
+
# @return [Hash[String, String]]
|
|
88
|
+
attr_accessor :metadata
|
|
89
|
+
|
|
90
|
+
# A mapping from model property names to API property names.
|
|
91
|
+
def self.names
|
|
92
|
+
@_hash = {} if @_hash.nil?
|
|
93
|
+
@_hash['id'] = 'id'
|
|
94
|
+
@_hash['object'] = 'object'
|
|
95
|
+
@_hash['live_mode'] = 'live_mode'
|
|
96
|
+
@_hash['created_at'] = 'created_at'
|
|
97
|
+
@_hash['updated_at'] = 'updated_at'
|
|
98
|
+
@_hash['discarded_at'] = 'discarded_at'
|
|
99
|
+
@_hash['amount'] = 'amount'
|
|
100
|
+
@_hash['direction'] = 'direction'
|
|
101
|
+
@_hash['status'] = 'status'
|
|
102
|
+
@_hash['ledger_account_id'] = 'ledger_account_id'
|
|
103
|
+
@_hash['ledger_account_lock_version'] = 'ledger_account_lock_version'
|
|
104
|
+
@_hash['ledger_account_currency'] = 'ledger_account_currency'
|
|
105
|
+
@_hash['ledger_account_currency_exponent'] =
|
|
106
|
+
'ledger_account_currency_exponent'
|
|
107
|
+
@_hash['ledger_transaction_id'] = 'ledger_transaction_id'
|
|
108
|
+
@_hash['resulting_ledger_account_balances'] =
|
|
109
|
+
'resulting_ledger_account_balances'
|
|
110
|
+
@_hash['metadata'] = 'metadata'
|
|
111
|
+
@_hash
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# An array for optional fields
|
|
115
|
+
def self.optionals
|
|
116
|
+
[]
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# An array for nullable fields
|
|
120
|
+
def self.nullables
|
|
121
|
+
%w[
|
|
122
|
+
discarded_at
|
|
123
|
+
ledger_account_lock_version
|
|
124
|
+
]
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def initialize(id = nil, object = nil, live_mode = nil, created_at = nil,
|
|
128
|
+
updated_at = nil, discarded_at = nil, amount = nil,
|
|
129
|
+
direction = nil, status = nil, ledger_account_id = nil,
|
|
130
|
+
ledger_account_lock_version = nil,
|
|
131
|
+
ledger_account_currency = nil,
|
|
132
|
+
ledger_account_currency_exponent = nil,
|
|
133
|
+
ledger_transaction_id = nil,
|
|
134
|
+
resulting_ledger_account_balances = nil, metadata = nil)
|
|
135
|
+
@id = id
|
|
136
|
+
@object = object
|
|
137
|
+
@live_mode = live_mode
|
|
138
|
+
@created_at = created_at
|
|
139
|
+
@updated_at = updated_at
|
|
140
|
+
@discarded_at = discarded_at
|
|
141
|
+
@amount = amount
|
|
142
|
+
@direction = direction
|
|
143
|
+
@status = status
|
|
144
|
+
@ledger_account_id = ledger_account_id
|
|
145
|
+
@ledger_account_lock_version = ledger_account_lock_version
|
|
146
|
+
@ledger_account_currency = ledger_account_currency
|
|
147
|
+
@ledger_account_currency_exponent = ledger_account_currency_exponent
|
|
148
|
+
@ledger_transaction_id = ledger_transaction_id
|
|
149
|
+
@resulting_ledger_account_balances = resulting_ledger_account_balances
|
|
150
|
+
@metadata = metadata
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Creates an instance of the object from a hash.
|
|
154
|
+
def self.from_hash(hash)
|
|
155
|
+
return nil unless hash
|
|
156
|
+
|
|
157
|
+
# Extract variables from the hash.
|
|
158
|
+
id = hash.key?('id') ? hash['id'] : nil
|
|
159
|
+
object = hash.key?('object') ? hash['object'] : nil
|
|
160
|
+
live_mode = hash.key?('live_mode') ? hash['live_mode'] : nil
|
|
161
|
+
created_at = if hash.key?('created_at')
|
|
162
|
+
(DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
|
|
163
|
+
end
|
|
164
|
+
updated_at = if hash.key?('updated_at')
|
|
165
|
+
(DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
|
|
166
|
+
end
|
|
167
|
+
discarded_at = if hash.key?('discarded_at')
|
|
168
|
+
(DateTimeHelper.from_rfc3339(hash['discarded_at']) if hash['discarded_at'])
|
|
169
|
+
end
|
|
170
|
+
amount = hash.key?('amount') ? hash['amount'] : nil
|
|
171
|
+
direction = hash.key?('direction') ? hash['direction'] : nil
|
|
172
|
+
status = hash.key?('status') ? hash['status'] : nil
|
|
173
|
+
ledger_account_id =
|
|
174
|
+
hash.key?('ledger_account_id') ? hash['ledger_account_id'] : nil
|
|
175
|
+
ledger_account_lock_version =
|
|
176
|
+
hash.key?('ledger_account_lock_version') ? hash['ledger_account_lock_version'] : nil
|
|
177
|
+
ledger_account_currency =
|
|
178
|
+
hash.key?('ledger_account_currency') ? hash['ledger_account_currency'] : nil
|
|
179
|
+
ledger_account_currency_exponent =
|
|
180
|
+
hash.key?('ledger_account_currency_exponent') ? hash['ledger_account_currency_exponent'] : nil
|
|
181
|
+
ledger_transaction_id =
|
|
182
|
+
hash.key?('ledger_transaction_id') ? hash['ledger_transaction_id'] : nil
|
|
183
|
+
if hash['resulting_ledger_account_balances']
|
|
184
|
+
resulting_ledger_account_balances = LedgerBalances.from_hash(hash['resulting_ledger_account_balances'])
|
|
185
|
+
end
|
|
186
|
+
metadata = hash.key?('metadata') ? hash['metadata'] : nil
|
|
187
|
+
|
|
188
|
+
# Create object from extracted values.
|
|
189
|
+
LedgerEntry.new(id,
|
|
190
|
+
object,
|
|
191
|
+
live_mode,
|
|
192
|
+
created_at,
|
|
193
|
+
updated_at,
|
|
194
|
+
discarded_at,
|
|
195
|
+
amount,
|
|
196
|
+
direction,
|
|
197
|
+
status,
|
|
198
|
+
ledger_account_id,
|
|
199
|
+
ledger_account_lock_version,
|
|
200
|
+
ledger_account_currency,
|
|
201
|
+
ledger_account_currency_exponent,
|
|
202
|
+
ledger_transaction_id,
|
|
203
|
+
resulting_ledger_account_balances,
|
|
204
|
+
metadata)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
def to_custom_created_at
|
|
208
|
+
DateTimeHelper.to_rfc3339(created_at)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def to_custom_updated_at
|
|
212
|
+
DateTimeHelper.to_rfc3339(updated_at)
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def to_custom_discarded_at
|
|
216
|
+
DateTimeHelper.to_rfc3339(discarded_at)
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Provides a human-readable string representation of the object.
|
|
220
|
+
def to_s
|
|
221
|
+
class_name = self.class.name.split('::').last
|
|
222
|
+
"<#{class_name} id: #{@id}, object: #{@object}, live_mode: #{@live_mode}, created_at:"\
|
|
223
|
+
" #{@created_at}, updated_at: #{@updated_at}, discarded_at: #{@discarded_at}, amount:"\
|
|
224
|
+
" #{@amount}, direction: #{@direction}, status: #{@status}, ledger_account_id:"\
|
|
225
|
+
" #{@ledger_account_id}, ledger_account_lock_version: #{@ledger_account_lock_version},"\
|
|
226
|
+
" ledger_account_currency: #{@ledger_account_currency}, ledger_account_currency_exponent:"\
|
|
227
|
+
" #{@ledger_account_currency_exponent}, ledger_transaction_id: #{@ledger_transaction_id},"\
|
|
228
|
+
" resulting_ledger_account_balances: #{@resulting_ledger_account_balances}, metadata:"\
|
|
229
|
+
" #{@metadata}>"
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
233
|
+
def inspect
|
|
234
|
+
class_name = self.class.name.split('::').last
|
|
235
|
+
"<#{class_name} id: #{@id.inspect}, object: #{@object.inspect}, live_mode:"\
|
|
236
|
+
" #{@live_mode.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
|
|
237
|
+
" #{@updated_at.inspect}, discarded_at: #{@discarded_at.inspect}, amount:"\
|
|
238
|
+
" #{@amount.inspect}, direction: #{@direction.inspect}, status: #{@status.inspect},"\
|
|
239
|
+
" ledger_account_id: #{@ledger_account_id.inspect}, ledger_account_lock_version:"\
|
|
240
|
+
" #{@ledger_account_lock_version.inspect}, ledger_account_currency:"\
|
|
241
|
+
" #{@ledger_account_currency.inspect}, ledger_account_currency_exponent:"\
|
|
242
|
+
" #{@ledger_account_currency_exponent.inspect}, ledger_transaction_id:"\
|
|
243
|
+
" #{@ledger_transaction_id.inspect}, resulting_ledger_account_balances:"\
|
|
244
|
+
" #{@resulting_ledger_account_balances.inspect}, metadata: #{@metadata.inspect}>"
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# modern_treasury
|
|
2
|
+
#
|
|
3
|
+
# This file was automatically generated by APIMATIC v3.0 (
|
|
4
|
+
# https://www.apimatic.io ).
|
|
5
|
+
|
|
6
|
+
module ModernTreasury
|
|
7
|
+
# LedgerEntryCreateRequest Model.
|
|
8
|
+
class LedgerEntryCreateRequest < BaseModel
|
|
9
|
+
SKIP = Object.new
|
|
10
|
+
private_constant :SKIP
|
|
11
|
+
|
|
12
|
+
# Value in specified currency's smallest unit. e.g. $10 would be represented
|
|
13
|
+
# as 1000. Can be any integer up to 36 digits.
|
|
14
|
+
# @return [Integer]
|
|
15
|
+
attr_accessor :amount
|
|
16
|
+
|
|
17
|
+
# One of `credit`, `debit`. Describes the direction money is flowing in the
|
|
18
|
+
# transaction. A `credit` moves money from your account to someone else's. A
|
|
19
|
+
# `debit` pulls money from someone else's account to your own. Note that
|
|
20
|
+
# wire, rtp, and check payments will always be `credit`.
|
|
21
|
+
# @return [Direction5Enum]
|
|
22
|
+
attr_accessor :direction
|
|
23
|
+
|
|
24
|
+
# The ledger account that this ledger entry is associated with.
|
|
25
|
+
# @return [UUID | String]
|
|
26
|
+
attr_accessor :ledger_account_id
|
|
27
|
+
|
|
28
|
+
# Lock version of the ledger account. This can be passed when creating a
|
|
29
|
+
# ledger transaction to only succeed if no ledger transactions have posted
|
|
30
|
+
# since the given version. See our post about Designing the Ledgers API with
|
|
31
|
+
# Optimistic Locking for more details.
|
|
32
|
+
# @return [Integer]
|
|
33
|
+
attr_accessor :lock_version
|
|
34
|
+
|
|
35
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
36
|
+
# account’s pending balance. If any of these conditions would be false after
|
|
37
|
+
# the transaction is created, the entire call will fail with error code 422.
|
|
38
|
+
# @return [Hash[String, Integer]]
|
|
39
|
+
attr_accessor :pending_balance_amount
|
|
40
|
+
|
|
41
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
42
|
+
# account’s posted balance. If any of these conditions would be false after
|
|
43
|
+
# the transaction is created, the entire call will fail with error code 422.
|
|
44
|
+
# @return [Hash[String, Integer]]
|
|
45
|
+
attr_accessor :posted_balance_amount
|
|
46
|
+
|
|
47
|
+
# Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
|
|
48
|
+
# account’s available balance. If any of these conditions would be false
|
|
49
|
+
# after the transaction is created, the entire call will fail with error
|
|
50
|
+
# code 422.
|
|
51
|
+
# @return [Hash[String, Integer]]
|
|
52
|
+
attr_accessor :available_balance_amount
|
|
53
|
+
|
|
54
|
+
# If true, response will include the balance of the associated ledger
|
|
55
|
+
# account for the entry.
|
|
56
|
+
# @return [TrueClass | FalseClass]
|
|
57
|
+
attr_accessor :show_resulting_ledger_account_balances
|
|
58
|
+
|
|
59
|
+
# Additional data represented as key-value pairs. Both the key and value
|
|
60
|
+
# must be strings.
|
|
61
|
+
# @return [Hash[String, String]]
|
|
62
|
+
attr_accessor :metadata
|
|
63
|
+
|
|
64
|
+
# A mapping from model property names to API property names.
|
|
65
|
+
def self.names
|
|
66
|
+
@_hash = {} if @_hash.nil?
|
|
67
|
+
@_hash['amount'] = 'amount'
|
|
68
|
+
@_hash['direction'] = 'direction'
|
|
69
|
+
@_hash['ledger_account_id'] = 'ledger_account_id'
|
|
70
|
+
@_hash['lock_version'] = 'lock_version'
|
|
71
|
+
@_hash['pending_balance_amount'] = 'pending_balance_amount'
|
|
72
|
+
@_hash['posted_balance_amount'] = 'posted_balance_amount'
|
|
73
|
+
@_hash['available_balance_amount'] = 'available_balance_amount'
|
|
74
|
+
@_hash['show_resulting_ledger_account_balances'] =
|
|
75
|
+
'show_resulting_ledger_account_balances'
|
|
76
|
+
@_hash['metadata'] = 'metadata'
|
|
77
|
+
@_hash
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# An array for optional fields
|
|
81
|
+
def self.optionals
|
|
82
|
+
%w[
|
|
83
|
+
lock_version
|
|
84
|
+
pending_balance_amount
|
|
85
|
+
posted_balance_amount
|
|
86
|
+
available_balance_amount
|
|
87
|
+
show_resulting_ledger_account_balances
|
|
88
|
+
metadata
|
|
89
|
+
]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# An array for nullable fields
|
|
93
|
+
def self.nullables
|
|
94
|
+
%w[
|
|
95
|
+
lock_version
|
|
96
|
+
pending_balance_amount
|
|
97
|
+
posted_balance_amount
|
|
98
|
+
available_balance_amount
|
|
99
|
+
show_resulting_ledger_account_balances
|
|
100
|
+
]
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def initialize(amount = nil, direction = nil, ledger_account_id = nil,
|
|
104
|
+
lock_version = SKIP, pending_balance_amount = SKIP,
|
|
105
|
+
posted_balance_amount = SKIP,
|
|
106
|
+
available_balance_amount = SKIP,
|
|
107
|
+
show_resulting_ledger_account_balances = SKIP,
|
|
108
|
+
metadata = SKIP)
|
|
109
|
+
@amount = amount
|
|
110
|
+
@direction = direction
|
|
111
|
+
@ledger_account_id = ledger_account_id
|
|
112
|
+
@lock_version = lock_version unless lock_version == SKIP
|
|
113
|
+
@pending_balance_amount = pending_balance_amount unless pending_balance_amount == SKIP
|
|
114
|
+
@posted_balance_amount = posted_balance_amount unless posted_balance_amount == SKIP
|
|
115
|
+
@available_balance_amount = available_balance_amount unless available_balance_amount == SKIP
|
|
116
|
+
unless show_resulting_ledger_account_balances == SKIP
|
|
117
|
+
@show_resulting_ledger_account_balances =
|
|
118
|
+
show_resulting_ledger_account_balances
|
|
119
|
+
end
|
|
120
|
+
@metadata = metadata unless metadata == SKIP
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Creates an instance of the object from a hash.
|
|
124
|
+
def self.from_hash(hash)
|
|
125
|
+
return nil unless hash
|
|
126
|
+
|
|
127
|
+
# Extract variables from the hash.
|
|
128
|
+
amount = hash.key?('amount') ? hash['amount'] : nil
|
|
129
|
+
direction = hash.key?('direction') ? hash['direction'] : nil
|
|
130
|
+
ledger_account_id =
|
|
131
|
+
hash.key?('ledger_account_id') ? hash['ledger_account_id'] : nil
|
|
132
|
+
lock_version = hash.key?('lock_version') ? hash['lock_version'] : SKIP
|
|
133
|
+
pending_balance_amount =
|
|
134
|
+
hash.key?('pending_balance_amount') ? hash['pending_balance_amount'] : SKIP
|
|
135
|
+
posted_balance_amount =
|
|
136
|
+
hash.key?('posted_balance_amount') ? hash['posted_balance_amount'] : SKIP
|
|
137
|
+
available_balance_amount =
|
|
138
|
+
hash.key?('available_balance_amount') ? hash['available_balance_amount'] : SKIP
|
|
139
|
+
show_resulting_ledger_account_balances =
|
|
140
|
+
hash.key?('show_resulting_ledger_account_balances') ? hash['show_resulting_ledger_account_balances'] : SKIP
|
|
141
|
+
metadata = hash.key?('metadata') ? hash['metadata'] : SKIP
|
|
142
|
+
|
|
143
|
+
# Create object from extracted values.
|
|
144
|
+
LedgerEntryCreateRequest.new(amount,
|
|
145
|
+
direction,
|
|
146
|
+
ledger_account_id,
|
|
147
|
+
lock_version,
|
|
148
|
+
pending_balance_amount,
|
|
149
|
+
posted_balance_amount,
|
|
150
|
+
available_balance_amount,
|
|
151
|
+
show_resulting_ledger_account_balances,
|
|
152
|
+
metadata)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Provides a human-readable string representation of the object.
|
|
156
|
+
def to_s
|
|
157
|
+
class_name = self.class.name.split('::').last
|
|
158
|
+
"<#{class_name} amount: #{@amount}, direction: #{@direction}, ledger_account_id:"\
|
|
159
|
+
" #{@ledger_account_id}, lock_version: #{@lock_version}, pending_balance_amount:"\
|
|
160
|
+
" #{@pending_balance_amount}, posted_balance_amount: #{@posted_balance_amount},"\
|
|
161
|
+
" available_balance_amount: #{@available_balance_amount},"\
|
|
162
|
+
" show_resulting_ledger_account_balances: #{@show_resulting_ledger_account_balances},"\
|
|
163
|
+
" metadata: #{@metadata}>"
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Provides a debugging-friendly string with detailed object information.
|
|
167
|
+
def inspect
|
|
168
|
+
class_name = self.class.name.split('::').last
|
|
169
|
+
"<#{class_name} amount: #{@amount.inspect}, direction: #{@direction.inspect},"\
|
|
170
|
+
" ledger_account_id: #{@ledger_account_id.inspect}, lock_version: #{@lock_version.inspect},"\
|
|
171
|
+
" pending_balance_amount: #{@pending_balance_amount.inspect}, posted_balance_amount:"\
|
|
172
|
+
" #{@posted_balance_amount.inspect}, available_balance_amount:"\
|
|
173
|
+
" #{@available_balance_amount.inspect}, show_resulting_ledger_account_balances:"\
|
|
174
|
+
" #{@show_resulting_ledger_account_balances.inspect}, metadata: #{@metadata.inspect}>"
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
end
|