From 27fc6bfbfd34d54888563cc2351118ffab64fa33 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Mon, 18 Sep 2023 21:53:48 -0400 Subject: [PATCH] feat(api): updates (#209) --- .stats.yml | 2 +- api.md | 24 +- src/modern_treasury/_client.py | 4 + src/modern_treasury/resources/__init__.py | 6 + .../resources/account_collection_flows.py | 46 ++ .../resources/counterparties.py | 2 + .../resources/expected_payments.py | 12 +- .../resources/external_accounts.py | 8 + .../internal_accounts/internal_accounts.py | 8 + .../resources/invoices/invoices.py | 174 +++++- .../ledger_account_balance_monitors.py | 499 ++++++++++++++++++ .../resources/ledger_account_payouts.py | 81 ++- .../resources/ledger_accounts.py | 30 ++ .../resources/payment_flows.py | 15 +- .../payment_orders/payment_orders.py | 38 +- .../resources/payment_references.py | 75 ++- .../resources/routing_details.py | 12 + .../resources/transactions/line_items.py | 78 ++- src/modern_treasury/resources/validations.py | 16 +- src/modern_treasury/types/__init__.py | 12 + .../types/account_collection_flow.py | 24 + .../account_collection_flow_create_params.py | 24 +- .../counterparty_collect_account_params.py | 1 + .../types/counterparty_create_params.py | 6 + src/modern_treasury/types/expected_payment.py | 2 +- .../types/expected_payment_list_params.py | 6 +- .../types/expected_payment_type.py | 4 + .../types/external_account_create_params.py | 6 + .../types/external_account_verify_params.py | 4 + .../types/incoming_payment_detail.py | 2 + .../types/internal_account_list_params.py | 4 + src/modern_treasury/types/invoice.py | 15 + .../types/invoice_create_params.py | 24 +- .../types/invoice_update_params.py | 24 +- .../types/ledger_account_balance_monitor.py | 148 ++++++ ...r_account_balance_monitor_create_params.py | 47 ++ ...ger_account_balance_monitor_list_params.py | 30 ++ ...r_account_balance_monitor_update_params.py | 19 + .../types/ledger_account_list_params.py | 68 ++- src/modern_treasury/types/payment_flow.py | 21 +- .../types/payment_flow_create_params.py | 14 +- src/modern_treasury/types/payment_order.py | 5 +- .../payment_order_create_async_params.py | 11 +- .../types/payment_order_create_params.py | 11 +- .../types/payment_order_list_params.py | 4 + .../types/payment_order_type.py | 4 + .../types/payment_order_update_params.py | 11 +- src/modern_treasury/types/routing_detail.py | 17 +- .../types/routing_detail_create_params.py | 6 + .../types/routing_number_lookup_request.py | 14 +- src/modern_treasury/types/transaction.py | 4 + .../transactions/line_item_list_params.py | 6 +- .../transactions/transaction_line_item.py | 7 +- ...lidation_validate_routing_number_params.py | 8 +- .../types/virtual_account_create_params.py | 6 + .../test_account_collection_flows.py | 18 + tests/api_resources/test_invoices.py | 28 + .../test_ledger_account_balance_monitors.py | 195 +++++++ .../test_ledger_account_payouts.py | 28 +- tests/api_resources/test_ledger_accounts.py | 48 ++ tests/api_resources/test_payment_flows.py | 25 + .../api_resources/test_payment_references.py | 28 +- .../transactions/test_line_items.py | 28 +- 63 files changed, 2036 insertions(+), 111 deletions(-) create mode 100644 src/modern_treasury/resources/ledger_account_balance_monitors.py create mode 100644 src/modern_treasury/types/ledger_account_balance_monitor.py create mode 100644 src/modern_treasury/types/ledger_account_balance_monitor_create_params.py create mode 100644 src/modern_treasury/types/ledger_account_balance_monitor_list_params.py create mode 100644 src/modern_treasury/types/ledger_account_balance_monitor_update_params.py create mode 100644 tests/api_resources/test_ledger_account_balance_monitors.py diff --git a/.stats.yml b/.stats.yml index 71c320fc..50996d49 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 127 +configured_endpoints: 134 diff --git a/api.md b/api.md index 7db5fd80..e72d1a8d 100644 --- a/api.md +++ b/api.md @@ -121,6 +121,7 @@ Methods: - client.invoices.retrieve(id) -> Invoice - client.invoices.update(id, \*\*params) -> Invoice - client.invoices.list(\*\*params) -> SyncPage[Invoice] +- client.invoices.add_payment_order(id, payment_order_id) -> None ## LineItems @@ -290,6 +291,22 @@ Methods: - client.ledger_accounts.list(\*\*params) -> SyncPage[LedgerAccount] - client.ledger_accounts.delete(id) -> LedgerAccount +# LedgerAccountBalanceMonitors + +Types: + +```python +from modern_treasury.types import LedgerAccountBalanceMonitor +``` + +Methods: + +- client.ledger_account_balance_monitors.create(\*\*params) -> LedgerAccountBalanceMonitor +- client.ledger_account_balance_monitors.retrieve(id) -> LedgerAccountBalanceMonitor +- client.ledger_account_balance_monitors.update(id, \*\*params) -> LedgerAccountBalanceMonitor +- client.ledger_account_balance_monitors.list(\*\*params) -> SyncPage[LedgerAccountBalanceMonitor] +- client.ledger_account_balance_monitors.delete(id) -> LedgerAccountBalanceMonitor + # LedgerAccountPayouts Types: @@ -301,9 +318,9 @@ from modern_treasury.types import LedgerAccountPayout Methods: - client.ledger_account_payouts.create(\*\*params) -> LedgerAccountPayout +- client.ledger_account_payouts.retrieve(id) -> LedgerAccountPayout - client.ledger_account_payouts.update(id, \*\*params) -> LedgerAccountPayout - client.ledger_account_payouts.list(\*\*params) -> SyncPage[LedgerAccountPayout] -- client.ledger_account_payouts.retireve(id) -> LedgerAccountPayout # LedgerAccountStatements @@ -451,8 +468,8 @@ from modern_treasury.types import PaymentReference Methods: +- client.payment_references.retrieve(id) -> PaymentReference - client.payment_references.list(\*\*params) -> SyncPage[PaymentReference] -- client.payment_references.retireve(id) -> PaymentReference # Returns @@ -492,7 +509,8 @@ from modern_treasury.types.transactions import TransactionLineItem Methods: -- client.transactions.line_items.list(transaction_id, \*\*params) -> SyncPage[TransactionLineItem] +- client.transactions.line_items.retrieve(id) -> TransactionLineItem +- client.transactions.line_items.list(\*\*params) -> SyncPage[TransactionLineItem] # Validations diff --git a/src/modern_treasury/_client.py b/src/modern_treasury/_client.py index 869e8a33..eabc3be6 100644 --- a/src/modern_treasury/_client.py +++ b/src/modern_treasury/_client.py @@ -65,6 +65,7 @@ class ModernTreasury(SyncAPIClient): ledgerable_events: resources.LedgerableEvents ledger_account_categories: resources.LedgerAccountCategories ledger_accounts: resources.LedgerAccounts + ledger_account_balance_monitors: resources.LedgerAccountBalanceMonitors ledger_account_payouts: resources.LedgerAccountPayouts ledger_account_statements: resources.LedgerAccountStatements ledger_entries: resources.LedgerEntries @@ -172,6 +173,7 @@ def __init__( self.ledgerable_events = resources.LedgerableEvents(self) self.ledger_account_categories = resources.LedgerAccountCategories(self) self.ledger_accounts = resources.LedgerAccounts(self) + self.ledger_account_balance_monitors = resources.LedgerAccountBalanceMonitors(self) self.ledger_account_payouts = resources.LedgerAccountPayouts(self) self.ledger_account_statements = resources.LedgerAccountStatements(self) self.ledger_entries = resources.LedgerEntries(self) @@ -299,6 +301,7 @@ class AsyncModernTreasury(AsyncAPIClient): ledgerable_events: resources.AsyncLedgerableEvents ledger_account_categories: resources.AsyncLedgerAccountCategories ledger_accounts: resources.AsyncLedgerAccounts + ledger_account_balance_monitors: resources.AsyncLedgerAccountBalanceMonitors ledger_account_payouts: resources.AsyncLedgerAccountPayouts ledger_account_statements: resources.AsyncLedgerAccountStatements ledger_entries: resources.AsyncLedgerEntries @@ -406,6 +409,7 @@ def __init__( self.ledgerable_events = resources.AsyncLedgerableEvents(self) self.ledger_account_categories = resources.AsyncLedgerAccountCategories(self) self.ledger_accounts = resources.AsyncLedgerAccounts(self) + self.ledger_account_balance_monitors = resources.AsyncLedgerAccountBalanceMonitors(self) self.ledger_account_payouts = resources.AsyncLedgerAccountPayouts(self) self.ledger_account_statements = resources.AsyncLedgerAccountStatements(self) self.ledger_entries = resources.AsyncLedgerEntries(self) diff --git a/src/modern_treasury/resources/__init__.py b/src/modern_treasury/resources/__init__.py index 19ae865e..9cc97e50 100644 --- a/src/modern_treasury/resources/__init__.py +++ b/src/modern_treasury/resources/__init__.py @@ -43,6 +43,10 @@ LedgerAccountStatements, AsyncLedgerAccountStatements, ) +from .ledger_account_balance_monitors import ( + LedgerAccountBalanceMonitors, + AsyncLedgerAccountBalanceMonitors, +) __all__ = [ "Connections", @@ -77,6 +81,8 @@ "AsyncLedgerAccountCategories", "LedgerAccounts", "AsyncLedgerAccounts", + "LedgerAccountBalanceMonitors", + "AsyncLedgerAccountBalanceMonitors", "LedgerAccountPayouts", "AsyncLedgerAccountPayouts", "LedgerAccountStatements", diff --git a/src/modern_treasury/resources/account_collection_flows.py b/src/modern_treasury/resources/account_collection_flows.py index 7fc1e5d3..972fcd64 100644 --- a/src/modern_treasury/resources/account_collection_flows.py +++ b/src/modern_treasury/resources/account_collection_flows.py @@ -26,6 +26,28 @@ def create( *, counterparty_id: str, payment_types: List[str], + receiving_countries: List[ + Literal[ + "USA", + "AUS", + "BEL", + "CAN", + "CHL", + "CHN", + "COL", + "FRA", + "DEU", + "HKG", + "IND", + "IRL", + "ITA", + "MEX", + "NLD", + "PER", + "ESP", + ] + ] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -56,6 +78,7 @@ def create( { "counterparty_id": counterparty_id, "payment_types": payment_types, + "receiving_countries": receiving_countries, }, account_collection_flow_create_params.AccountCollectionFlowCreateParams, ), @@ -204,6 +227,28 @@ async def create( *, counterparty_id: str, payment_types: List[str], + receiving_countries: List[ + Literal[ + "USA", + "AUS", + "BEL", + "CAN", + "CHL", + "CHN", + "COL", + "FRA", + "DEU", + "HKG", + "IND", + "IRL", + "ITA", + "MEX", + "NLD", + "PER", + "ESP", + ] + ] + | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -234,6 +279,7 @@ async def create( { "counterparty_id": counterparty_id, "payment_types": payment_types, + "receiving_countries": receiving_countries, }, account_collection_flow_create_params.AccountCollectionFlowCreateParams, ), diff --git a/src/modern_treasury/resources/counterparties.py b/src/modern_treasury/resources/counterparties.py index af0b485a..7ce17cf7 100644 --- a/src/modern_treasury/resources/counterparties.py +++ b/src/modern_treasury/resources/counterparties.py @@ -334,6 +334,7 @@ def collect_account( "brCodigo", "routingNumberType", "address", + "jp_zengin_code", ] ] | NotGiven = NOT_GIVEN, @@ -712,6 +713,7 @@ async def collect_account( "brCodigo", "routingNumberType", "address", + "jp_zengin_code", ] ] | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/expected_payments.py b/src/modern_treasury/resources/expected_payments.py index 29171926..8da474a8 100644 --- a/src/modern_treasury/resources/expected_payments.py +++ b/src/modern_treasury/resources/expected_payments.py @@ -293,7 +293,7 @@ def list( internal_account_id: str | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, - status: Literal["archived", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN, + status: Literal["archived", "partially_reconciled", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN, type: Literal[ "ach", "au_becs", @@ -306,12 +306,16 @@ def list( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -688,7 +692,7 @@ def list( internal_account_id: str | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, - status: Literal["archived", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN, + status: Literal["archived", "partially_reconciled", "reconciled", "unreconciled"] | NotGiven = NOT_GIVEN, type: Literal[ "ach", "au_becs", @@ -701,12 +705,16 @@ def list( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/modern_treasury/resources/external_accounts.py b/src/modern_treasury/resources/external_accounts.py index d4f8f2e2..6cd27356 100644 --- a/src/modern_treasury/resources/external_accounts.py +++ b/src/modern_treasury/resources/external_accounts.py @@ -370,12 +370,16 @@ def verify( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ], currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -774,12 +778,16 @@ async def verify( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ], currency: Optional[shared_params.Currency] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/modern_treasury/resources/internal_accounts/internal_accounts.py b/src/modern_treasury/resources/internal_accounts/internal_accounts.py index 15316512..ac625761 100644 --- a/src/modern_treasury/resources/internal_accounts/internal_accounts.py +++ b/src/modern_treasury/resources/internal_accounts/internal_accounts.py @@ -219,12 +219,16 @@ def list( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, @@ -478,12 +482,16 @@ def list( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/invoices/invoices.py b/src/modern_treasury/resources/invoices/invoices.py index 0094e304..e68f3132 100644 --- a/src/modern_treasury/resources/invoices/invoices.py +++ b/src/modern_treasury/resources/invoices/invoices.py @@ -13,7 +13,7 @@ invoice_create_params, invoice_update_params, ) -from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven from ..._utils import maybe_transform from .line_items import LineItems, AsyncLineItems from ..._resource import SyncAPIResource, AsyncAPIResource @@ -53,6 +53,7 @@ def create( payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -62,15 +63,21 @@ def create( "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, + recipient_email: Optional[str] | NotGiven = NOT_GIVEN, + recipient_name: Optional[str] | NotGiven = NOT_GIVEN, + virtual_account_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -119,11 +126,20 @@ def create( invoice amount is negative, the automatically initiated payment order's direction will be credit. One of `manual`, `ui`, or `automatic`. - payment_type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. + recipient_email: The email of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + + recipient_name: The name of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + + virtual_account_id: The ID of the virtual account the invoice should be paid to. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -153,6 +169,9 @@ def create( "payment_method": payment_method, "payment_type": payment_type, "receiving_account_id": receiving_account_id, + "recipient_email": recipient_email, + "recipient_name": recipient_name, + "virtual_account_id": virtual_account_id, }, invoice_create_params.InvoiceCreateParams, ), @@ -218,6 +237,7 @@ def update( payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -227,16 +247,22 @@ def update( "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, + recipient_email: Optional[str] | NotGiven = NOT_GIVEN, + recipient_name: Optional[str] | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, + virtual_account_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -285,15 +311,24 @@ def update( invoice amount is negative, the automatically initiated payment order's direction will be credit. One of `manual`, `ui`, or `automatic`. - payment_type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. + recipient_email: The email of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + + recipient_name: The name of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + status: Invoice status must be updated in a `PATCH` request that does not modify any other invoice attributes. Valid state transitions are `draft` to `unpaid`, `draft` or `unpaid` to `voided`, and `draft` or `unpaid` to `paid`. + virtual_account_id: The ID of the virtual account the invoice should be paid to. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -323,7 +358,10 @@ def update( "payment_method": payment_method, "payment_type": payment_type, "receiving_account_id": receiving_account_id, + "recipient_email": recipient_email, + "recipient_name": recipient_name, "status": status, + "virtual_account_id": virtual_account_id, }, invoice_update_params.InvoiceUpdateParams, ), @@ -380,6 +418,46 @@ def list( model=Invoice, ) + def add_payment_order( + self, + payment_order_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> None: + """ + Add a payment order to an invoice. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return self._put( + f"/api/invoices/{id}/payment_orders/{payment_order_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NoneType, + ) + class AsyncInvoices(AsyncAPIResource): line_items: AsyncLineItems @@ -408,6 +486,7 @@ async def create( payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -417,15 +496,21 @@ async def create( "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, + recipient_email: Optional[str] | NotGiven = NOT_GIVEN, + recipient_name: Optional[str] | NotGiven = NOT_GIVEN, + virtual_account_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -474,11 +559,20 @@ async def create( invoice amount is negative, the automatically initiated payment order's direction will be credit. One of `manual`, `ui`, or `automatic`. - payment_type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. + recipient_email: The email of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + + recipient_name: The name of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + + virtual_account_id: The ID of the virtual account the invoice should be paid to. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -508,6 +602,9 @@ async def create( "payment_method": payment_method, "payment_type": payment_type, "receiving_account_id": receiving_account_id, + "recipient_email": recipient_email, + "recipient_name": recipient_name, + "virtual_account_id": virtual_account_id, }, invoice_create_params.InvoiceCreateParams, ), @@ -573,6 +670,7 @@ async def update( payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -582,16 +680,22 @@ async def update( "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, + recipient_email: Optional[str] | NotGiven = NOT_GIVEN, + recipient_name: Optional[str] | NotGiven = NOT_GIVEN, status: str | NotGiven = NOT_GIVEN, + virtual_account_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -640,15 +744,24 @@ async def update( invoice amount is negative, the automatically initiated payment order's direction will be credit. One of `manual`, `ui`, or `automatic`. - payment_type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. + recipient_email: The email of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + + recipient_name: The name of the recipient of the invoice. Leaving this value as null will + fallback to using the counterparty's name. + status: Invoice status must be updated in a `PATCH` request that does not modify any other invoice attributes. Valid state transitions are `draft` to `unpaid`, `draft` or `unpaid` to `voided`, and `draft` or `unpaid` to `paid`. + virtual_account_id: The ID of the virtual account the invoice should be paid to. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -678,7 +791,10 @@ async def update( "payment_method": payment_method, "payment_type": payment_type, "receiving_account_id": receiving_account_id, + "recipient_email": recipient_email, + "recipient_name": recipient_name, "status": status, + "virtual_account_id": virtual_account_id, }, invoice_update_params.InvoiceUpdateParams, ), @@ -734,3 +850,43 @@ def list( ), model=Invoice, ) + + async def add_payment_order( + self, + payment_order_id: str, + *, + id: str, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> None: + """ + Add a payment order to an invoice. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + return await self._put( + f"/api/invoices/{id}/payment_orders/{payment_order_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=NoneType, + ) diff --git a/src/modern_treasury/resources/ledger_account_balance_monitors.py b/src/modern_treasury/resources/ledger_account_balance_monitors.py new file mode 100644 index 00000000..e3745b90 --- /dev/null +++ b/src/modern_treasury/resources/ledger_account_balance_monitors.py @@ -0,0 +1,499 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict, List, Optional + +from ..types import ( + LedgerAccountBalanceMonitor, + ledger_account_balance_monitor_list_params, + ledger_account_balance_monitor_create_params, + ledger_account_balance_monitor_update_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform +from .._resource import SyncAPIResource, AsyncAPIResource +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options + +__all__ = ["LedgerAccountBalanceMonitors", "AsyncLedgerAccountBalanceMonitors"] + + +class LedgerAccountBalanceMonitors(SyncAPIResource): + def create( + self, + *, + alert_condition: ledger_account_balance_monitor_create_params.AlertCondition, + ledger_account_id: str, + description: str | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountBalanceMonitor: + """ + Create a ledger account balance monitor. + + Args: + alert_condition: Describes the condition that must be satisfied for the monitor to be triggered. + + ledger_account_id: The ledger account associated with this balance monitor. + + description: An optional, free-form description for internal use. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._post( + "/api/ledger_account_balance_monitors", + body=maybe_transform( + { + "alert_condition": alert_condition, + "ledger_account_id": ledger_account_id, + "description": description, + "metadata": metadata, + }, + ledger_account_balance_monitor_create_params.LedgerAccountBalanceMonitorCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountBalanceMonitor, + ) + + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> LedgerAccountBalanceMonitor: + """ + Get details on a single ledger account balance monitor. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + f"/api/ledger_account_balance_monitors/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LedgerAccountBalanceMonitor, + ) + + def update( + self, + id: str, + *, + description: str | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountBalanceMonitor: + """ + Update a ledger account balance monitor. + + Args: + description: An optional, free-form description for internal use. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._patch( + f"/api/ledger_account_balance_monitors/{id}", + body=maybe_transform( + { + "description": description, + "metadata": metadata, + }, + ledger_account_balance_monitor_update_params.LedgerAccountBalanceMonitorUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountBalanceMonitor, + ) + + def list( + self, + *, + id: List[str] | NotGiven = NOT_GIVEN, + after_cursor: Optional[str] | NotGiven = NOT_GIVEN, + ledger_account_id: str | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> SyncPage[LedgerAccountBalanceMonitor]: + """ + Get a list of ledger account balance monitors. + + Args: + id: If you have specific IDs to retrieve in bulk, you can pass them as query + parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`. + + ledger_account_id: Query the balance monitors for a single ledger account. + + metadata: For example, if you want to query for records with metadata key `Type` and value + `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query + parameters. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/api/ledger_account_balance_monitors", + page=SyncPage[LedgerAccountBalanceMonitor], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "after_cursor": after_cursor, + "ledger_account_id": ledger_account_id, + "metadata": metadata, + "per_page": per_page, + }, + ledger_account_balance_monitor_list_params.LedgerAccountBalanceMonitorListParams, + ), + ), + model=LedgerAccountBalanceMonitor, + ) + + def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountBalanceMonitor: + """ + Delete a ledger account balance monitor. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return self._delete( + f"/api/ledger_account_balance_monitors/{id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountBalanceMonitor, + ) + + +class AsyncLedgerAccountBalanceMonitors(AsyncAPIResource): + async def create( + self, + *, + alert_condition: ledger_account_balance_monitor_create_params.AlertCondition, + ledger_account_id: str, + description: str | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountBalanceMonitor: + """ + Create a ledger account balance monitor. + + Args: + alert_condition: Describes the condition that must be satisfied for the monitor to be triggered. + + ledger_account_id: The ledger account associated with this balance monitor. + + description: An optional, free-form description for internal use. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._post( + "/api/ledger_account_balance_monitors", + body=maybe_transform( + { + "alert_condition": alert_condition, + "ledger_account_id": ledger_account_id, + "description": description, + "metadata": metadata, + }, + ledger_account_balance_monitor_create_params.LedgerAccountBalanceMonitorCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountBalanceMonitor, + ) + + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> LedgerAccountBalanceMonitor: + """ + Get details on a single ledger account balance monitor. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + f"/api/ledger_account_balance_monitors/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LedgerAccountBalanceMonitor, + ) + + async def update( + self, + id: str, + *, + description: str | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountBalanceMonitor: + """ + Update a ledger account balance monitor. + + Args: + description: An optional, free-form description for internal use. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._patch( + f"/api/ledger_account_balance_monitors/{id}", + body=maybe_transform( + { + "description": description, + "metadata": metadata, + }, + ledger_account_balance_monitor_update_params.LedgerAccountBalanceMonitorUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountBalanceMonitor, + ) + + def list( + self, + *, + id: List[str] | NotGiven = NOT_GIVEN, + after_cursor: Optional[str] | NotGiven = NOT_GIVEN, + ledger_account_id: str | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[LedgerAccountBalanceMonitor, AsyncPage[LedgerAccountBalanceMonitor]]: + """ + Get a list of ledger account balance monitors. + + Args: + id: If you have specific IDs to retrieve in bulk, you can pass them as query + parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`. + + ledger_account_id: Query the balance monitors for a single ledger account. + + metadata: For example, if you want to query for records with metadata key `Type` and value + `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query + parameters. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get_api_list( + "/api/ledger_account_balance_monitors", + page=AsyncPage[LedgerAccountBalanceMonitor], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "id": id, + "after_cursor": after_cursor, + "ledger_account_id": ledger_account_id, + "metadata": metadata, + "per_page": per_page, + }, + ledger_account_balance_monitor_list_params.LedgerAccountBalanceMonitorListParams, + ), + ), + model=LedgerAccountBalanceMonitor, + ) + + async def delete( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountBalanceMonitor: + """ + Delete a ledger account balance monitor. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + return await self._delete( + f"/api/ledger_account_balance_monitors/{id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountBalanceMonitor, + ) diff --git a/src/modern_treasury/resources/ledger_account_payouts.py b/src/modern_treasury/resources/ledger_account_payouts.py index d842154f..d57fe8f7 100644 --- a/src/modern_treasury/resources/ledger_account_payouts.py +++ b/src/modern_treasury/resources/ledger_account_payouts.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Dict, List, Optional from typing_extensions import Literal @@ -98,6 +99,37 @@ def create( cast_to=LedgerAccountPayout, ) + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> LedgerAccountPayout: + """ + Get details on a single ledger account payout. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + f"/api/ledger_account_payouts/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LedgerAccountPayout, + ) + def update( self, id: str, @@ -211,6 +243,7 @@ def list( model=LedgerAccountPayout, ) + @typing_extensions.deprecated("use `retrieve` instead") def retireve( self, id: str, @@ -234,12 +267,8 @@ def retireve( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( - f"/api/ledger_account_payouts/{id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LedgerAccountPayout, + return self.retrieve( + id=id, extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ) @@ -321,6 +350,37 @@ async def create( cast_to=LedgerAccountPayout, ) + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> LedgerAccountPayout: + """ + Get details on a single ledger account payout. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + f"/api/ledger_account_payouts/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LedgerAccountPayout, + ) + async def update( self, id: str, @@ -434,6 +494,7 @@ def list( model=LedgerAccountPayout, ) + @typing_extensions.deprecated("use `retrieve` instead") async def retireve( self, id: str, @@ -457,10 +518,6 @@ async def retireve( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( - f"/api/ledger_account_payouts/{id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=LedgerAccountPayout, + return await self.retrieve( + id=id, extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ) diff --git a/src/modern_treasury/resources/ledger_accounts.py b/src/modern_treasury/resources/ledger_accounts.py index c2755449..fb0c44be 100644 --- a/src/modern_treasury/resources/ledger_accounts.py +++ b/src/modern_treasury/resources/ledger_accounts.py @@ -211,6 +211,7 @@ def list( *, id: List[str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, + available_balance_amount: ledger_account_list_params.AvailableBalanceAmount | NotGiven = NOT_GIVEN, balances: ledger_account_list_params.Balances | NotGiven = NOT_GIVEN, created_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, currency: str | NotGiven = NOT_GIVEN, @@ -218,7 +219,9 @@ def list( ledger_id: str | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + pending_balance_amount: ledger_account_list_params.PendingBalanceAmount | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, + posted_balance_amount: ledger_account_list_params.PostedBalanceAmount | NotGiven = NOT_GIVEN, updated_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -234,6 +237,9 @@ def list( id: If you have specific IDs to retrieve in bulk, you can pass them as query parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`. + available_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + balances: Use `balances[effective_at_lower_bound]` and `balances[effective_at_upper_bound]` to get the balances change between the two timestamps. The lower bound is inclusive while the upper bound is exclusive of @@ -248,6 +254,12 @@ def list( `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query parameters. + pending_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + + posted_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + updated_at: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the updated at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use updated_at%5Bgt%5D=2000-01-01T12:00:00Z. @@ -272,6 +284,7 @@ def list( { "id": id, "after_cursor": after_cursor, + "available_balance_amount": available_balance_amount, "balances": balances, "created_at": created_at, "currency": currency, @@ -279,7 +292,9 @@ def list( "ledger_id": ledger_id, "metadata": metadata, "name": name, + "pending_balance_amount": pending_balance_amount, "per_page": per_page, + "posted_balance_amount": posted_balance_amount, "updated_at": updated_at, }, ledger_account_list_params.LedgerAccountListParams, @@ -516,6 +531,7 @@ def list( *, id: List[str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, + available_balance_amount: ledger_account_list_params.AvailableBalanceAmount | NotGiven = NOT_GIVEN, balances: ledger_account_list_params.Balances | NotGiven = NOT_GIVEN, created_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, currency: str | NotGiven = NOT_GIVEN, @@ -523,7 +539,9 @@ def list( ledger_id: str | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, + pending_balance_amount: ledger_account_list_params.PendingBalanceAmount | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, + posted_balance_amount: ledger_account_list_params.PostedBalanceAmount | NotGiven = NOT_GIVEN, updated_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -539,6 +557,9 @@ def list( id: If you have specific IDs to retrieve in bulk, you can pass them as query parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`. + available_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + balances: Use `balances[effective_at_lower_bound]` and `balances[effective_at_upper_bound]` to get the balances change between the two timestamps. The lower bound is inclusive while the upper bound is exclusive of @@ -553,6 +574,12 @@ def list( `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query parameters. + pending_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + + posted_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + updated_at: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the updated at timestamp. For example, for all times after Jan 1 2000 12:00 UTC, use updated_at%5Bgt%5D=2000-01-01T12:00:00Z. @@ -577,6 +604,7 @@ def list( { "id": id, "after_cursor": after_cursor, + "available_balance_amount": available_balance_amount, "balances": balances, "created_at": created_at, "currency": currency, @@ -584,7 +612,9 @@ def list( "ledger_id": ledger_id, "metadata": metadata, "name": name, + "pending_balance_amount": pending_balance_amount, "per_page": per_page, + "posted_balance_amount": posted_balance_amount, "updated_at": updated_at, }, ledger_account_list_params.LedgerAccountListParams, diff --git a/src/modern_treasury/resources/payment_flows.py b/src/modern_treasury/resources/payment_flows.py index a60f9fb9..c60e9d3c 100644 --- a/src/modern_treasury/resources/payment_flows.py +++ b/src/modern_treasury/resources/payment_flows.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Optional +from typing import Union, Optional +from datetime import date from typing_extensions import Literal from ..types import ( @@ -29,6 +30,7 @@ def create( currency: str, direction: Literal["credit", "debit"], originating_account_id: str, + due_date: Union[str, date] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -55,6 +57,10 @@ def create( originating_account_id: Required. The ID of one of your organization's internal accounts. + due_date: Optional. Can only be passed in when `effective_date_selection_enabled` is + `true`. When set, the due date is shown to your end-user in the pre-built UI as + they are selecting a payment `effective_date`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -74,6 +80,7 @@ def create( "currency": currency, "direction": direction, "originating_account_id": originating_account_id, + "due_date": due_date, }, payment_flow_create_params.PaymentFlowCreateParams, ), @@ -227,6 +234,7 @@ async def create( currency: str, direction: Literal["credit", "debit"], originating_account_id: str, + due_date: Union[str, date] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -253,6 +261,10 @@ async def create( originating_account_id: Required. The ID of one of your organization's internal accounts. + due_date: Optional. Can only be passed in when `effective_date_selection_enabled` is + `true`. When set, the due date is shown to your end-user in the pre-built UI as + they are selecting a payment `effective_date`. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -272,6 +284,7 @@ async def create( "currency": currency, "direction": direction, "originating_account_id": originating_account_id, + "due_date": due_date, }, payment_flow_create_params.PaymentFlowCreateParams, ), diff --git a/src/modern_treasury/resources/payment_orders/payment_orders.py b/src/modern_treasury/resources/payment_orders/payment_orders.py index 18175ee5..8cfdd1f4 100644 --- a/src/modern_treasury/resources/payment_orders/payment_orders.py +++ b/src/modern_treasury/resources/payment_orders/payment_orders.py @@ -96,8 +96,9 @@ def create( originating_account_id: The ID of one of your organization's internal accounts. - type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. @@ -456,8 +457,9 @@ def update( payment orders, the `subtype` represents the SEC code. We currently support `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`. - type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. ultimate_originating_party_identifier: This represents the identifier by which the person is known to the receiver when using the CIE subtype for ACH payments. Only the first 22 characters of this @@ -575,12 +577,16 @@ def list( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -706,8 +712,9 @@ def create_async( originating_account_id: The ID of one of your organization's internal accounts. - type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. @@ -932,8 +939,9 @@ async def create( originating_account_id: The ID of one of your organization's internal accounts. - type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. @@ -1292,8 +1300,9 @@ async def update( payment orders, the `subtype` represents the SEC code. We currently support `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`. - type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. ultimate_originating_party_identifier: This represents the identifier by which the person is known to the receiver when using the CIE subtype for ACH payments. Only the first 22 characters of this @@ -1411,12 +1420,16 @@ def list( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1542,8 +1555,9 @@ async def create_async( originating_account_id: The ID of one of your organization's internal accounts. - type: One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. diff --git a/src/modern_treasury/resources/payment_references.py b/src/modern_treasury/resources/payment_references.py index f1ac7fd5..0ac762bf 100644 --- a/src/modern_treasury/resources/payment_references.py +++ b/src/modern_treasury/resources/payment_references.py @@ -2,6 +2,7 @@ from __future__ import annotations +import typing_extensions from typing import Optional from typing_extensions import Literal @@ -16,6 +17,37 @@ class PaymentReferences(SyncAPIResource): + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> PaymentReference: + """ + get payment_reference + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + f"/api/payment_references/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=PaymentReference, + ) + def list( self, *, @@ -73,6 +105,7 @@ def list( model=PaymentReference, ) + @typing_extensions.deprecated("use `retrieve` instead") def retireve( self, id: str, @@ -96,7 +129,36 @@ def retireve( timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( + return self.retrieve( + id=id, extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ) + + +class AsyncPaymentReferences(AsyncAPIResource): + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> PaymentReference: + """ + get payment_reference + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( f"/api/payment_references/{id}", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout @@ -104,8 +166,6 @@ def retireve( cast_to=PaymentReference, ) - -class AsyncPaymentReferences(AsyncAPIResource): def list( self, *, @@ -163,6 +223,7 @@ def list( model=PaymentReference, ) + @typing_extensions.deprecated("use `retrieve` instead") async def retireve( self, id: str, @@ -186,10 +247,6 @@ async def retireve( timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( - f"/api/payment_references/{id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=PaymentReference, + return await self.retrieve( + id=id, extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ) diff --git a/src/modern_treasury/resources/routing_details.py b/src/modern_treasury/resources/routing_details.py index 15057895..07c24697 100644 --- a/src/modern_treasury/resources/routing_details.py +++ b/src/modern_treasury/resources/routing_details.py @@ -36,7 +36,9 @@ def create( "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ], payment_type: Optional[ @@ -52,12 +54,16 @@ def create( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] | NotGiven = NOT_GIVEN, @@ -246,7 +252,9 @@ async def create( "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ], payment_type: Optional[ @@ -262,12 +270,16 @@ async def create( "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/transactions/line_items.py b/src/modern_treasury/resources/transactions/line_items.py index fc4afc89..52eaf167 100644 --- a/src/modern_treasury/resources/transactions/line_items.py +++ b/src/modern_treasury/resources/transactions/line_items.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Literal from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven @@ -16,12 +16,44 @@ class LineItems(SyncAPIResource): + def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> TransactionLineItem: + """ + get transaction line item + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return self._get( + f"/api/transaction_line_items/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TransactionLineItem, + ) + def list( self, - transaction_id: str, *, + id: Dict[str, str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, + transaction_id: str | NotGiven = NOT_GIVEN, type: Optional[Literal["originating", "receiving"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -43,7 +75,7 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( - f"/api/transactions/{transaction_id}/line_items", + "/api/transaction_line_items", page=SyncPage[TransactionLineItem], options=make_request_options( extra_headers=extra_headers, @@ -52,8 +84,10 @@ def list( timeout=timeout, query=maybe_transform( { + "id": id, "after_cursor": after_cursor, "per_page": per_page, + "transaction_id": transaction_id, "type": type, }, line_item_list_params.LineItemListParams, @@ -64,12 +98,44 @@ def list( class AsyncLineItems(AsyncAPIResource): + async def retrieve( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | None | NotGiven = NOT_GIVEN, + ) -> TransactionLineItem: + """ + get transaction line item + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + return await self._get( + f"/api/transaction_line_items/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=TransactionLineItem, + ) + def list( self, - transaction_id: str, *, + id: Dict[str, str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, + transaction_id: str | NotGiven = NOT_GIVEN, type: Optional[Literal["originating", "receiving"]] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -91,7 +157,7 @@ def list( timeout: Override the client-level default timeout for this request, in seconds """ return self._get_api_list( - f"/api/transactions/{transaction_id}/line_items", + "/api/transaction_line_items", page=AsyncPage[TransactionLineItem], options=make_request_options( extra_headers=extra_headers, @@ -100,8 +166,10 @@ def list( timeout=timeout, query=maybe_transform( { + "id": id, "after_cursor": after_cursor, "per_page": per_page, + "transaction_id": transaction_id, "type": type, }, line_item_list_params.LineItemListParams, diff --git a/src/modern_treasury/resources/validations.py b/src/modern_treasury/resources/validations.py index 4481f168..9bdd6435 100644 --- a/src/modern_treasury/resources/validations.py +++ b/src/modern_treasury/resources/validations.py @@ -30,7 +30,9 @@ def validate_routing_number( "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -48,9 +50,9 @@ def validate_routing_number( routing_number: The routing number that is being validated. routing_number_type: One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, or `swift`. In sandbox mode we currently only - support `aba` and `swift` with routing numbers '123456789' and 'GRINUST0XXX' - respectively. + `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox + mode we currently only support `aba` and `swift` with routing numbers + '123456789' and 'GRINUST0XXX' respectively. extra_headers: Send extra headers @@ -93,7 +95,9 @@ async def validate_routing_number( "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -111,9 +115,9 @@ async def validate_routing_number( routing_number: The routing number that is being validated. routing_number_type: One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, or `swift`. In sandbox mode we currently only - support `aba` and `swift` with routing numbers '123456789' and 'GRINUST0XXX' - respectively. + `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox + mode we currently only support `aba` and `swift` with routing numbers + '123456789' and 'GRINUST0XXX' respectively. extra_headers: Send extra headers diff --git a/src/modern_treasury/types/__init__.py b/src/modern_treasury/types/__init__.py index b1f89729..c0cb5047 100644 --- a/src/modern_treasury/types/__init__.py +++ b/src/modern_treasury/types/__init__.py @@ -147,6 +147,9 @@ from .internal_account_update_params import ( InternalAccountUpdateParams as InternalAccountUpdateParams, ) +from .ledger_account_balance_monitor import ( + LedgerAccountBalanceMonitor as LedgerAccountBalanceMonitor, +) from .ledger_account_retrieve_params import ( LedgerAccountRetrieveParams as LedgerAccountRetrieveParams, ) @@ -237,12 +240,21 @@ from .validation_validate_routing_number_params import ( ValidationValidateRoutingNumberParams as ValidationValidateRoutingNumberParams, ) +from .ledger_account_balance_monitor_list_params import ( + LedgerAccountBalanceMonitorListParams as LedgerAccountBalanceMonitorListParams, +) from .ledger_account_statement_retrieve_response import ( LedgerAccountStatementRetrieveResponse as LedgerAccountStatementRetrieveResponse, ) from .incoming_payment_detail_create_async_params import ( IncomingPaymentDetailCreateAsyncParams as IncomingPaymentDetailCreateAsyncParams, ) +from .ledger_account_balance_monitor_create_params import ( + LedgerAccountBalanceMonitorCreateParams as LedgerAccountBalanceMonitorCreateParams, +) +from .ledger_account_balance_monitor_update_params import ( + LedgerAccountBalanceMonitorUpdateParams as LedgerAccountBalanceMonitorUpdateParams, +) from .external_account_complete_verification_params import ( ExternalAccountCompleteVerificationParams as ExternalAccountCompleteVerificationParams, ) diff --git a/src/modern_treasury/types/account_collection_flow.py b/src/modern_treasury/types/account_collection_flow.py index ff7701fb..87ed9092 100644 --- a/src/modern_treasury/types/account_collection_flow.py +++ b/src/modern_treasury/types/account_collection_flow.py @@ -41,6 +41,30 @@ class AccountCollectionFlow(BaseModel): object: Optional[str] = None + receiving_countries: Optional[ + List[ + Literal[ + "USA", + "AUS", + "BEL", + "CAN", + "CHL", + "CHN", + "COL", + "FRA", + "DEU", + "HKG", + "IND", + "IRL", + "ITA", + "MEX", + "NLD", + "PER", + "ESP", + ] + ] + ] = None + status: Optional[Literal["cancelled", "completed", "expired", "pending"]] = None """The current status of the account collection flow. diff --git a/src/modern_treasury/types/account_collection_flow_create_params.py b/src/modern_treasury/types/account_collection_flow_create_params.py index b3a09cef..e4931c52 100644 --- a/src/modern_treasury/types/account_collection_flow_create_params.py +++ b/src/modern_treasury/types/account_collection_flow_create_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import List -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["AccountCollectionFlowCreateParams"] @@ -13,3 +13,25 @@ class AccountCollectionFlowCreateParams(TypedDict, total=False): """Required.""" payment_types: Required[List[str]] + + receiving_countries: List[ + Literal[ + "USA", + "AUS", + "BEL", + "CAN", + "CHL", + "CHN", + "COL", + "FRA", + "DEU", + "HKG", + "IND", + "IRL", + "ITA", + "MEX", + "NLD", + "PER", + "ESP", + ] + ] diff --git a/src/modern_treasury/types/counterparty_collect_account_params.py b/src/modern_treasury/types/counterparty_collect_account_params.py index 9d9826cb..f80e5fdd 100644 --- a/src/modern_treasury/types/counterparty_collect_account_params.py +++ b/src/modern_treasury/types/counterparty_collect_account_params.py @@ -47,6 +47,7 @@ class CounterpartyCollectAccountParams(TypedDict, total=False): "brCodigo", "routingNumberType", "address", + "jp_zengin_code", ] ] """The list of fields you want on the form. diff --git a/src/modern_treasury/types/counterparty_create_params.py b/src/modern_treasury/types/counterparty_create_params.py index 895125b1..f9379722 100644 --- a/src/modern_treasury/types/counterparty_create_params.py +++ b/src/modern_treasury/types/counterparty_create_params.py @@ -174,6 +174,7 @@ class AccountRoutingDetail(TypedDict, total=False): Literal[ "aba", "au_bsb", + "se_bankgiro_clearing_code", "br_codigo", "ca_cpa", "chips", @@ -182,12 +183,14 @@ class AccountRoutingDetail(TypedDict, total=False): "in_ifsc", "my_branch_code", "swift", + "jp_zengin_code", ] ] payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -197,12 +200,15 @@ class AccountRoutingDetail(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] diff --git a/src/modern_treasury/types/expected_payment.py b/src/modern_treasury/types/expected_payment.py index 358f92cf..a4e9cf8c 100644 --- a/src/modern_treasury/types/expected_payment.py +++ b/src/modern_treasury/types/expected_payment.py @@ -100,7 +100,7 @@ class ExpectedPayment(BaseModel): be the memo field. """ - status: Literal["archived", "reconciled", "unreconciled"] + status: Literal["archived", "partially_reconciled", "reconciled", "unreconciled"] """One of unreconciled, reconciled, or archived.""" transaction_id: Optional[str] diff --git a/src/modern_treasury/types/expected_payment_list_params.py b/src/modern_treasury/types/expected_payment_list_params.py index 5ec2788b..1e107bbb 100644 --- a/src/modern_treasury/types/expected_payment_list_params.py +++ b/src/modern_treasury/types/expected_payment_list_params.py @@ -38,7 +38,7 @@ class ExpectedPaymentListParams(TypedDict, total=False): per_page: int - status: Literal["archived", "reconciled", "unreconciled"] + status: Literal["archived", "partially_reconciled", "reconciled", "unreconciled"] """One of unreconciled, reconciled, or archived.""" type: Literal[ @@ -53,12 +53,16 @@ class ExpectedPaymentListParams(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] """ One of: ach, au_becs, bacs, book, check, eft, interac, provxchange, rtp,sen, diff --git a/src/modern_treasury/types/expected_payment_type.py b/src/modern_treasury/types/expected_payment_type.py index 08a4ea13..680d7ba0 100644 --- a/src/modern_treasury/types/expected_payment_type.py +++ b/src/modern_treasury/types/expected_payment_type.py @@ -18,11 +18,15 @@ "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] diff --git a/src/modern_treasury/types/external_account_create_params.py b/src/modern_treasury/types/external_account_create_params.py index 03d4c0ee..1dec2675 100644 --- a/src/modern_treasury/types/external_account_create_params.py +++ b/src/modern_treasury/types/external_account_create_params.py @@ -164,6 +164,7 @@ class RoutingDetail(TypedDict, total=False): Literal[ "aba", "au_bsb", + "se_bankgiro_clearing_code", "br_codigo", "ca_cpa", "chips", @@ -172,12 +173,14 @@ class RoutingDetail(TypedDict, total=False): "in_ifsc", "my_branch_code", "swift", + "jp_zengin_code", ] ] payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -187,12 +190,15 @@ class RoutingDetail(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] diff --git a/src/modern_treasury/types/external_account_verify_params.py b/src/modern_treasury/types/external_account_verify_params.py index b670813f..b6fd4a32 100644 --- a/src/modern_treasury/types/external_account_verify_params.py +++ b/src/modern_treasury/types/external_account_verify_params.py @@ -30,12 +30,16 @@ class ExternalAccountVerifyParams(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] """Both ach and eft are supported payment types.""" diff --git a/src/modern_treasury/types/incoming_payment_detail.py b/src/modern_treasury/types/incoming_payment_detail.py index 411246e2..a71823aa 100644 --- a/src/modern_treasury/types/incoming_payment_detail.py +++ b/src/modern_treasury/types/incoming_payment_detail.py @@ -83,7 +83,9 @@ class IncomingPaymentDetail(BaseModel): "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ] ] diff --git a/src/modern_treasury/types/internal_account_list_params.py b/src/modern_treasury/types/internal_account_list_params.py index c26622e1..e4b7de0a 100644 --- a/src/modern_treasury/types/internal_account_list_params.py +++ b/src/modern_treasury/types/internal_account_list_params.py @@ -41,12 +41,16 @@ class InternalAccountListParams(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] """The type of payment that can be made by the internal account.""" diff --git a/src/modern_treasury/types/invoice.py b/src/modern_treasury/types/invoice.py index a32aac71..054508ab 100644 --- a/src/modern_treasury/types/invoice.py +++ b/src/modern_treasury/types/invoice.py @@ -190,6 +190,18 @@ class Invoice(BaseModel): receiving_account_id: Optional[str] """The receiving account ID. Can be an `internal_account`.""" + recipient_email: Optional[str] + """The email of the recipient of the invoice. + + Leaving this value as null will fallback to using the counterparty's name. + """ + + recipient_name: Optional[str] + """The name of the recipient of the invoice. + + Leaving this value as null will fallback to using the counterparty's name. + """ + status: Literal["draft", "paid", "payment_pending", "unpaid", "voided"] """The status of the invoice.""" @@ -204,6 +216,9 @@ class Invoice(BaseModel): updated_at: datetime + virtual_account_id: Optional[str] + """The ID of the virtual account the invoice should be paid to.""" + from .payment_order import PaymentOrder diff --git a/src/modern_treasury/types/invoice_create_params.py b/src/modern_treasury/types/invoice_create_params.py index 69db577e..f01ba605 100644 --- a/src/modern_treasury/types/invoice_create_params.py +++ b/src/modern_treasury/types/invoice_create_params.py @@ -81,6 +81,7 @@ class InvoiceCreateParams(TypedDict, total=False): payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -90,21 +91,40 @@ class InvoiceCreateParams(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] """ - One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. """ receiving_account_id: str """The receiving account ID. Can be an `external_account`.""" + recipient_email: Optional[str] + """The email of the recipient of the invoice. + + Leaving this value as null will fallback to using the counterparty's name. + """ + + recipient_name: Optional[str] + """The name of the recipient of the invoice. + + Leaving this value as null will fallback to using the counterparty's name. + """ + + virtual_account_id: Optional[str] + """The ID of the virtual account the invoice should be paid to.""" + class ContactDetail(TypedDict, total=False): id: Required[str] diff --git a/src/modern_treasury/types/invoice_update_params.py b/src/modern_treasury/types/invoice_update_params.py index e7ba9509..30f04057 100644 --- a/src/modern_treasury/types/invoice_update_params.py +++ b/src/modern_treasury/types/invoice_update_params.py @@ -81,6 +81,7 @@ class InvoiceUpdateParams(TypedDict, total=False): payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -90,21 +91,37 @@ class InvoiceUpdateParams(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] """ - One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. """ receiving_account_id: str """The receiving account ID. Can be an `external_account`.""" + recipient_email: Optional[str] + """The email of the recipient of the invoice. + + Leaving this value as null will fallback to using the counterparty's name. + """ + + recipient_name: Optional[str] + """The name of the recipient of the invoice. + + Leaving this value as null will fallback to using the counterparty's name. + """ + status: str """ Invoice status must be updated in a `PATCH` request that does not modify any @@ -112,6 +129,9 @@ class InvoiceUpdateParams(TypedDict, total=False): `draft` or `unpaid` to `voided`, and `draft` or `unpaid` to `paid`. """ + virtual_account_id: Optional[str] + """The ID of the virtual account the invoice should be paid to.""" + class ContactDetail(TypedDict, total=False): id: Required[str] diff --git a/src/modern_treasury/types/ledger_account_balance_monitor.py b/src/modern_treasury/types/ledger_account_balance_monitor.py new file mode 100644 index 00000000..d3d89f24 --- /dev/null +++ b/src/modern_treasury/types/ledger_account_balance_monitor.py @@ -0,0 +1,148 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Dict, Optional +from datetime import datetime + +from .._models import BaseModel + +__all__ = [ + "LedgerAccountBalanceMonitor", + "AlertCondition", + "CurrentLedgerAccountBalanceState", + "CurrentLedgerAccountBalanceStateBalances", + "CurrentLedgerAccountBalanceStateBalancesAvailableBalance", + "CurrentLedgerAccountBalanceStateBalancesPendingBalance", + "CurrentLedgerAccountBalanceStateBalancesPostedBalance", +] + + +class AlertCondition(BaseModel): + field: str + """ + One of `available_balance_amount`, `pending_balance_amount`, + `posted_balance_amount`, `ledger_account_lock_version`. + """ + + operator: str + """A logical operator to compare the `field` against the `value`. + + One of `less_than`, `less_than_or_equals`, `equals`, `greater_than_or_equals`, + `greater_than`. + """ + + value: int + """ + The monitor's `current_ledger_account_balance_state.triggered` will be `true` + when comparing the `field` to this integer value using the `operator` is + logically true. + """ + + +class CurrentLedgerAccountBalanceStateBalancesAvailableBalance(BaseModel): + amount: int + + credits: int + + currency: str + """The currency of the ledger account.""" + + currency_exponent: int + """The currency exponent of the ledger account.""" + + debits: int + + +class CurrentLedgerAccountBalanceStateBalancesPendingBalance(BaseModel): + amount: int + + credits: int + + currency: str + """The currency of the ledger account.""" + + currency_exponent: int + """The currency exponent of the ledger account.""" + + debits: int + + +class CurrentLedgerAccountBalanceStateBalancesPostedBalance(BaseModel): + amount: int + + credits: int + + currency: str + """The currency of the ledger account.""" + + currency_exponent: int + """The currency exponent of the ledger account.""" + + debits: int + + +class CurrentLedgerAccountBalanceStateBalances(BaseModel): + available_balance: CurrentLedgerAccountBalanceStateBalancesAvailableBalance + """ + The available_balance is the sum of all posted inbound entries and pending + outbound entries. For credit normal, available_amount = posted_credits - + pending_debits; for debit normal, available_amount = posted_debits - + pending_credits. + """ + + pending_balance: CurrentLedgerAccountBalanceStateBalancesPendingBalance + """The pending_balance is the sum of all pending and posted entries.""" + + posted_balance: CurrentLedgerAccountBalanceStateBalancesPostedBalance + """The posted_balance is the sum of all posted entries.""" + + +class CurrentLedgerAccountBalanceState(BaseModel): + balances: CurrentLedgerAccountBalanceStateBalances + + ledger_account_lock_version: int + """The current lock version of the ledger account.""" + + triggered: bool + """ + If `true`, the ledger account's balances satisfy the `alert_condition` at this + lock version. + """ + + +class LedgerAccountBalanceMonitor(BaseModel): + id: str + + alert_condition: AlertCondition + """Describes the condition that must be satisfied for the monitor to be triggered.""" + + created_at: datetime + + current_ledger_account_balance_state: CurrentLedgerAccountBalanceState + """ + The ledger account's balances and the monitor state as of the current ledger + account lock version. + """ + + description: Optional[str] + """An optional, free-form description for internal use.""" + + discarded_at: Optional[datetime] + + ledger_account_id: str + """The ledger account associated with this balance monitor.""" + + live_mode: bool + """ + This field will be true if this object exists in the live environment or false + if it exists in the test environment. + """ + + metadata: Dict[str, str] + """Additional data represented as key-value pairs. + + Both the key and value must be strings. + """ + + object: str + + updated_at: datetime diff --git a/src/modern_treasury/types/ledger_account_balance_monitor_create_params.py b/src/modern_treasury/types/ledger_account_balance_monitor_create_params.py new file mode 100644 index 00000000..50841edd --- /dev/null +++ b/src/modern_treasury/types/ledger_account_balance_monitor_create_params.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Required, TypedDict + +__all__ = ["LedgerAccountBalanceMonitorCreateParams", "AlertCondition"] + + +class LedgerAccountBalanceMonitorCreateParams(TypedDict, total=False): + alert_condition: Required[AlertCondition] + """Describes the condition that must be satisfied for the monitor to be triggered.""" + + ledger_account_id: Required[str] + """The ledger account associated with this balance monitor.""" + + description: str + """An optional, free-form description for internal use.""" + + metadata: Dict[str, str] + """Additional data represented as key-value pairs. + + Both the key and value must be strings. + """ + + +class AlertCondition(TypedDict, total=False): + field: Required[str] + """ + One of `available_balance_amount`, `pending_balance_amount`, + `posted_balance_amount`, `ledger_account_lock_version`. + """ + + operator: Required[str] + """A logical operator to compare the `field` against the `value`. + + One of `less_than`, `less_than_or_equals`, `equals`, `greater_than_or_equals`, + `greater_than`. + """ + + value: Required[int] + """ + The monitor's `current_ledger_account_balance_state.triggered` will be `true` + when comparing the `field` to this integer value using the `operator` is + logically true. + """ diff --git a/src/modern_treasury/types/ledger_account_balance_monitor_list_params.py b/src/modern_treasury/types/ledger_account_balance_monitor_list_params.py new file mode 100644 index 00000000..4882ec6f --- /dev/null +++ b/src/modern_treasury/types/ledger_account_balance_monitor_list_params.py @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict, List, Optional +from typing_extensions import TypedDict + +__all__ = ["LedgerAccountBalanceMonitorListParams"] + + +class LedgerAccountBalanceMonitorListParams(TypedDict, total=False): + id: List[str] + """ + If you have specific IDs to retrieve in bulk, you can pass them as query + parameters delimited with `id[]=`, for example `?id[]=123&id[]=abc`. + """ + + after_cursor: Optional[str] + + ledger_account_id: str + """Query the balance monitors for a single ledger account.""" + + metadata: Dict[str, str] + """ + For example, if you want to query for records with metadata key `Type` and value + `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query + parameters. + """ + + per_page: int diff --git a/src/modern_treasury/types/ledger_account_balance_monitor_update_params.py b/src/modern_treasury/types/ledger_account_balance_monitor_update_params.py new file mode 100644 index 00000000..662d00ff --- /dev/null +++ b/src/modern_treasury/types/ledger_account_balance_monitor_update_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypedDict + +__all__ = ["LedgerAccountBalanceMonitorUpdateParams"] + + +class LedgerAccountBalanceMonitorUpdateParams(TypedDict, total=False): + description: str + """An optional, free-form description for internal use.""" + + metadata: Dict[str, str] + """Additional data represented as key-value pairs. + + Both the key and value must be strings. + """ diff --git a/src/modern_treasury/types/ledger_account_list_params.py b/src/modern_treasury/types/ledger_account_list_params.py index b01ab8db..5974e2c9 100644 --- a/src/modern_treasury/types/ledger_account_list_params.py +++ b/src/modern_treasury/types/ledger_account_list_params.py @@ -8,7 +8,13 @@ from .._utils import PropertyInfo -__all__ = ["LedgerAccountListParams", "Balances"] +__all__ = [ + "LedgerAccountListParams", + "AvailableBalanceAmount", + "Balances", + "PendingBalanceAmount", + "PostedBalanceAmount", +] class LedgerAccountListParams(TypedDict, total=False): @@ -20,6 +26,12 @@ class LedgerAccountListParams(TypedDict, total=False): after_cursor: Optional[str] + available_balance_amount: AvailableBalanceAmount + """ + Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + """ + balances: Balances """ Use `balances[effective_at_lower_bound]` and @@ -51,8 +63,20 @@ class LedgerAccountListParams(TypedDict, total=False): name: str + pending_balance_amount: PendingBalanceAmount + """ + Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + """ + per_page: int + posted_balance_amount: PostedBalanceAmount + """ + Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to + filter by balance amount. + """ + updated_at: Dict[str, Union[str, datetime]] """ Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to filter by the @@ -61,6 +85,20 @@ class LedgerAccountListParams(TypedDict, total=False): """ +class AvailableBalanceAmount(TypedDict, total=False): + eq: int + + gt: int + + gte: int + + lt: int + + lte: int + + not_eq: int + + class Balances(TypedDict, total=False): as_of_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")] @@ -69,3 +107,31 @@ class Balances(TypedDict, total=False): effective_at_lower_bound: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] effective_at_upper_bound: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + + +class PendingBalanceAmount(TypedDict, total=False): + eq: int + + gt: int + + gte: int + + lt: int + + lte: int + + not_eq: int + + +class PostedBalanceAmount(TypedDict, total=False): + eq: int + + gt: int + + gte: int + + lt: int + + lte: int + + not_eq: int diff --git a/src/modern_treasury/types/payment_flow.py b/src/modern_treasury/types/payment_flow.py index 2ad6ce16..e0b23160 100644 --- a/src/modern_treasury/types/payment_flow.py +++ b/src/modern_treasury/types/payment_flow.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. from typing import Optional -from datetime import datetime +from datetime import date, datetime from typing_extensions import Literal from .._models import BaseModel @@ -44,6 +44,18 @@ class PaymentFlow(BaseModel): own. """ + due_date: Optional[date] = None + """The due date for the flow. + + Can only be passed in when `effective_date_selection_enabled` is `true`. + """ + + effective_date_selection_enabled: Optional[bool] = None + """ + When `true`, your end-user can schedule the payment `effective_date` while + completing the pre-built UI. + """ + live_mode: Optional[bool] = None """ This field will be true if this object exists in the live environment or false @@ -61,6 +73,13 @@ class PaymentFlow(BaseModel): receiving_account_id: Optional[str] = None """If present, the ID of the external account created using this flow.""" + selected_effective_date: Optional[date] = None + """ + This field is set after your end-user selects a payment date while completing + the pre-built UI. This field is always `null` unless + `effective_date_selection_enabled` is `true`. + """ + status: Optional[Literal["cancelled", "completed", "expired", "pending"]] = None """The current status of the payment flow. diff --git a/src/modern_treasury/types/payment_flow_create_params.py b/src/modern_treasury/types/payment_flow_create_params.py index feac0a72..3db85d62 100644 --- a/src/modern_treasury/types/payment_flow_create_params.py +++ b/src/modern_treasury/types/payment_flow_create_params.py @@ -2,7 +2,11 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing import Union +from datetime import date +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["PaymentFlowCreateParams"] @@ -34,3 +38,11 @@ class PaymentFlowCreateParams(TypedDict, total=False): originating_account_id: Required[str] """Required. The ID of one of your organization's internal accounts.""" + + due_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")] + """Optional. + + Can only be passed in when `effective_date_selection_enabled` is `true`. When + set, the due date is shown to your end-user in the pre-built UI as they are + selecting a payment `effective_date`. + """ diff --git a/src/modern_treasury/types/payment_order.py b/src/modern_treasury/types/payment_order.py index ec6a6da9..f2ec3e25 100644 --- a/src/modern_treasury/types/payment_order.py +++ b/src/modern_treasury/types/payment_order.py @@ -335,8 +335,9 @@ class PaymentOrder(BaseModel): type: PaymentOrderType """ - One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. """ ultimate_originating_party_identifier: Optional[str] diff --git a/src/modern_treasury/types/payment_order_create_async_params.py b/src/modern_treasury/types/payment_order_create_async_params.py index 9345726b..e15ceb4a 100644 --- a/src/modern_treasury/types/payment_order_create_async_params.py +++ b/src/modern_treasury/types/payment_order_create_async_params.py @@ -54,8 +54,9 @@ class PaymentOrderCreateAsyncParams(TypedDict, total=False): type: Required[PaymentOrderType] """ - One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. """ accounting: Accounting @@ -494,6 +495,7 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): Literal[ "aba", "au_bsb", + "se_bankgiro_clearing_code", "br_codigo", "ca_cpa", "chips", @@ -502,12 +504,14 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "in_ifsc", "my_branch_code", "swift", + "jp_zengin_code", ] ] payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -517,12 +521,15 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] diff --git a/src/modern_treasury/types/payment_order_create_params.py b/src/modern_treasury/types/payment_order_create_params.py index 4a95431b..76c93775 100644 --- a/src/modern_treasury/types/payment_order_create_params.py +++ b/src/modern_treasury/types/payment_order_create_params.py @@ -57,8 +57,9 @@ class PaymentOrderCreateParams(TypedDict, total=False): type: Required[PaymentOrderType] """ - One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. """ accounting: Accounting @@ -537,6 +538,7 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): Literal[ "aba", "au_bsb", + "se_bankgiro_clearing_code", "br_codigo", "ca_cpa", "chips", @@ -545,12 +547,14 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "in_ifsc", "my_branch_code", "swift", + "jp_zengin_code", ] ] payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -560,12 +564,15 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] diff --git a/src/modern_treasury/types/payment_order_list_params.py b/src/modern_treasury/types/payment_order_list_params.py index 0e943344..b1bc0abd 100644 --- a/src/modern_treasury/types/payment_order_list_params.py +++ b/src/modern_treasury/types/payment_order_list_params.py @@ -75,10 +75,14 @@ class PaymentOrderListParams(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] diff --git a/src/modern_treasury/types/payment_order_type.py b/src/modern_treasury/types/payment_order_type.py index 588292b1..8b09e563 100644 --- a/src/modern_treasury/types/payment_order_type.py +++ b/src/modern_treasury/types/payment_order_type.py @@ -16,10 +16,14 @@ "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] diff --git a/src/modern_treasury/types/payment_order_update_params.py b/src/modern_treasury/types/payment_order_update_params.py index afdbbd29..13fd4a6e 100644 --- a/src/modern_treasury/types/payment_order_update_params.py +++ b/src/modern_treasury/types/payment_order_update_params.py @@ -217,8 +217,9 @@ class PaymentOrderUpdateParams(TypedDict, total=False): type: PaymentOrderType """ - One of `ach`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, `bacs`, - `au_becs`, `interac`, `signet`, `provexchange`. + One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, + `zengin`. """ ultimate_originating_party_identifier: Optional[str] @@ -388,6 +389,7 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): Literal[ "aba", "au_bsb", + "se_bankgiro_clearing_code", "br_codigo", "ca_cpa", "chips", @@ -396,12 +398,14 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "in_ifsc", "my_branch_code", "swift", + "jp_zengin_code", ] ] payment_type: Literal[ "ach", "au_becs", + "se_bankgirot", "bacs", "book", "card", @@ -411,12 +415,15 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", "sen", + "sic", "sepa", "signet", "wire", + "zengin", ] diff --git a/src/modern_treasury/types/routing_detail.py b/src/modern_treasury/types/routing_detail.py index 2a8d8fc7..f4d00b8f 100644 --- a/src/modern_treasury/types/routing_detail.py +++ b/src/modern_treasury/types/routing_detail.py @@ -74,12 +74,16 @@ class RoutingDetail(BaseModel): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] """ @@ -91,7 +95,18 @@ class RoutingDetail(BaseModel): """The routing number of the bank.""" routing_number_type: Literal[ - "aba", "au_bsb", "br_codigo", "ca_cpa", "chips", "cnaps", "gb_sort_code", "in_ifsc", "my_branch_code", "swift" + "aba", + "au_bsb", + "br_codigo", + "ca_cpa", + "chips", + "cnaps", + "gb_sort_code", + "in_ifsc", + "jp_zengin_code", + "my_branch_code", + "se_bankgiro_clearing_code", + "swift", ] """One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.""" diff --git a/src/modern_treasury/types/routing_detail_create_params.py b/src/modern_treasury/types/routing_detail_create_params.py index a3b28d23..5214e32f 100644 --- a/src/modern_treasury/types/routing_detail_create_params.py +++ b/src/modern_treasury/types/routing_detail_create_params.py @@ -24,7 +24,9 @@ class RoutingDetailCreateParams(TypedDict, total=False): "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ] ] @@ -43,12 +45,16 @@ class RoutingDetailCreateParams(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] """ diff --git a/src/modern_treasury/types/routing_number_lookup_request.py b/src/modern_treasury/types/routing_number_lookup_request.py index 5915c145..3050143c 100644 --- a/src/modern_treasury/types/routing_number_lookup_request.py +++ b/src/modern_treasury/types/routing_number_lookup_request.py @@ -36,12 +36,14 @@ class RoutingNumberLookupRequest(BaseModel): routing_number: Optional[str] = None """The routing number of the bank.""" - routing_number_type: Optional[Literal["aba", "au_bsb", "ca_cpa", "gb_sort_code", "in_ifsc", "swift"]] = None + routing_number_type: Optional[ + Literal["aba", "au_bsb", "ca_cpa", "gb_sort_code", "in_ifsc", "se_bankgiro_clearing_code", "swift"] + ] = None """ One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, or `swift`. In sandbox mode we currently only - support `aba` and `swift` with routing numbers '123456789' and 'GRINUST0XXX' - respectively. + `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox + mode we currently only support `aba` and `swift` with routing numbers + '123456789' and 'GRINUST0XXX' respectively. """ sanctions: Optional[Dict[str, object]] = None @@ -65,12 +67,16 @@ class RoutingNumberLookupRequest(BaseModel): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] ] = None diff --git a/src/modern_treasury/types/transaction.py b/src/modern_treasury/types/transaction.py index 96510e8b..82120585 100644 --- a/src/modern_treasury/types/transaction.py +++ b/src/modern_treasury/types/transaction.py @@ -89,12 +89,16 @@ class Transaction(BaseModel): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] """The type of the transaction. diff --git a/src/modern_treasury/types/transactions/line_item_list_params.py b/src/modern_treasury/types/transactions/line_item_list_params.py index 79afc30c..dd131fa8 100644 --- a/src/modern_treasury/types/transactions/line_item_list_params.py +++ b/src/modern_treasury/types/transactions/line_item_list_params.py @@ -2,15 +2,19 @@ from __future__ import annotations -from typing import Optional +from typing import Dict, Optional from typing_extensions import Literal, TypedDict __all__ = ["LineItemListParams"] class LineItemListParams(TypedDict, total=False): + id: Dict[str, str] + after_cursor: Optional[str] per_page: int + transaction_id: str + type: Optional[Literal["originating", "receiving"]] diff --git a/src/modern_treasury/types/transactions/transaction_line_item.py b/src/modern_treasury/types/transactions/transaction_line_item.py index 7396bfe6..784b1f6d 100644 --- a/src/modern_treasury/types/transactions/transaction_line_item.py +++ b/src/modern_treasury/types/transactions/transaction_line_item.py @@ -18,7 +18,7 @@ class TransactionLineItem(BaseModel): Value in specified currency's smallest unit (taken from parent Transaction). """ - counterparty_id: str + counterparty_id: Optional[str] """The ID for the counterparty for this transaction line item.""" created_at: datetime @@ -34,7 +34,7 @@ class TransactionLineItem(BaseModel): discarded_at: Optional[datetime] - expected_payment_id: str + expected_payment_id: Optional[str] """The ID of the reconciled Expected Payment, otherwise `null`.""" live_mode: bool @@ -59,6 +59,9 @@ class TransactionLineItem(BaseModel): otherwise `null`. """ + transaction_id: str + """The ID of the parent transaction.""" + type: Literal["originating", "receiving"] """ Indicates whether the line item is `originating` or `receiving` (see diff --git a/src/modern_treasury/types/validation_validate_routing_number_params.py b/src/modern_treasury/types/validation_validate_routing_number_params.py index 9eeed19f..6ad0dcbc 100644 --- a/src/modern_treasury/types/validation_validate_routing_number_params.py +++ b/src/modern_treasury/types/validation_validate_routing_number_params.py @@ -21,13 +21,15 @@ class ValidationValidateRoutingNumberParams(TypedDict, total=False): "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ] ] """ One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, or `swift`. In sandbox mode we currently only - support `aba` and `swift` with routing numbers '123456789' and 'GRINUST0XXX' - respectively. + `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox + mode we currently only support `aba` and `swift` with routing numbers + '123456789' and 'GRINUST0XXX' respectively. """ diff --git a/src/modern_treasury/types/virtual_account_create_params.py b/src/modern_treasury/types/virtual_account_create_params.py index 7bdc79f7..7c38173d 100644 --- a/src/modern_treasury/types/virtual_account_create_params.py +++ b/src/modern_treasury/types/virtual_account_create_params.py @@ -80,7 +80,9 @@ class RoutingDetail(TypedDict, total=False): "cnaps", "gb_sort_code", "in_ifsc", + "jp_zengin_code", "my_branch_code", + "se_bankgiro_clearing_code", "swift", ] ] @@ -99,12 +101,16 @@ class RoutingDetail(TypedDict, total=False): "interac", "masav", "neft", + "nics", "provxchange", "rtp", + "se_bankgirot", "sen", "sepa", + "sic", "signet", "wire", + "zengin", ] ] """ diff --git a/tests/api_resources/test_account_collection_flows.py b/tests/api_resources/test_account_collection_flows.py index 05438a70..af25acf9 100644 --- a/tests/api_resources/test_account_collection_flows.py +++ b/tests/api_resources/test_account_collection_flows.py @@ -32,6 +32,15 @@ def test_method_create(self, client: ModernTreasury) -> None: ) assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"]) + @parametrize + def test_method_create_with_all_params(self, client: ModernTreasury) -> None: + account_collection_flow = client.account_collection_flows.create( + counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + payment_types=["string", "string", "string"], + receiving_countries=["USA", "AUS", "BEL"], + ) + assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"]) + @parametrize def test_method_retrieve(self, client: ModernTreasury) -> None: account_collection_flow = client.account_collection_flows.retrieve( @@ -82,6 +91,15 @@ async def test_method_create(self, client: AsyncModernTreasury) -> None: ) assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"]) + @parametrize + async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: + account_collection_flow = await client.account_collection_flows.create( + counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + payment_types=["string", "string", "string"], + receiving_countries=["USA", "AUS", "BEL"], + ) + assert_matches_type(AccountCollectionFlow, account_collection_flow, path=["response"]) + @parametrize async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: account_collection_flow = await client.account_collection_flows.retrieve( diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index 616e3039..5ab32452 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -104,6 +104,9 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: payment_method="ui", payment_type="ach", receiving_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + recipient_email="string", + recipient_name="string", + virtual_account_id="string", ) assert_matches_type(Invoice, invoice, path=["response"]) @@ -192,7 +195,10 @@ def test_method_update_with_all_params(self, client: ModernTreasury) -> None: payment_method="ui", payment_type="ach", receiving_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + recipient_email="string", + recipient_name="string", status="string", + virtual_account_id="string", ) assert_matches_type(Invoice, invoice, path=["response"]) @@ -209,6 +215,14 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: ) assert_matches_type(SyncPage[Invoice], invoice, path=["response"]) + @parametrize + def test_method_add_payment_order(self, client: ModernTreasury) -> None: + invoice = client.invoices.add_payment_order( + "string", + id="string", + ) + assert invoice is None + class TestAsyncInvoices: strict_client = AsyncModernTreasury( @@ -298,6 +312,9 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) payment_method="ui", payment_type="ach", receiving_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + recipient_email="string", + recipient_name="string", + virtual_account_id="string", ) assert_matches_type(Invoice, invoice, path=["response"]) @@ -386,7 +403,10 @@ async def test_method_update_with_all_params(self, client: AsyncModernTreasury) payment_method="ui", payment_type="ach", receiving_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + recipient_email="string", + recipient_name="string", status="string", + virtual_account_id="string", ) assert_matches_type(Invoice, invoice, path=["response"]) @@ -402,3 +422,11 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> per_page=0, ) assert_matches_type(AsyncPage[Invoice], invoice, path=["response"]) + + @parametrize + async def test_method_add_payment_order(self, client: AsyncModernTreasury) -> None: + invoice = await client.invoices.add_payment_order( + "string", + id="string", + ) + assert invoice is None diff --git a/tests/api_resources/test_ledger_account_balance_monitors.py b/tests/api_resources/test_ledger_account_balance_monitors.py new file mode 100644 index 00000000..7791f154 --- /dev/null +++ b/tests/api_resources/test_ledger_account_balance_monitors.py @@ -0,0 +1,195 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +import os + +import pytest + +from tests.utils import assert_matches_type +from modern_treasury import ModernTreasury, AsyncModernTreasury +from modern_treasury.types import LedgerAccountBalanceMonitor +from modern_treasury.pagination import SyncPage, AsyncPage + +base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") +api_key = os.environ.get("API_KEY", "something1234") + + +class TestLedgerAccountBalanceMonitors: + strict_client = ModernTreasury( + base_url=base_url, api_key=api_key, _strict_response_validation=True, organization_id="my-organization-ID" + ) + loose_client = ModernTreasury( + base_url=base_url, api_key=api_key, _strict_response_validation=False, organization_id="my-organization-ID" + ) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + def test_method_create(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.create( + alert_condition={ + "field": "string", + "operator": "string", + "value": 0, + }, + ledger_account_id="string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.create( + alert_condition={ + "field": "string", + "operator": "string", + "value": 0, + }, + ledger_account_id="string", + description="string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + def test_method_retrieve(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.retrieve( + "string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + def test_method_update(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.update( + "string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.update( + "string", + description="string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + def test_method_list(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.list() + assert_matches_type(SyncPage[LedgerAccountBalanceMonitor], ledger_account_balance_monitor, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.list( + id=["string", "string", "string"], + after_cursor="string", + ledger_account_id="string", + metadata={"foo": "string"}, + per_page=0, + ) + assert_matches_type(SyncPage[LedgerAccountBalanceMonitor], ledger_account_balance_monitor, path=["response"]) + + @parametrize + def test_method_delete(self, client: ModernTreasury) -> None: + ledger_account_balance_monitor = client.ledger_account_balance_monitors.delete( + "string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + +class TestAsyncLedgerAccountBalanceMonitors: + strict_client = AsyncModernTreasury( + base_url=base_url, api_key=api_key, _strict_response_validation=True, organization_id="my-organization-ID" + ) + loose_client = AsyncModernTreasury( + base_url=base_url, api_key=api_key, _strict_response_validation=False, organization_id="my-organization-ID" + ) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + async def test_method_create(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.create( + alert_condition={ + "field": "string", + "operator": "string", + "value": 0, + }, + ledger_account_id="string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.create( + alert_condition={ + "field": "string", + "operator": "string", + "value": 0, + }, + ledger_account_id="string", + description="string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.retrieve( + "string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + async def test_method_update(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.update( + "string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.update( + "string", + description="string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) + + @parametrize + async def test_method_list(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.list() + assert_matches_type(AsyncPage[LedgerAccountBalanceMonitor], ledger_account_balance_monitor, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.list( + id=["string", "string", "string"], + after_cursor="string", + ledger_account_id="string", + metadata={"foo": "string"}, + per_page=0, + ) + assert_matches_type(AsyncPage[LedgerAccountBalanceMonitor], ledger_account_balance_monitor, path=["response"]) + + @parametrize + async def test_method_delete(self, client: AsyncModernTreasury) -> None: + ledger_account_balance_monitor = await client.ledger_account_balance_monitors.delete( + "string", + ) + assert_matches_type(LedgerAccountBalanceMonitor, ledger_account_balance_monitor, path=["response"]) diff --git a/tests/api_resources/test_ledger_account_payouts.py b/tests/api_resources/test_ledger_account_payouts.py index a3c6b41d..a839dc03 100644 --- a/tests/api_resources/test_ledger_account_payouts.py +++ b/tests/api_resources/test_ledger_account_payouts.py @@ -49,6 +49,13 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: ) assert_matches_type(LedgerAccountPayout, ledger_account_payout, path=["response"]) + @parametrize + def test_method_retrieve(self, client: ModernTreasury) -> None: + ledger_account_payout = client.ledger_account_payouts.retrieve( + "string", + ) + assert_matches_type(LedgerAccountPayout, ledger_account_payout, path=["response"]) + @parametrize def test_method_update(self, client: ModernTreasury) -> None: ledger_account_payout = client.ledger_account_payouts.update( @@ -88,9 +95,10 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: @parametrize def test_method_retireve(self, client: ModernTreasury) -> None: - ledger_account_payout = client.ledger_account_payouts.retireve( - "string", - ) + with pytest.warns(DeprecationWarning): + ledger_account_payout = client.ledger_account_payouts.retireve( # pyright: ignore[reportDeprecated] + "string", + ) assert_matches_type(LedgerAccountPayout, ledger_account_payout, path=["response"]) @@ -128,6 +136,13 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) ) assert_matches_type(LedgerAccountPayout, ledger_account_payout, path=["response"]) + @parametrize + async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: + ledger_account_payout = await client.ledger_account_payouts.retrieve( + "string", + ) + assert_matches_type(LedgerAccountPayout, ledger_account_payout, path=["response"]) + @parametrize async def test_method_update(self, client: AsyncModernTreasury) -> None: ledger_account_payout = await client.ledger_account_payouts.update( @@ -167,7 +182,8 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> @parametrize async def test_method_retireve(self, client: AsyncModernTreasury) -> None: - ledger_account_payout = await client.ledger_account_payouts.retireve( - "string", - ) + with pytest.warns(DeprecationWarning): + ledger_account_payout = await client.ledger_account_payouts.retireve( # pyright: ignore[reportDeprecated] + "string", + ) assert_matches_type(LedgerAccountPayout, ledger_account_payout, path=["response"]) diff --git a/tests/api_resources/test_ledger_accounts.py b/tests/api_resources/test_ledger_accounts.py index 90fe4639..f5212d91 100644 --- a/tests/api_resources/test_ledger_accounts.py +++ b/tests/api_resources/test_ledger_accounts.py @@ -106,6 +106,14 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: ledger_account = client.ledger_accounts.list( id=["string", "string", "string"], after_cursor="string", + available_balance_amount={ + "gt": 0, + "lt": 0, + "gte": 0, + "lte": 0, + "eq": 0, + "not_eq": 0, + }, balances={ "as_of_date": parse_date("2019-12-27"), "effective_at": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -118,7 +126,23 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: ledger_id="string", metadata={"foo": "string"}, name="string", + pending_balance_amount={ + "gt": 0, + "lt": 0, + "gte": 0, + "lte": 0, + "eq": 0, + "not_eq": 0, + }, per_page=0, + posted_balance_amount={ + "gt": 0, + "lt": 0, + "gte": 0, + "lte": 0, + "eq": 0, + "not_eq": 0, + }, updated_at={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, ) assert_matches_type(SyncPage[LedgerAccount], ledger_account, path=["response"]) @@ -221,6 +245,14 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> ledger_account = await client.ledger_accounts.list( id=["string", "string", "string"], after_cursor="string", + available_balance_amount={ + "gt": 0, + "lt": 0, + "gte": 0, + "lte": 0, + "eq": 0, + "not_eq": 0, + }, balances={ "as_of_date": parse_date("2019-12-27"), "effective_at": parse_datetime("2019-12-27T18:11:19.117Z"), @@ -233,7 +265,23 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> ledger_id="string", metadata={"foo": "string"}, name="string", + pending_balance_amount={ + "gt": 0, + "lt": 0, + "gte": 0, + "lte": 0, + "eq": 0, + "not_eq": 0, + }, per_page=0, + posted_balance_amount={ + "gt": 0, + "lt": 0, + "gte": 0, + "lte": 0, + "eq": 0, + "not_eq": 0, + }, updated_at={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, ) assert_matches_type(AsyncPage[LedgerAccount], ledger_account, path=["response"]) diff --git a/tests/api_resources/test_payment_flows.py b/tests/api_resources/test_payment_flows.py index 847bbccf..a3091f43 100644 --- a/tests/api_resources/test_payment_flows.py +++ b/tests/api_resources/test_payment_flows.py @@ -9,6 +9,7 @@ from tests.utils import assert_matches_type from modern_treasury import ModernTreasury, AsyncModernTreasury from modern_treasury.types import PaymentFlow +from modern_treasury._utils import parse_date from modern_treasury.pagination import SyncPage, AsyncPage base_url = os.environ.get("API_BASE_URL", "http://127.0.0.1:4010") @@ -35,6 +36,18 @@ def test_method_create(self, client: ModernTreasury) -> None: ) assert_matches_type(PaymentFlow, payment_flow, path=["response"]) + @parametrize + def test_method_create_with_all_params(self, client: ModernTreasury) -> None: + payment_flow = client.payment_flows.create( + amount=0, + counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + currency="string", + direction="credit", + originating_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + due_date=parse_date("2019-12-27"), + ) + assert_matches_type(PaymentFlow, payment_flow, path=["response"]) + @parametrize def test_method_retrieve(self, client: ModernTreasury) -> None: payment_flow = client.payment_flows.retrieve( @@ -90,6 +103,18 @@ async def test_method_create(self, client: AsyncModernTreasury) -> None: ) assert_matches_type(PaymentFlow, payment_flow, path=["response"]) + @parametrize + async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: + payment_flow = await client.payment_flows.create( + amount=0, + counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + currency="string", + direction="credit", + originating_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + due_date=parse_date("2019-12-27"), + ) + assert_matches_type(PaymentFlow, payment_flow, path=["response"]) + @parametrize async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: payment_flow = await client.payment_flows.retrieve( diff --git a/tests/api_resources/test_payment_references.py b/tests/api_resources/test_payment_references.py index 9e1d4c63..7a620778 100644 --- a/tests/api_resources/test_payment_references.py +++ b/tests/api_resources/test_payment_references.py @@ -24,6 +24,13 @@ class TestPaymentReferences: ) parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + @parametrize + def test_method_retrieve(self, client: ModernTreasury) -> None: + payment_reference = client.payment_references.retrieve( + "string", + ) + assert_matches_type(PaymentReference, payment_reference, path=["response"]) + @parametrize def test_method_list(self, client: ModernTreasury) -> None: payment_reference = client.payment_references.list() @@ -42,9 +49,10 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: @parametrize def test_method_retireve(self, client: ModernTreasury) -> None: - payment_reference = client.payment_references.retireve( - "string", - ) + with pytest.warns(DeprecationWarning): + payment_reference = client.payment_references.retireve( # pyright: ignore[reportDeprecated] + "string", + ) assert_matches_type(PaymentReference, payment_reference, path=["response"]) @@ -57,6 +65,13 @@ class TestAsyncPaymentReferences: ) parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + @parametrize + async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: + payment_reference = await client.payment_references.retrieve( + "string", + ) + assert_matches_type(PaymentReference, payment_reference, path=["response"]) + @parametrize async def test_method_list(self, client: AsyncModernTreasury) -> None: payment_reference = await client.payment_references.list() @@ -75,7 +90,8 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> @parametrize async def test_method_retireve(self, client: AsyncModernTreasury) -> None: - payment_reference = await client.payment_references.retireve( - "string", - ) + with pytest.warns(DeprecationWarning): + payment_reference = await client.payment_references.retireve( # pyright: ignore[reportDeprecated] + "string", + ) assert_matches_type(PaymentReference, payment_reference, path=["response"]) diff --git a/tests/api_resources/transactions/test_line_items.py b/tests/api_resources/transactions/test_line_items.py index 3844a907..c8c07373 100644 --- a/tests/api_resources/transactions/test_line_items.py +++ b/tests/api_resources/transactions/test_line_items.py @@ -24,21 +24,25 @@ class TestLineItems: ) parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) - @pytest.mark.skip(reason="Prism is broken in this case") @parametrize - def test_method_list(self, client: ModernTreasury) -> None: - line_item = client.transactions.line_items.list( + def test_method_retrieve(self, client: ModernTreasury) -> None: + line_item = client.transactions.line_items.retrieve( "string", ) + assert_matches_type(TransactionLineItem, line_item, path=["response"]) + + @parametrize + def test_method_list(self, client: ModernTreasury) -> None: + line_item = client.transactions.line_items.list() assert_matches_type(SyncPage[TransactionLineItem], line_item, path=["response"]) - @pytest.mark.skip(reason="Prism is broken in this case") @parametrize def test_method_list_with_all_params(self, client: ModernTreasury) -> None: line_item = client.transactions.line_items.list( - "string", + id={"foo": "string"}, after_cursor="string", per_page=0, + transaction_id="string", type="originating", ) assert_matches_type(SyncPage[TransactionLineItem], line_item, path=["response"]) @@ -53,21 +57,25 @@ class TestAsyncLineItems: ) parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) - @pytest.mark.skip(reason="Prism is broken in this case") @parametrize - async def test_method_list(self, client: AsyncModernTreasury) -> None: - line_item = await client.transactions.line_items.list( + async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: + line_item = await client.transactions.line_items.retrieve( "string", ) + assert_matches_type(TransactionLineItem, line_item, path=["response"]) + + @parametrize + async def test_method_list(self, client: AsyncModernTreasury) -> None: + line_item = await client.transactions.line_items.list() assert_matches_type(AsyncPage[TransactionLineItem], line_item, path=["response"]) - @pytest.mark.skip(reason="Prism is broken in this case") @parametrize async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> None: line_item = await client.transactions.line_items.list( - "string", + id={"foo": "string"}, after_cursor="string", per_page=0, + transaction_id="string", type="originating", ) assert_matches_type(AsyncPage[TransactionLineItem], line_item, path=["response"])