diff --git a/.stats.yml b/.stats.yml index 34095f9c..953d452f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 141 +configured_endpoints: 146 diff --git a/api.md b/api.md index fd541acd..30222c05 100644 --- a/api.md +++ b/api.md @@ -354,6 +354,7 @@ from modern_treasury.types import LedgerEntry Methods: - client.ledger_entries.retrieve(id, \*\*params) -> LedgerEntry +- client.ledger_entries.update(id, \*\*params) -> LedgerEntry - client.ledger_entries.list(\*\*params) -> SyncPage[LedgerEntry] # LedgerEventHandlers @@ -588,3 +589,18 @@ Methods: - client.bulk_results.retrieve(id) -> BulkResult - client.bulk_results.list(\*\*params) -> SyncPage[BulkResult] + +# LedgerAccountSettlements + +Types: + +```python +from modern_treasury.types import LedgerAccountSettlement +``` + +Methods: + +- client.ledger_account_settlements.create(\*\*params) -> LedgerAccountSettlement +- client.ledger_account_settlements.retrieve(id) -> LedgerAccountSettlement +- client.ledger_account_settlements.update(id, \*\*params) -> LedgerAccountSettlement +- client.ledger_account_settlements.list(\*\*params) -> SyncPage[LedgerAccountSettlement] diff --git a/src/modern_treasury/_client.py b/src/modern_treasury/_client.py index 55db7852..ae160982 100644 --- a/src/modern_treasury/_client.py +++ b/src/modern_treasury/_client.py @@ -88,6 +88,7 @@ class ModernTreasury(SyncAPIClient): virtual_accounts: resources.VirtualAccounts bulk_requests: resources.BulkRequests bulk_results: resources.BulkResults + ledger_account_settlements: resources.LedgerAccountSettlements with_raw_response: ModernTreasuryWithRawResponse # client options @@ -206,6 +207,7 @@ def __init__( self.virtual_accounts = resources.VirtualAccounts(self) self.bulk_requests = resources.BulkRequests(self) self.bulk_results = resources.BulkResults(self) + self.ledger_account_settlements = resources.LedgerAccountSettlements(self) self.with_raw_response = ModernTreasuryWithRawResponse(self) @property @@ -404,6 +406,7 @@ class AsyncModernTreasury(AsyncAPIClient): virtual_accounts: resources.AsyncVirtualAccounts bulk_requests: resources.AsyncBulkRequests bulk_results: resources.AsyncBulkResults + ledger_account_settlements: resources.AsyncLedgerAccountSettlements with_raw_response: AsyncModernTreasuryWithRawResponse # client options @@ -522,6 +525,7 @@ def __init__( self.virtual_accounts = resources.AsyncVirtualAccounts(self) self.bulk_requests = resources.AsyncBulkRequests(self) self.bulk_results = resources.AsyncBulkResults(self) + self.ledger_account_settlements = resources.AsyncLedgerAccountSettlements(self) self.with_raw_response = AsyncModernTreasuryWithRawResponse(self) @property @@ -729,6 +733,9 @@ def __init__(self, client: ModernTreasury) -> None: self.virtual_accounts = resources.VirtualAccountsWithRawResponse(client.virtual_accounts) self.bulk_requests = resources.BulkRequestsWithRawResponse(client.bulk_requests) self.bulk_results = resources.BulkResultsWithRawResponse(client.bulk_results) + self.ledger_account_settlements = resources.LedgerAccountSettlementsWithRawResponse( + client.ledger_account_settlements + ) self.ping = to_raw_response_wrapper( client.ping, @@ -780,6 +787,9 @@ def __init__(self, client: AsyncModernTreasury) -> None: self.virtual_accounts = resources.AsyncVirtualAccountsWithRawResponse(client.virtual_accounts) self.bulk_requests = resources.AsyncBulkRequestsWithRawResponse(client.bulk_requests) self.bulk_results = resources.AsyncBulkResultsWithRawResponse(client.bulk_results) + self.ledger_account_settlements = resources.AsyncLedgerAccountSettlementsWithRawResponse( + client.ledger_account_settlements + ) self.ping = async_to_raw_response_wrapper( client.ping, diff --git a/src/modern_treasury/resources/__init__.py b/src/modern_treasury/resources/__init__.py index f751372d..cbcde52a 100644 --- a/src/modern_treasury/resources/__init__.py +++ b/src/modern_treasury/resources/__init__.py @@ -193,6 +193,12 @@ LedgerAccountStatementsWithRawResponse, AsyncLedgerAccountStatementsWithRawResponse, ) +from .ledger_account_settlements import ( + LedgerAccountSettlements, + AsyncLedgerAccountSettlements, + LedgerAccountSettlementsWithRawResponse, + AsyncLedgerAccountSettlementsWithRawResponse, +) from .ledger_account_balance_monitors import ( LedgerAccountBalanceMonitors, AsyncLedgerAccountBalanceMonitors, @@ -335,4 +341,8 @@ "AsyncBulkResults", "BulkResultsWithRawResponse", "AsyncBulkResultsWithRawResponse", + "LedgerAccountSettlements", + "AsyncLedgerAccountSettlements", + "LedgerAccountSettlementsWithRawResponse", + "AsyncLedgerAccountSettlementsWithRawResponse", ] diff --git a/src/modern_treasury/resources/account_details.py b/src/modern_treasury/resources/account_details.py index 8f646a3e..7c9ed62b 100644 --- a/src/modern_treasury/resources/account_details.py +++ b/src/modern_treasury/resources/account_details.py @@ -39,7 +39,8 @@ def create( *, accounts_type: Literal["external_accounts"], account_number: str, - account_number_type: Literal["clabe", "iban", "other", "pan", "wallet_address"] | NotGiven = NOT_GIVEN, + account_number_type: Literal["clabe", "hk_number", "iban", "other", "pan", "wallet_address"] + | 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, @@ -219,7 +220,8 @@ async def create( *, accounts_type: Literal["external_accounts"], account_number: str, - account_number_type: Literal["clabe", "iban", "other", "pan", "wallet_address"] | NotGiven = NOT_GIVEN, + account_number_type: Literal["clabe", "hk_number", "iban", "other", "pan", "wallet_address"] + | 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, diff --git a/src/modern_treasury/resources/counterparties.py b/src/modern_treasury/resources/counterparties.py index 5e618bbc..a9cf2ca8 100644 --- a/src/modern_treasury/resources/counterparties.py +++ b/src/modern_treasury/resources/counterparties.py @@ -350,6 +350,10 @@ def collect_account( "jp_zengin_code", "se_bankgiro_clearing_code", "nz_national_clearing_code", + "hk_interbank_clearing_code", + "hu_interbank_clearing_code", + "dk_interbank_clearing_code", + "id_sknbi_code", ] ] | NotGiven = NOT_GIVEN, @@ -737,6 +741,10 @@ async def collect_account( "jp_zengin_code", "se_bankgiro_clearing_code", "nz_national_clearing_code", + "hk_interbank_clearing_code", + "hu_interbank_clearing_code", + "dk_interbank_clearing_code", + "id_sknbi_code", ] ] | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/expected_payments.py b/src/modern_treasury/resources/expected_payments.py index 00d84bd5..405c138d 100644 --- a/src/modern_treasury/resources/expected_payments.py +++ b/src/modern_treasury/resources/expected_payments.py @@ -328,9 +328,11 @@ def list( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -340,6 +342,7 @@ def list( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -747,9 +750,11 @@ def list( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -759,6 +764,7 @@ def list( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/resources/external_accounts.py b/src/modern_treasury/resources/external_accounts.py index 55d615ad..f09bc500 100644 --- a/src/modern_treasury/resources/external_accounts.py +++ b/src/modern_treasury/resources/external_accounts.py @@ -384,9 +384,11 @@ def verify( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -396,6 +398,7 @@ def verify( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ], @@ -804,9 +807,11 @@ async def verify( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -816,6 +821,7 @@ async def verify( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ], diff --git a/src/modern_treasury/resources/internal_accounts/internal_accounts.py b/src/modern_treasury/resources/internal_accounts/internal_accounts.py index 1d738193..630ce5e0 100644 --- a/src/modern_treasury/resources/internal_accounts/internal_accounts.py +++ b/src/modern_treasury/resources/internal_accounts/internal_accounts.py @@ -235,9 +235,11 @@ def list( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -247,6 +249,7 @@ def list( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -510,9 +513,11 @@ def list( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -522,6 +527,7 @@ def list( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/resources/invoices/invoices.py b/src/modern_treasury/resources/invoices/invoices.py index c353ee3e..5b93cbf7 100644 --- a/src/modern_treasury/resources/invoices/invoices.py +++ b/src/modern_treasury/resources/invoices/invoices.py @@ -55,6 +55,7 @@ def create( | NotGiven = NOT_GIVEN, currency: Optional[Currency] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, + fallback_payment_method: Optional[str] | NotGiven = NOT_GIVEN, invoicer_address: Optional[invoice_create_params.InvoicerAddress] | NotGiven = NOT_GIVEN, notification_email_addresses: Optional[List[str]] | NotGiven = NOT_GIVEN, notifications_enabled: bool | NotGiven = NOT_GIVEN, @@ -74,9 +75,11 @@ def create( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -86,6 +89,7 @@ def create( "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -122,6 +126,9 @@ def create( description: A free-form description of the invoice. + fallback_payment_method: When payment_method is automatic, the fallback payment method to use when an + automatic payment fails. One of `manual` or `ui`. + invoicer_address: The invoice issuer's business address. notification_email_addresses: Emails in addition to the counterparty email to send invoice status @@ -178,6 +185,7 @@ def create( "counterparty_shipping_address": counterparty_shipping_address, "currency": currency, "description": description, + "fallback_payment_method": fallback_payment_method, "invoicer_address": invoicer_address, "notification_email_addresses": notification_email_addresses, "notifications_enabled": notifications_enabled, @@ -244,6 +252,7 @@ def update( currency: Optional[Currency] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, due_date: Union[str, datetime] | NotGiven = NOT_GIVEN, + fallback_payment_method: Optional[str] | NotGiven = NOT_GIVEN, invoicer_address: Optional[invoice_update_params.InvoicerAddress] | NotGiven = NOT_GIVEN, notification_email_addresses: Optional[List[str]] | NotGiven = NOT_GIVEN, notifications_enabled: bool | NotGiven = NOT_GIVEN, @@ -264,9 +273,11 @@ def update( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -276,6 +287,7 @@ def update( "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -311,6 +323,9 @@ def update( due_date: A future date by when the invoice needs to be paid. + fallback_payment_method: When payment_method is automatic, the fallback payment method to use when an + automatic payment fails. One of `manual` or `ui`. + invoicer_address: The invoice issuer's business address. notification_email_addresses: Emails in addition to the counterparty email to send invoice status @@ -372,6 +387,7 @@ def update( "currency": currency, "description": description, "due_date": due_date, + "fallback_payment_method": fallback_payment_method, "invoicer_address": invoicer_address, "notification_email_addresses": notification_email_addresses, "notifications_enabled": notifications_enabled, @@ -502,6 +518,7 @@ async def create( | NotGiven = NOT_GIVEN, currency: Optional[Currency] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, + fallback_payment_method: Optional[str] | NotGiven = NOT_GIVEN, invoicer_address: Optional[invoice_create_params.InvoicerAddress] | NotGiven = NOT_GIVEN, notification_email_addresses: Optional[List[str]] | NotGiven = NOT_GIVEN, notifications_enabled: bool | NotGiven = NOT_GIVEN, @@ -521,9 +538,11 @@ async def create( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -533,6 +552,7 @@ async def create( "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -569,6 +589,9 @@ async def create( description: A free-form description of the invoice. + fallback_payment_method: When payment_method is automatic, the fallback payment method to use when an + automatic payment fails. One of `manual` or `ui`. + invoicer_address: The invoice issuer's business address. notification_email_addresses: Emails in addition to the counterparty email to send invoice status @@ -625,6 +648,7 @@ async def create( "counterparty_shipping_address": counterparty_shipping_address, "currency": currency, "description": description, + "fallback_payment_method": fallback_payment_method, "invoicer_address": invoicer_address, "notification_email_addresses": notification_email_addresses, "notifications_enabled": notifications_enabled, @@ -691,6 +715,7 @@ async def update( currency: Optional[Currency] | NotGiven = NOT_GIVEN, description: str | NotGiven = NOT_GIVEN, due_date: Union[str, datetime] | NotGiven = NOT_GIVEN, + fallback_payment_method: Optional[str] | NotGiven = NOT_GIVEN, invoicer_address: Optional[invoice_update_params.InvoicerAddress] | NotGiven = NOT_GIVEN, notification_email_addresses: Optional[List[str]] | NotGiven = NOT_GIVEN, notifications_enabled: bool | NotGiven = NOT_GIVEN, @@ -711,9 +736,11 @@ async def update( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -723,6 +750,7 @@ async def update( "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -758,6 +786,9 @@ async def update( due_date: A future date by when the invoice needs to be paid. + fallback_payment_method: When payment_method is automatic, the fallback payment method to use when an + automatic payment fails. One of `manual` or `ui`. + invoicer_address: The invoice issuer's business address. notification_email_addresses: Emails in addition to the counterparty email to send invoice status @@ -819,6 +850,7 @@ async def update( "currency": currency, "description": description, "due_date": due_date, + "fallback_payment_method": fallback_payment_method, "invoicer_address": invoicer_address, "notification_email_addresses": notification_email_addresses, "notifications_enabled": notifications_enabled, diff --git a/src/modern_treasury/resources/ledger_account_settlements.py b/src/modern_treasury/resources/ledger_account_settlements.py new file mode 100644 index 00000000..c1bcc967 --- /dev/null +++ b/src/modern_treasury/resources/ledger_account_settlements.py @@ -0,0 +1,533 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from datetime import datetime +from typing_extensions import Literal + +import httpx + +from ..types import ( + LedgerAccountSettlement, + ledger_account_settlement_list_params, + ledger_account_settlement_create_params, + ledger_account_settlement_update_params, +) +from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform +from .._resource import SyncAPIResource, AsyncAPIResource +from .._response import to_raw_response_wrapper, async_to_raw_response_wrapper +from ..pagination import SyncPage, AsyncPage +from .._base_client import AsyncPaginator, make_request_options + +if TYPE_CHECKING: + from .._client import ModernTreasury, AsyncModernTreasury + +__all__ = ["LedgerAccountSettlements", "AsyncLedgerAccountSettlements"] + + +class LedgerAccountSettlements(SyncAPIResource): + with_raw_response: LedgerAccountSettlementsWithRawResponse + + def __init__(self, client: ModernTreasury) -> None: + super().__init__(client) + self.with_raw_response = LedgerAccountSettlementsWithRawResponse(self) + + def create( + self, + *, + contra_ledger_account_id: str, + settled_ledger_account_id: str, + allow_either_direction: Optional[bool] | NotGiven = NOT_GIVEN, + description: Optional[str] | NotGiven = NOT_GIVEN, + effective_at_upper_bound: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + skip_settlement_ledger_transaction: Optional[bool] | NotGiven = NOT_GIVEN, + status: Optional[Literal["pending", "posted"]] | 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountSettlement: + """ + Create a ledger account settlement. + + Args: + contra_ledger_account_id: The id of the contra ledger account that sends to or receives funds from the + settled ledger account. + + settled_ledger_account_id: The id of the settled ledger account whose ledger entries are queried against, + and its balance is reduced as a result. + + allow_either_direction: If true, the settlement amount and settlement_entry_direction will bring the + settlement ledger account's balance closer to zero, even if the balance is + negative. + + description: The description of the ledger account settlement. + + effective_at_upper_bound: The exclusive upper bound of the effective_at timestamp of the ledger entries to + be included in the ledger account settlement. The default value is the + created_at timestamp of the ledger account settlement. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + skip_settlement_ledger_transaction: It is set to `false` by default. It should be set to `true` when migrating + existing settlements. + + status: The status of the ledger account settlement. It is set to `pending` by default. + To post a ledger account settlement at creation, use `posted`. + + 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_settlements", + body=maybe_transform( + { + "contra_ledger_account_id": contra_ledger_account_id, + "settled_ledger_account_id": settled_ledger_account_id, + "allow_either_direction": allow_either_direction, + "description": description, + "effective_at_upper_bound": effective_at_upper_bound, + "metadata": metadata, + "skip_settlement_ledger_transaction": skip_settlement_ledger_transaction, + "status": status, + }, + ledger_account_settlement_create_params.LedgerAccountSettlementCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountSettlement, + ) + + 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LedgerAccountSettlement: + """ + Get details on a single ledger account settlement. + + 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_settlements/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LedgerAccountSettlement, + ) + + def update( + self, + id: str, + *, + description: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + status: Literal["posted", "archived"] | 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountSettlement: + """ + Update the details of a ledger account settlement. + + Args: + description: The description of the ledger account settlement. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + status: To post a pending ledger account settlement, use `posted`. To archive a pending + ledger transaction, use `archived`. + + 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_settlements/{id}", + body=maybe_transform( + { + "description": description, + "metadata": metadata, + "status": status, + }, + ledger_account_settlement_update_params.LedgerAccountSettlementUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountSettlement, + ) + + def list( + self, + *, + id: List[str] | NotGiven = NOT_GIVEN, + after_cursor: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + settled_ledger_account_id: str | NotGiven = NOT_GIVEN, + settlement_entry_direction: 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> SyncPage[LedgerAccountSettlement]: + """ + Get a list of ledger account settlements. + + 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`. + + 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_settlements", + page=SyncPage[LedgerAccountSettlement], + 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, + "metadata": metadata, + "per_page": per_page, + "settled_ledger_account_id": settled_ledger_account_id, + "settlement_entry_direction": settlement_entry_direction, + }, + ledger_account_settlement_list_params.LedgerAccountSettlementListParams, + ), + ), + model=LedgerAccountSettlement, + ) + + +class AsyncLedgerAccountSettlements(AsyncAPIResource): + with_raw_response: AsyncLedgerAccountSettlementsWithRawResponse + + def __init__(self, client: AsyncModernTreasury) -> None: + super().__init__(client) + self.with_raw_response = AsyncLedgerAccountSettlementsWithRawResponse(self) + + async def create( + self, + *, + contra_ledger_account_id: str, + settled_ledger_account_id: str, + allow_either_direction: Optional[bool] | NotGiven = NOT_GIVEN, + description: Optional[str] | NotGiven = NOT_GIVEN, + effective_at_upper_bound: Union[str, datetime, None] | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + skip_settlement_ledger_transaction: Optional[bool] | NotGiven = NOT_GIVEN, + status: Optional[Literal["pending", "posted"]] | 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountSettlement: + """ + Create a ledger account settlement. + + Args: + contra_ledger_account_id: The id of the contra ledger account that sends to or receives funds from the + settled ledger account. + + settled_ledger_account_id: The id of the settled ledger account whose ledger entries are queried against, + and its balance is reduced as a result. + + allow_either_direction: If true, the settlement amount and settlement_entry_direction will bring the + settlement ledger account's balance closer to zero, even if the balance is + negative. + + description: The description of the ledger account settlement. + + effective_at_upper_bound: The exclusive upper bound of the effective_at timestamp of the ledger entries to + be included in the ledger account settlement. The default value is the + created_at timestamp of the ledger account settlement. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + skip_settlement_ledger_transaction: It is set to `false` by default. It should be set to `true` when migrating + existing settlements. + + status: The status of the ledger account settlement. It is set to `pending` by default. + To post a ledger account settlement at creation, use `posted`. + + 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_settlements", + body=maybe_transform( + { + "contra_ledger_account_id": contra_ledger_account_id, + "settled_ledger_account_id": settled_ledger_account_id, + "allow_either_direction": allow_either_direction, + "description": description, + "effective_at_upper_bound": effective_at_upper_bound, + "metadata": metadata, + "skip_settlement_ledger_transaction": skip_settlement_ledger_transaction, + "status": status, + }, + ledger_account_settlement_create_params.LedgerAccountSettlementCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountSettlement, + ) + + 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> LedgerAccountSettlement: + """ + Get details on a single ledger account settlement. + + 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_settlements/{id}", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=LedgerAccountSettlement, + ) + + async def update( + self, + id: str, + *, + description: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + status: Literal["posted", "archived"] | 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerAccountSettlement: + """ + Update the details of a ledger account settlement. + + Args: + description: The description of the ledger account settlement. + + metadata: Additional data represented as key-value pairs. Both the key and value must be + strings. + + status: To post a pending ledger account settlement, use `posted`. To archive a pending + ledger transaction, use `archived`. + + 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_settlements/{id}", + body=maybe_transform( + { + "description": description, + "metadata": metadata, + "status": status, + }, + ledger_account_settlement_update_params.LedgerAccountSettlementUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerAccountSettlement, + ) + + def list( + self, + *, + id: List[str] | NotGiven = NOT_GIVEN, + after_cursor: Optional[str] | NotGiven = NOT_GIVEN, + metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + per_page: int | NotGiven = NOT_GIVEN, + settled_ledger_account_id: str | NotGiven = NOT_GIVEN, + settlement_entry_direction: 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + ) -> AsyncPaginator[LedgerAccountSettlement, AsyncPage[LedgerAccountSettlement]]: + """ + Get a list of ledger account settlements. + + 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`. + + 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_settlements", + page=AsyncPage[LedgerAccountSettlement], + 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, + "metadata": metadata, + "per_page": per_page, + "settled_ledger_account_id": settled_ledger_account_id, + "settlement_entry_direction": settlement_entry_direction, + }, + ledger_account_settlement_list_params.LedgerAccountSettlementListParams, + ), + ), + model=LedgerAccountSettlement, + ) + + +class LedgerAccountSettlementsWithRawResponse: + def __init__(self, ledger_account_settlements: LedgerAccountSettlements) -> None: + self.create = to_raw_response_wrapper( + ledger_account_settlements.create, + ) + self.retrieve = to_raw_response_wrapper( + ledger_account_settlements.retrieve, + ) + self.update = to_raw_response_wrapper( + ledger_account_settlements.update, + ) + self.list = to_raw_response_wrapper( + ledger_account_settlements.list, + ) + + +class AsyncLedgerAccountSettlementsWithRawResponse: + def __init__(self, ledger_account_settlements: AsyncLedgerAccountSettlements) -> None: + self.create = async_to_raw_response_wrapper( + ledger_account_settlements.create, + ) + self.retrieve = async_to_raw_response_wrapper( + ledger_account_settlements.retrieve, + ) + self.update = async_to_raw_response_wrapper( + ledger_account_settlements.update, + ) + self.list = async_to_raw_response_wrapper( + ledger_account_settlements.list, + ) diff --git a/src/modern_treasury/resources/ledger_entries.py b/src/modern_treasury/resources/ledger_entries.py index 6e4c0967..2af7ed73 100644 --- a/src/modern_treasury/resources/ledger_entries.py +++ b/src/modern_treasury/resources/ledger_entries.py @@ -8,7 +8,12 @@ import httpx -from ..types import LedgerEntry, ledger_entry_list_params, ledger_entry_retrieve_params +from ..types import ( + LedgerEntry, + ledger_entry_list_params, + ledger_entry_update_params, + ledger_entry_retrieve_params, +) from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform from .._resource import SyncAPIResource, AsyncAPIResource @@ -71,6 +76,49 @@ def retrieve( cast_to=LedgerEntry, ) + def update( + self, + id: str, + *, + 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerEntry: + """ + Update the details of a ledger entry. + + Args: + 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_entries/{id}", + body=maybe_transform({"metadata": metadata}, ledger_entry_update_params.LedgerEntryUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerEntry, + ) + def list( self, *, @@ -84,6 +132,7 @@ def list( ledger_account_id: str | NotGiven = NOT_GIVEN, ledger_account_lock_version: Dict[str, int] | NotGiven = NOT_GIVEN, ledger_account_payout_id: str | NotGiven = NOT_GIVEN, + ledger_account_settlement_id: str | NotGiven = NOT_GIVEN, ledger_account_statement_id: str | NotGiven = NOT_GIVEN, ledger_transaction_id: str | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -180,6 +229,7 @@ def list( "ledger_account_id": ledger_account_id, "ledger_account_lock_version": ledger_account_lock_version, "ledger_account_payout_id": ledger_account_payout_id, + "ledger_account_settlement_id": ledger_account_settlement_id, "ledger_account_statement_id": ledger_account_statement_id, "ledger_transaction_id": ledger_transaction_id, "metadata": metadata, @@ -245,6 +295,49 @@ async def retrieve( cast_to=LedgerEntry, ) + async def update( + self, + id: str, + *, + 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 | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> LedgerEntry: + """ + Update the details of a ledger entry. + + Args: + 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_entries/{id}", + body=maybe_transform({"metadata": metadata}, ledger_entry_update_params.LedgerEntryUpdateParams), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=LedgerEntry, + ) + def list( self, *, @@ -258,6 +351,7 @@ def list( ledger_account_id: str | NotGiven = NOT_GIVEN, ledger_account_lock_version: Dict[str, int] | NotGiven = NOT_GIVEN, ledger_account_payout_id: str | NotGiven = NOT_GIVEN, + ledger_account_settlement_id: str | NotGiven = NOT_GIVEN, ledger_account_statement_id: str | NotGiven = NOT_GIVEN, ledger_transaction_id: str | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -354,6 +448,7 @@ def list( "ledger_account_id": ledger_account_id, "ledger_account_lock_version": ledger_account_lock_version, "ledger_account_payout_id": ledger_account_payout_id, + "ledger_account_settlement_id": ledger_account_settlement_id, "ledger_account_statement_id": ledger_account_statement_id, "ledger_transaction_id": ledger_transaction_id, "metadata": metadata, @@ -376,6 +471,9 @@ def __init__(self, ledger_entries: LedgerEntries) -> None: self.retrieve = to_raw_response_wrapper( ledger_entries.retrieve, ) + self.update = to_raw_response_wrapper( + ledger_entries.update, + ) self.list = to_raw_response_wrapper( ledger_entries.list, ) @@ -386,6 +484,9 @@ def __init__(self, ledger_entries: AsyncLedgerEntries) -> None: self.retrieve = async_to_raw_response_wrapper( ledger_entries.retrieve, ) + self.update = async_to_raw_response_wrapper( + ledger_entries.update, + ) self.list = async_to_raw_response_wrapper( ledger_entries.list, ) diff --git a/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py b/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py index 5a1c611a..722762e7 100644 --- a/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py +++ b/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py @@ -247,6 +247,7 @@ def list( ledger_account_category_id: str | NotGiven = NOT_GIVEN, ledger_account_id: str | NotGiven = NOT_GIVEN, ledger_account_payout_id: str | NotGiven = NOT_GIVEN, + ledger_account_settlement_id: str | NotGiven = NOT_GIVEN, ledger_id: str | NotGiven = NOT_GIVEN, ledgerable_id: str | NotGiven = NOT_GIVEN, ledgerable_type: Literal[ @@ -333,6 +334,7 @@ def list( "ledger_account_category_id": ledger_account_category_id, "ledger_account_id": ledger_account_id, "ledger_account_payout_id": ledger_account_payout_id, + "ledger_account_settlement_id": ledger_account_settlement_id, "ledger_id": ledger_id, "ledgerable_id": ledgerable_id, "ledgerable_type": ledgerable_type, @@ -654,6 +656,7 @@ def list( ledger_account_category_id: str | NotGiven = NOT_GIVEN, ledger_account_id: str | NotGiven = NOT_GIVEN, ledger_account_payout_id: str | NotGiven = NOT_GIVEN, + ledger_account_settlement_id: str | NotGiven = NOT_GIVEN, ledger_id: str | NotGiven = NOT_GIVEN, ledgerable_id: str | NotGiven = NOT_GIVEN, ledgerable_type: Literal[ @@ -740,6 +743,7 @@ def list( "ledger_account_category_id": ledger_account_category_id, "ledger_account_id": ledger_account_id, "ledger_account_payout_id": ledger_account_payout_id, + "ledger_account_settlement_id": ledger_account_settlement_id, "ledger_id": ledger_id, "ledgerable_id": ledgerable_id, "ledgerable_type": ledgerable_type, diff --git a/src/modern_treasury/resources/payment_orders/payment_orders.py b/src/modern_treasury/resources/payment_orders/payment_orders.py index 79cc585a..e061693b 100644 --- a/src/modern_treasury/resources/payment_orders/payment_orders.py +++ b/src/modern_treasury/resources/payment_orders/payment_orders.py @@ -558,6 +558,8 @@ def list( *, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, counterparty_id: str | NotGiven = NOT_GIVEN, + created_at_end: Union[str, date] | NotGiven = NOT_GIVEN, + created_at_start: Union[str, date] | NotGiven = NOT_GIVEN, direction: TransactionDirection | NotGiven = NOT_GIVEN, effective_date_end: Union[str, date] | NotGiven = NOT_GIVEN, effective_date_start: Union[str, date] | NotGiven = NOT_GIVEN, @@ -595,9 +597,11 @@ def list( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -607,6 +611,7 @@ def list( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -622,6 +627,10 @@ def list( Get a list of all payment orders Args: + created_at_end: An inclusive upper bound for searching created_at + + created_at_start: An inclusive lower bound for searching created_at + effective_date_end: An inclusive upper bound for searching effective_date effective_date_start: An inclusive lower bound for searching effective_date @@ -658,6 +667,8 @@ def list( { "after_cursor": after_cursor, "counterparty_id": counterparty_id, + "created_at_end": created_at_end, + "created_at_start": created_at_start, "direction": direction, "effective_date_end": effective_date_end, "effective_date_start": effective_date_start, @@ -1423,6 +1434,8 @@ def list( *, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, counterparty_id: str | NotGiven = NOT_GIVEN, + created_at_end: Union[str, date] | NotGiven = NOT_GIVEN, + created_at_start: Union[str, date] | NotGiven = NOT_GIVEN, direction: TransactionDirection | NotGiven = NOT_GIVEN, effective_date_end: Union[str, date] | NotGiven = NOT_GIVEN, effective_date_start: Union[str, date] | NotGiven = NOT_GIVEN, @@ -1460,9 +1473,11 @@ def list( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -1472,6 +1487,7 @@ def list( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -1487,6 +1503,10 @@ def list( Get a list of all payment orders Args: + created_at_end: An inclusive upper bound for searching created_at + + created_at_start: An inclusive lower bound for searching created_at + effective_date_end: An inclusive upper bound for searching effective_date effective_date_start: An inclusive lower bound for searching effective_date @@ -1523,6 +1543,8 @@ def list( { "after_cursor": after_cursor, "counterparty_id": counterparty_id, + "created_at_end": created_at_end, + "created_at_start": created_at_start, "direction": direction, "effective_date_end": effective_date_end, "effective_date_start": effective_date_start, diff --git a/src/modern_treasury/resources/routing_details.py b/src/modern_treasury/resources/routing_details.py index 08323de2..cca64ac1 100644 --- a/src/modern_treasury/resources/routing_details.py +++ b/src/modern_treasury/resources/routing_details.py @@ -50,10 +50,12 @@ def create( "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], @@ -72,9 +74,11 @@ def create( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -84,6 +88,7 @@ def create( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -284,10 +289,12 @@ async def create( "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], @@ -306,9 +313,11 @@ async def create( "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -318,6 +327,7 @@ async def create( "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/resources/validations.py b/src/modern_treasury/resources/validations.py index ec641a74..2251fddc 100644 --- a/src/modern_treasury/resources/validations.py +++ b/src/modern_treasury/resources/validations.py @@ -45,10 +45,12 @@ def validate_routing_number( "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], @@ -120,10 +122,12 @@ async def validate_routing_number( "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], diff --git a/src/modern_treasury/types/__init__.py b/src/modern_treasury/types/__init__.py index 27e76a86..3dab7d3a 100644 --- a/src/modern_treasury/types/__init__.py +++ b/src/modern_treasury/types/__init__.py @@ -62,6 +62,9 @@ from .counterparty_list_params import CounterpartyListParams as CounterpartyListParams from .ledger_entry_list_params import LedgerEntryListParams as LedgerEntryListParams from .payment_flow_list_params import PaymentFlowListParams as PaymentFlowListParams +from .ledger_account_settlement import ( + LedgerAccountSettlement as LedgerAccountSettlement, +) from .payment_order_list_params import PaymentOrderListParams as PaymentOrderListParams from .transaction_create_params import ( TransactionCreateParams as TransactionCreateParams, @@ -84,6 +87,9 @@ from .ledger_account_list_params import ( LedgerAccountListParams as LedgerAccountListParams, ) +from .ledger_entry_update_params import ( + LedgerEntryUpdateParams as LedgerEntryUpdateParams, +) from .payment_flow_create_params import ( PaymentFlowCreateParams as PaymentFlowCreateParams, ) @@ -231,12 +237,21 @@ from .ledger_account_category_update_params import ( LedgerAccountCategoryUpdateParams as LedgerAccountCategoryUpdateParams, ) +from .ledger_account_settlement_list_params import ( + LedgerAccountSettlementListParams as LedgerAccountSettlementListParams, +) from .ledger_account_statement_create_params import ( LedgerAccountStatementCreateParams as LedgerAccountStatementCreateParams, ) from .ledger_account_category_retrieve_params import ( LedgerAccountCategoryRetrieveParams as LedgerAccountCategoryRetrieveParams, ) +from .ledger_account_settlement_create_params import ( + LedgerAccountSettlementCreateParams as LedgerAccountSettlementCreateParams, +) +from .ledger_account_settlement_update_params import ( + LedgerAccountSettlementUpdateParams as LedgerAccountSettlementUpdateParams, +) from .ledger_account_statement_create_response import ( LedgerAccountStatementCreateResponse as LedgerAccountStatementCreateResponse, ) diff --git a/src/modern_treasury/types/account_detail.py b/src/modern_treasury/types/account_detail.py index 97cc82f4..bf5121ad 100644 --- a/src/modern_treasury/types/account_detail.py +++ b/src/modern_treasury/types/account_detail.py @@ -15,7 +15,7 @@ class AccountDetail(BaseModel): account_number_safe: str """The last 4 digits of the account_number.""" - account_number_type: Literal["clabe", "iban", "other", "pan", "wallet_address"] + account_number_type: Literal["clabe", "hk_number", "iban", "other", "pan", "wallet_address"] """One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank account number is in a generic format. diff --git a/src/modern_treasury/types/account_detail_create_params.py b/src/modern_treasury/types/account_detail_create_params.py index d4d245e2..e8248b27 100644 --- a/src/modern_treasury/types/account_detail_create_params.py +++ b/src/modern_treasury/types/account_detail_create_params.py @@ -13,7 +13,7 @@ class AccountDetailCreateParams(TypedDict, total=False): account_number: Required[str] """The account number for the bank account.""" - account_number_type: Literal["clabe", "iban", "other", "pan", "wallet_address"] + account_number_type: Literal["clabe", "hk_number", "iban", "other", "pan", "wallet_address"] """One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank account number is in a generic format. diff --git a/src/modern_treasury/types/bulk_request_create_params.py b/src/modern_treasury/types/bulk_request_create_params.py index 8f2e5a65..95aa7856 100644 --- a/src/modern_treasury/types/bulk_request_create_params.py +++ b/src/modern_treasury/types/bulk_request_create_params.py @@ -288,7 +288,7 @@ class ResourcePaymentOrderAsyncCreateRequestLineItem(TypedDict, total=False): class ResourcePaymentOrderAsyncCreateRequestReceivingAccountAccountDetail(TypedDict, total=False): account_number: Required[str] - account_number_type: Literal["iban", "clabe", "wallet_address", "pan", "other"] + account_number_type: Literal["iban", "hk_number", "clabe", "wallet_address", "pan", "other"] ResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetails = ( @@ -405,10 +405,12 @@ class ResourcePaymentOrderAsyncCreateRequestReceivingAccountRoutingDetail(TypedD "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -428,9 +430,11 @@ class ResourcePaymentOrderAsyncCreateRequestReceivingAccountRoutingDetail(TypedD "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -440,6 +444,7 @@ class ResourcePaymentOrderAsyncCreateRequestReceivingAccountRoutingDetail(TypedD "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -1034,7 +1039,7 @@ class ResourcePaymentOrderUpdateRequestWithIDLineItem(TypedDict, total=False): class ResourcePaymentOrderUpdateRequestWithIDReceivingAccountAccountDetail(TypedDict, total=False): account_number: Required[str] - account_number_type: Literal["iban", "clabe", "wallet_address", "pan", "other"] + account_number_type: Literal["iban", "hk_number", "clabe", "wallet_address", "pan", "other"] ResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetails = ( @@ -1151,10 +1156,12 @@ class ResourcePaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetail(Typed "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -1174,9 +1181,11 @@ class ResourcePaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetail(Typed "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -1186,6 +1195,7 @@ class ResourcePaymentOrderUpdateRequestWithIDReceivingAccountRoutingDetail(Typed "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/counterparty_collect_account_params.py b/src/modern_treasury/types/counterparty_collect_account_params.py index 39025dcb..82768f4d 100644 --- a/src/modern_treasury/types/counterparty_collect_account_params.py +++ b/src/modern_treasury/types/counterparty_collect_account_params.py @@ -52,6 +52,10 @@ class CounterpartyCollectAccountParams(TypedDict, total=False): "jp_zengin_code", "se_bankgiro_clearing_code", "nz_national_clearing_code", + "hk_interbank_clearing_code", + "hu_interbank_clearing_code", + "dk_interbank_clearing_code", + "id_sknbi_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 cb836bdf..7d040d1d 100644 --- a/src/modern_treasury/types/counterparty_create_params.py +++ b/src/modern_treasury/types/counterparty_create_params.py @@ -74,7 +74,7 @@ class Accounting(TypedDict, total=False): class AccountAccountDetail(TypedDict, total=False): account_number: Required[str] - account_number_type: Literal["iban", "clabe", "wallet_address", "pan", "other"] + account_number_type: Literal["iban", "hk_number", "clabe", "wallet_address", "pan", "other"] AccountsAccountDetails = AccountAccountDetail @@ -183,10 +183,12 @@ class AccountRoutingDetail(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -206,9 +208,11 @@ class AccountRoutingDetail(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -218,6 +222,7 @@ class AccountRoutingDetail(TypedDict, total=False): "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/expected_payment_list_params.py b/src/modern_treasury/types/expected_payment_list_params.py index e4643de6..19fc8962 100644 --- a/src/modern_treasury/types/expected_payment_list_params.py +++ b/src/modern_treasury/types/expected_payment_list_params.py @@ -56,9 +56,11 @@ class ExpectedPaymentListParams(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -68,6 +70,7 @@ class ExpectedPaymentListParams(TypedDict, total=False): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/expected_payment_type.py b/src/modern_treasury/types/expected_payment_type.py index c55368b4..471d2973 100644 --- a/src/modern_treasury/types/expected_payment_type.py +++ b/src/modern_treasury/types/expected_payment_type.py @@ -20,9 +20,11 @@ "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -32,6 +34,7 @@ "sg_giro", "sic", "signet", + "sknbi", "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 5b3e6f76..e41a2bb1 100644 --- a/src/modern_treasury/types/external_account_create_params.py +++ b/src/modern_treasury/types/external_account_create_params.py @@ -78,7 +78,7 @@ class ExternalAccountCreateParams(TypedDict, total=False): class AccountDetail(TypedDict, total=False): account_number: Required[str] - account_number_type: Literal["iban", "clabe", "wallet_address", "pan", "other"] + account_number_type: Literal["iban", "hk_number", "clabe", "wallet_address", "pan", "other"] AccountDetails = AccountDetail @@ -173,10 +173,12 @@ class RoutingDetail(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -196,9 +198,11 @@ class RoutingDetail(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -208,6 +212,7 @@ class RoutingDetail(TypedDict, total=False): "sepa", "sic", "signet", + "sknbi", "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 5673a7e3..a69a6843 100644 --- a/src/modern_treasury/types/external_account_verify_params.py +++ b/src/modern_treasury/types/external_account_verify_params.py @@ -32,9 +32,11 @@ class ExternalAccountVerifyParams(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -44,6 +46,7 @@ class ExternalAccountVerifyParams(TypedDict, total=False): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/incoming_payment_detail.py b/src/modern_treasury/types/incoming_payment_detail.py index 0321cf10..55487409 100644 --- a/src/modern_treasury/types/incoming_payment_detail.py +++ b/src/modern_treasury/types/incoming_payment_detail.py @@ -67,7 +67,7 @@ class IncomingPaymentDetail(BaseModel): detail. """ - originating_account_number_type: Optional[Literal["clabe", "iban", "other", "pan", "wallet_address"]] + originating_account_number_type: Optional[Literal["clabe", "hk_number", "iban", "other", "pan", "wallet_address"]] """The type of the originating account number for the incoming payment detail.""" originating_routing_number: Optional[str] @@ -85,10 +85,12 @@ class IncomingPaymentDetail(BaseModel): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_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 9ad1fefc..92536329 100644 --- a/src/modern_treasury/types/internal_account_list_params.py +++ b/src/modern_treasury/types/internal_account_list_params.py @@ -43,9 +43,11 @@ class InternalAccountListParams(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -55,6 +57,7 @@ class InternalAccountListParams(TypedDict, total=False): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/invoice.py b/src/modern_treasury/types/invoice.py index d120beaa..dbd2b343 100644 --- a/src/modern_treasury/types/invoice.py +++ b/src/modern_treasury/types/invoice.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Optional +from typing import Dict, List, Optional from datetime import date, datetime from typing_extensions import Literal @@ -145,6 +145,12 @@ class Invoice(BaseModel): expected_payments: List[ExpectedPayment] """The expected payments created for an unpaid invoice.""" + fallback_payment_method: Optional[str] + """ + When payment_method is automatic, the fallback payment method to use when an + automatic payment fails. One of `manual` or `ui`. + """ + hosted_url: str """The URL of the hosted web UI where the invoice can be viewed.""" @@ -157,6 +163,12 @@ class Invoice(BaseModel): 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. + """ + notification_email_addresses: Optional[List[str]] """ Emails in addition to the counterparty email to send invoice status diff --git a/src/modern_treasury/types/invoice_create_params.py b/src/modern_treasury/types/invoice_create_params.py index 5639b45a..41f00096 100644 --- a/src/modern_treasury/types/invoice_create_params.py +++ b/src/modern_treasury/types/invoice_create_params.py @@ -44,6 +44,12 @@ class InvoiceCreateParams(TypedDict, total=False): description: str """A free-form description of the invoice.""" + fallback_payment_method: Optional[str] + """ + When payment_method is automatic, the fallback payment method to use when an + automatic payment fails. One of `manual` or `ui`. + """ + invoicer_address: Optional[InvoicerAddress] """The invoice issuer's business address.""" @@ -92,9 +98,11 @@ class InvoiceCreateParams(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -104,6 +112,7 @@ class InvoiceCreateParams(TypedDict, total=False): "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/invoice_update_params.py b/src/modern_treasury/types/invoice_update_params.py index 52b2f9c4..f821f4e6 100644 --- a/src/modern_treasury/types/invoice_update_params.py +++ b/src/modern_treasury/types/invoice_update_params.py @@ -41,6 +41,12 @@ class InvoiceUpdateParams(TypedDict, total=False): due_date: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """A future date by when the invoice needs to be paid.""" + fallback_payment_method: Optional[str] + """ + When payment_method is automatic, the fallback payment method to use when an + automatic payment fails. One of `manual` or `ui`. + """ + invoicer_address: Optional[InvoicerAddress] """The invoice issuer's business address.""" @@ -92,9 +98,11 @@ class InvoiceUpdateParams(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -104,6 +112,7 @@ class InvoiceUpdateParams(TypedDict, total=False): "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/ledger_account_settlement.py b/src/modern_treasury/types/ledger_account_settlement.py new file mode 100644 index 00000000..7c59538d --- /dev/null +++ b/src/modern_treasury/types/ledger_account_settlement.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. + +from typing import Dict, Optional +from datetime import datetime +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["LedgerAccountSettlement"] + + +class LedgerAccountSettlement(BaseModel): + id: str + + amount: Optional[int] + """The amount of the ledger account settlement.""" + + contra_ledger_account_id: str + """ + The id of the contra ledger account that sends to or receives funds from the + settled ledger account. + """ + + created_at: datetime + + currency: str + """The currency of the ledger account settlement.""" + + currency_exponent: Optional[int] + """The currency exponent of the ledger account settlement.""" + + description: Optional[str] + """The description of the ledger account settlement.""" + + effective_at_upper_bound: datetime + """ + The exclusive upper bound of the effective_at timestamp of the ledger entries to + be included in the ledger account settlement. The default value is the + created_at timestamp of the ledger account settlement. + """ + + ledger_id: str + """The id of the ledger that this ledger account settlement belongs to.""" + + ledger_transaction_id: Optional[str] + """The id of the ledger transaction that this settlement is associated with.""" + + 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 + + settled_ledger_account_id: str + """ + The id of the settled ledger account whose ledger entries are queried against, + and its balance is reduced as a result. + """ + + settlement_entry_direction: Optional[str] + """The direction of the ledger entry with the settlement_ledger_account.""" + + status: Literal["archived", "archiving", "pending", "posted", "processing", "reversed", "reversing"] + """The status of the ledger account settlement. + + One of `processing`, `pending`, `posted`, `archiving` or `archived`. + """ + + updated_at: datetime diff --git a/src/modern_treasury/types/ledger_account_settlement_create_params.py b/src/modern_treasury/types/ledger_account_settlement_create_params.py new file mode 100644 index 00000000..72ce24db --- /dev/null +++ b/src/modern_treasury/types/ledger_account_settlement_create_params.py @@ -0,0 +1,61 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict, Union, Optional +from datetime import datetime +from typing_extensions import Literal, Required, Annotated, TypedDict + +from .._utils import PropertyInfo + +__all__ = ["LedgerAccountSettlementCreateParams"] + + +class LedgerAccountSettlementCreateParams(TypedDict, total=False): + contra_ledger_account_id: Required[str] + """ + The id of the contra ledger account that sends to or receives funds from the + settled ledger account. + """ + + settled_ledger_account_id: Required[str] + """ + The id of the settled ledger account whose ledger entries are queried against, + and its balance is reduced as a result. + """ + + allow_either_direction: Optional[bool] + """ + If true, the settlement amount and settlement_entry_direction will bring the + settlement ledger account's balance closer to zero, even if the balance is + negative. + """ + + description: Optional[str] + """The description of the ledger account settlement.""" + + effective_at_upper_bound: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")] + """ + The exclusive upper bound of the effective_at timestamp of the ledger entries to + be included in the ledger account settlement. The default value is the + created_at timestamp of the ledger account settlement. + """ + + metadata: Dict[str, str] + """Additional data represented as key-value pairs. + + Both the key and value must be strings. + """ + + skip_settlement_ledger_transaction: Optional[bool] + """It is set to `false` by default. + + It should be set to `true` when migrating existing settlements. + """ + + status: Optional[Literal["pending", "posted"]] + """The status of the ledger account settlement. + + It is set to `pending` by default. To post a ledger account settlement at + creation, use `posted`. + """ diff --git a/src/modern_treasury/types/ledger_account_settlement_list_params.py b/src/modern_treasury/types/ledger_account_settlement_list_params.py new file mode 100644 index 00000000..2ffa1cb5 --- /dev/null +++ b/src/modern_treasury/types/ledger_account_settlement_list_params.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict, List, Optional +from typing_extensions import TypedDict + +__all__ = ["LedgerAccountSettlementListParams"] + + +class LedgerAccountSettlementListParams(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] + + 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 + + settled_ledger_account_id: str + + settlement_entry_direction: str diff --git a/src/modern_treasury/types/ledger_account_settlement_update_params.py b/src/modern_treasury/types/ledger_account_settlement_update_params.py new file mode 100644 index 00000000..48a50578 --- /dev/null +++ b/src/modern_treasury/types/ledger_account_settlement_update_params.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict, Optional +from typing_extensions import Literal, TypedDict + +__all__ = ["LedgerAccountSettlementUpdateParams"] + + +class LedgerAccountSettlementUpdateParams(TypedDict, total=False): + description: Optional[str] + """The description of the ledger account settlement.""" + + metadata: Dict[str, str] + """Additional data represented as key-value pairs. + + Both the key and value must be strings. + """ + + status: Literal["posted", "archived"] + """To post a pending ledger account settlement, use `posted`. + + To archive a pending ledger transaction, use `archived`. + """ diff --git a/src/modern_treasury/types/ledger_entry_list_params.py b/src/modern_treasury/types/ledger_entry_list_params.py index ce93a55a..9fcb6f34 100644 --- a/src/modern_treasury/types/ledger_entry_list_params.py +++ b/src/modern_treasury/types/ledger_entry_list_params.py @@ -63,6 +63,8 @@ class LedgerEntryListParams(TypedDict, total=False): ledger_account_payout_id: str + ledger_account_settlement_id: str + ledger_account_statement_id: str """Get all ledger entries that are included in the ledger account statement.""" diff --git a/src/modern_treasury/types/ledger_entry_update_params.py b/src/modern_treasury/types/ledger_entry_update_params.py new file mode 100644 index 00000000..bb2dff5c --- /dev/null +++ b/src/modern_treasury/types/ledger_entry_update_params.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import TypedDict + +__all__ = ["LedgerEntryUpdateParams"] + + +class LedgerEntryUpdateParams(TypedDict, total=False): + 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_transaction_list_params.py b/src/modern_treasury/types/ledger_transaction_list_params.py index 3339b9f9..21ce92ea 100644 --- a/src/modern_treasury/types/ledger_transaction_list_params.py +++ b/src/modern_treasury/types/ledger_transaction_list_params.py @@ -40,6 +40,8 @@ class LedgerTransactionListParams(TypedDict, total=False): ledger_account_payout_id: str + ledger_account_settlement_id: str + ledger_id: str ledgerable_id: 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 ac225298..5dc80c39 100644 --- a/src/modern_treasury/types/payment_order_create_async_params.py +++ b/src/modern_treasury/types/payment_order_create_async_params.py @@ -416,7 +416,7 @@ class LineItem(TypedDict, total=False): class ReceivingAccountAccountDetail(TypedDict, total=False): account_number: Required[str] - account_number_type: Literal["iban", "clabe", "wallet_address", "pan", "other"] + account_number_type: Literal["iban", "hk_number", "clabe", "wallet_address", "pan", "other"] ReceivingAccountAccountDetails = ReceivingAccountAccountDetail @@ -511,10 +511,12 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -534,9 +536,11 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -546,6 +550,7 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "sepa", "sic", "signet", + "sknbi", "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 1863982e..7a2e5763 100644 --- a/src/modern_treasury/types/payment_order_create_params.py +++ b/src/modern_treasury/types/payment_order_create_params.py @@ -460,7 +460,7 @@ class LineItem(TypedDict, total=False): class ReceivingAccountAccountDetail(TypedDict, total=False): account_number: Required[str] - account_number_type: Literal["iban", "clabe", "wallet_address", "pan", "other"] + account_number_type: Literal["iban", "hk_number", "clabe", "wallet_address", "pan", "other"] ReceivingAccountAccountDetails = ReceivingAccountAccountDetail @@ -555,10 +555,12 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -578,9 +580,11 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -590,6 +594,7 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "sepa", "sic", "signet", + "sknbi", "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 2a15dd98..6b3a031b 100644 --- a/src/modern_treasury/types/payment_order_list_params.py +++ b/src/modern_treasury/types/payment_order_list_params.py @@ -17,6 +17,12 @@ class PaymentOrderListParams(TypedDict, total=False): counterparty_id: str + created_at_end: Annotated[Union[str, date], PropertyInfo(format="iso8601")] + """An inclusive upper bound for searching created_at""" + + created_at_start: Annotated[Union[str, date], PropertyInfo(format="iso8601")] + """An inclusive lower bound for searching created_at""" + direction: TransactionDirection effective_date_end: Annotated[Union[str, date], PropertyInfo(format="iso8601")] @@ -78,9 +84,11 @@ class PaymentOrderListParams(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -90,6 +98,7 @@ class PaymentOrderListParams(TypedDict, total=False): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/payment_order_type.py b/src/modern_treasury/types/payment_order_type.py index 5232deaa..8eb6afd4 100644 --- a/src/modern_treasury/types/payment_order_type.py +++ b/src/modern_treasury/types/payment_order_type.py @@ -18,9 +18,11 @@ "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -30,6 +32,7 @@ "sg_giro", "sic", "signet", + "sknbi", "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 7024e189..23e0027d 100644 --- a/src/modern_treasury/types/payment_order_update_params.py +++ b/src/modern_treasury/types/payment_order_update_params.py @@ -302,7 +302,7 @@ class LineItem(TypedDict, total=False): class ReceivingAccountAccountDetail(TypedDict, total=False): account_number: Required[str] - account_number_type: Literal["iban", "clabe", "wallet_address", "pan", "other"] + account_number_type: Literal["iban", "hk_number", "clabe", "wallet_address", "pan", "other"] ReceivingAccountAccountDetails = ReceivingAccountAccountDetail @@ -397,10 +397,12 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -420,9 +422,11 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -432,6 +436,7 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "sepa", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/routing_detail.py b/src/modern_treasury/types/routing_detail.py index 7107fc96..1bb4b2a9 100644 --- a/src/modern_treasury/types/routing_detail.py +++ b/src/modern_treasury/types/routing_detail.py @@ -76,9 +76,11 @@ class RoutingDetail(BaseModel): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -88,6 +90,7 @@ class RoutingDetail(BaseModel): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] @@ -111,10 +114,12 @@ class RoutingDetail(BaseModel): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] diff --git a/src/modern_treasury/types/routing_detail_create_params.py b/src/modern_treasury/types/routing_detail_create_params.py index 34744d78..e9a96756 100644 --- a/src/modern_treasury/types/routing_detail_create_params.py +++ b/src/modern_treasury/types/routing_detail_create_params.py @@ -26,10 +26,12 @@ class RoutingDetailCreateParams(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -55,9 +57,11 @@ class RoutingDetailCreateParams(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -67,6 +71,7 @@ class RoutingDetailCreateParams(TypedDict, total=False): "sg_giro", "sic", "signet", + "sknbi", "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 f2dcb0e5..a8a6ee56 100644 --- a/src/modern_treasury/types/routing_number_lookup_request.py +++ b/src/modern_treasury/types/routing_number_lookup_request.py @@ -78,9 +78,11 @@ class RoutingNumberLookupRequest(BaseModel): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -90,6 +92,7 @@ class RoutingNumberLookupRequest(BaseModel): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/src/modern_treasury/types/transaction.py b/src/modern_treasury/types/transaction.py index b38a0f1c..4590507f 100644 --- a/src/modern_treasury/types/transaction.py +++ b/src/modern_treasury/types/transaction.py @@ -80,9 +80,11 @@ class Transaction(BaseModel): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -92,6 +94,7 @@ class Transaction(BaseModel): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] 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 7dbd0296..b5f2a3a5 100644 --- a/src/modern_treasury/types/validation_validate_routing_number_params.py +++ b/src/modern_treasury/types/validation_validate_routing_number_params.py @@ -23,10 +23,12 @@ class ValidationValidateRoutingNumberParams(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] diff --git a/src/modern_treasury/types/virtual_account_create_params.py b/src/modern_treasury/types/virtual_account_create_params.py index c77539e2..7b33c523 100644 --- a/src/modern_treasury/types/virtual_account_create_params.py +++ b/src/modern_treasury/types/virtual_account_create_params.py @@ -52,7 +52,7 @@ class AccountDetail(TypedDict, total=False): account_number: Required[str] """The account number for the bank account.""" - account_number_type: Literal["clabe", "iban", "other", "pan", "wallet_address"] + account_number_type: Literal["clabe", "hk_number", "iban", "other", "pan", "wallet_address"] """One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank account number is in a generic format. @@ -82,10 +82,12 @@ class RoutingDetail(TypedDict, total=False): "gb_sort_code", "hk_interbank_clearing_code", "hu_interbank_clearing_code", + "id_sknbi_code", "in_ifsc", "jp_zengin_code", "my_branch_code", "nz_national_clearing_code", + "pl_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] @@ -111,9 +113,11 @@ class RoutingDetail(TypedDict, total=False): "hu_ics", "interac", "masav", + "mx_ccen", "neft", "nics", "nz_becs", + "pl_elixir", "provxchange", "ro_sent", "rtp", @@ -123,6 +127,7 @@ class RoutingDetail(TypedDict, total=False): "sg_giro", "sic", "signet", + "sknbi", "wire", "zengin", ] diff --git a/tests/api_resources/test_invoices.py b/tests/api_resources/test_invoices.py index e2dad280..bb227bc3 100644 --- a/tests/api_resources/test_invoices.py +++ b/tests/api_resources/test_invoices.py @@ -92,6 +92,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: }, currency="AED", description="string", + fallback_payment_method="string", invoicer_address={ "line1": "string", "line2": "string", @@ -202,6 +203,7 @@ def test_method_update_with_all_params(self, client: ModernTreasury) -> None: currency="AED", description="string", due_date=parse_datetime("2019-12-27T18:11:19.117Z"), + fallback_payment_method="string", invoicer_address={ "line1": "string", "line2": "string", @@ -346,6 +348,7 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) }, currency="AED", description="string", + fallback_payment_method="string", invoicer_address={ "line1": "string", "line2": "string", @@ -456,6 +459,7 @@ async def test_method_update_with_all_params(self, client: AsyncModernTreasury) currency="AED", description="string", due_date=parse_datetime("2019-12-27T18:11:19.117Z"), + fallback_payment_method="string", invoicer_address={ "line1": "string", "line2": "string", diff --git a/tests/api_resources/test_ledger_account_settlements.py b/tests/api_resources/test_ledger_account_settlements.py new file mode 100644 index 00000000..abe29d1c --- /dev/null +++ b/tests/api_resources/test_ledger_account_settlements.py @@ -0,0 +1,250 @@ +# 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 LedgerAccountSettlement +from modern_treasury._utils import parse_datetime +from modern_treasury._client import ModernTreasury, AsyncModernTreasury +from modern_treasury.pagination import SyncPage, AsyncPage + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") +api_key = "My API Key" +organization_id = "my-organization-ID" + + +class TestLedgerAccountSettlements: + strict_client = ModernTreasury( + base_url=base_url, api_key=api_key, organization_id=organization_id, _strict_response_validation=True + ) + loose_client = ModernTreasury( + base_url=base_url, api_key=api_key, organization_id=organization_id, _strict_response_validation=False + ) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + def test_method_create(self, client: ModernTreasury) -> None: + ledger_account_settlement = client.ledger_account_settlements.create( + contra_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + settled_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: ModernTreasury) -> None: + ledger_account_settlement = client.ledger_account_settlements.create( + contra_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + settled_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + allow_either_direction=True, + description="string", + effective_at_upper_bound=parse_datetime("2019-12-27T18:11:19.117Z"), + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + skip_settlement_ledger_transaction=True, + status="pending", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: ModernTreasury) -> None: + response = client.ledger_account_settlements.with_raw_response.create( + contra_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + settled_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_method_retrieve(self, client: ModernTreasury) -> None: + ledger_account_settlement = client.ledger_account_settlements.retrieve( + "string", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_raw_response_retrieve(self, client: ModernTreasury) -> None: + response = client.ledger_account_settlements.with_raw_response.retrieve( + "string", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_method_update(self, client: ModernTreasury) -> None: + ledger_account_settlement = client.ledger_account_settlements.update( + "string", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: ModernTreasury) -> None: + ledger_account_settlement = client.ledger_account_settlements.update( + "string", + description="string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + status="posted", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: ModernTreasury) -> None: + response = client.ledger_account_settlements.with_raw_response.update( + "string", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + def test_method_list(self, client: ModernTreasury) -> None: + ledger_account_settlement = client.ledger_account_settlements.list() + assert_matches_type(SyncPage[LedgerAccountSettlement], ledger_account_settlement, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: ModernTreasury) -> None: + ledger_account_settlement = client.ledger_account_settlements.list( + id=["string", "string", "string"], + after_cursor="string", + metadata={"foo": "string"}, + per_page=0, + settled_ledger_account_id="string", + settlement_entry_direction="string", + ) + assert_matches_type(SyncPage[LedgerAccountSettlement], ledger_account_settlement, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: ModernTreasury) -> None: + response = client.ledger_account_settlements.with_raw_response.list() + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(SyncPage[LedgerAccountSettlement], ledger_account_settlement, path=["response"]) + + +class TestAsyncLedgerAccountSettlements: + strict_client = AsyncModernTreasury( + base_url=base_url, api_key=api_key, organization_id=organization_id, _strict_response_validation=True + ) + loose_client = AsyncModernTreasury( + base_url=base_url, api_key=api_key, organization_id=organization_id, _strict_response_validation=False + ) + parametrize = pytest.mark.parametrize("client", [strict_client, loose_client], ids=["strict", "loose"]) + + @parametrize + async def test_method_create(self, client: AsyncModernTreasury) -> None: + ledger_account_settlement = await client.ledger_account_settlements.create( + contra_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + settled_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: + ledger_account_settlement = await client.ledger_account_settlements.create( + contra_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + settled_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + allow_either_direction=True, + description="string", + effective_at_upper_bound=parse_datetime("2019-12-27T18:11:19.117Z"), + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + skip_settlement_ledger_transaction=True, + status="pending", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_raw_response_create(self, client: AsyncModernTreasury) -> None: + response = await client.ledger_account_settlements.with_raw_response.create( + contra_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + settled_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: + ledger_account_settlement = await client.ledger_account_settlements.retrieve( + "string", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_raw_response_retrieve(self, client: AsyncModernTreasury) -> None: + response = await client.ledger_account_settlements.with_raw_response.retrieve( + "string", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_method_update(self, client: AsyncModernTreasury) -> None: + ledger_account_settlement = await client.ledger_account_settlements.update( + "string", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, client: AsyncModernTreasury) -> None: + ledger_account_settlement = await client.ledger_account_settlements.update( + "string", + description="string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + status="posted", + ) + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_raw_response_update(self, client: AsyncModernTreasury) -> None: + response = await client.ledger_account_settlements.with_raw_response.update( + "string", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(LedgerAccountSettlement, ledger_account_settlement, path=["response"]) + + @parametrize + async def test_method_list(self, client: AsyncModernTreasury) -> None: + ledger_account_settlement = await client.ledger_account_settlements.list() + assert_matches_type(AsyncPage[LedgerAccountSettlement], ledger_account_settlement, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> None: + ledger_account_settlement = await client.ledger_account_settlements.list( + id=["string", "string", "string"], + after_cursor="string", + metadata={"foo": "string"}, + per_page=0, + settled_ledger_account_id="string", + settlement_entry_direction="string", + ) + assert_matches_type(AsyncPage[LedgerAccountSettlement], ledger_account_settlement, path=["response"]) + + @parametrize + async def test_raw_response_list(self, client: AsyncModernTreasury) -> None: + response = await client.ledger_account_settlements.with_raw_response.list() + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_account_settlement = response.parse() + assert_matches_type(AsyncPage[LedgerAccountSettlement], ledger_account_settlement, path=["response"]) diff --git a/tests/api_resources/test_ledger_entries.py b/tests/api_resources/test_ledger_entries.py index 5b8f7aed..4a84a608 100644 --- a/tests/api_resources/test_ledger_entries.py +++ b/tests/api_resources/test_ledger_entries.py @@ -51,6 +51,34 @@ def test_raw_response_retrieve(self, client: ModernTreasury) -> None: ledger_entry = response.parse() assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + @parametrize + def test_method_update(self, client: ModernTreasury) -> None: + ledger_entry = client.ledger_entries.update( + "string", + ) + assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: ModernTreasury) -> None: + ledger_entry = client.ledger_entries.update( + "string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + ) + assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: ModernTreasury) -> None: + response = client.ledger_entries.with_raw_response.update( + "string", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_entry = response.parse() + assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + @parametrize def test_method_list(self, client: ModernTreasury) -> None: ledger_entry = client.ledger_entries.list() @@ -69,6 +97,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: ledger_account_id="string", ledger_account_lock_version={"foo": 0}, ledger_account_payout_id="string", + ledger_account_settlement_id="string", ledger_account_statement_id="string", ledger_transaction_id="string", metadata={"foo": "string"}, @@ -125,6 +154,34 @@ async def test_raw_response_retrieve(self, client: AsyncModernTreasury) -> None: ledger_entry = response.parse() assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + @parametrize + async def test_method_update(self, client: AsyncModernTreasury) -> None: + ledger_entry = await client.ledger_entries.update( + "string", + ) + assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, client: AsyncModernTreasury) -> None: + ledger_entry = await client.ledger_entries.update( + "string", + metadata={ + "key": "value", + "foo": "bar", + "modern": "treasury", + }, + ) + assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + + @parametrize + async def test_raw_response_update(self, client: AsyncModernTreasury) -> None: + response = await client.ledger_entries.with_raw_response.update( + "string", + ) + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ledger_entry = response.parse() + assert_matches_type(LedgerEntry, ledger_entry, path=["response"]) + @parametrize async def test_method_list(self, client: AsyncModernTreasury) -> None: ledger_entry = await client.ledger_entries.list() @@ -143,6 +200,7 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> ledger_account_id="string", ledger_account_lock_version={"foo": 0}, ledger_account_payout_id="string", + ledger_account_settlement_id="string", ledger_account_statement_id="string", ledger_transaction_id="string", metadata={"foo": "string"}, diff --git a/tests/api_resources/test_ledger_transactions.py b/tests/api_resources/test_ledger_transactions.py index 78007901..c4fc6d5b 100644 --- a/tests/api_resources/test_ledger_transactions.py +++ b/tests/api_resources/test_ledger_transactions.py @@ -250,6 +250,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: ledger_account_category_id="string", ledger_account_id="string", ledger_account_payout_id="string", + ledger_account_settlement_id="string", ledger_id="string", ledgerable_id="string", ledgerable_type="counterparty", @@ -540,6 +541,7 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> ledger_account_category_id="string", ledger_account_id="string", ledger_account_payout_id="string", + ledger_account_settlement_id="string", ledger_id="string", ledgerable_id="string", ledgerable_type="counterparty", diff --git a/tests/api_resources/test_payment_orders.py b/tests/api_resources/test_payment_orders.py index 9713a13f..45f6de91 100644 --- a/tests/api_resources/test_payment_orders.py +++ b/tests/api_resources/test_payment_orders.py @@ -491,6 +491,8 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: payment_order = client.payment_orders.list( after_cursor="string", counterparty_id="string", + created_at_end=parse_date("2019-12-27"), + created_at_start=parse_date("2019-12-27"), direction="credit", effective_date_end=parse_date("2019-12-27"), effective_date_start=parse_date("2019-12-27"), @@ -1225,6 +1227,8 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> payment_order = await client.payment_orders.list( after_cursor="string", counterparty_id="string", + created_at_end=parse_date("2019-12-27"), + created_at_start=parse_date("2019-12-27"), direction="credit", effective_date_end=parse_date("2019-12-27"), effective_date_start=parse_date("2019-12-27"),