diff --git a/api.md b/api.md index cca6c14b..2032d5dc 100644 --- a/api.md +++ b/api.md @@ -361,20 +361,15 @@ Methods: Types: ```python -from modern_treasury.types import ( - LedgerEventHandlerCreateResponse, - LedgerEventHandlerRetrieveResponse, - LedgerEventHandlerListResponse, - LedgerEventHandlerDeleteResponse, -) +from modern_treasury.types import LedgerEventHandler, LedgerEventHandlerVariable ``` Methods: -- client.ledger_event_handlers.create(\*\*params) -> LedgerEventHandlerCreateResponse -- client.ledger_event_handlers.retrieve(id) -> LedgerEventHandlerRetrieveResponse -- client.ledger_event_handlers.list(\*\*params) -> SyncPage[LedgerEventHandlerListResponse] -- client.ledger_event_handlers.delete(id) -> LedgerEventHandlerDeleteResponse +- client.ledger_event_handlers.create(\*\*params) -> LedgerEventHandler +- client.ledger_event_handlers.retrieve(id) -> LedgerEventHandler +- client.ledger_event_handlers.list(\*\*params) -> SyncPage[LedgerEventHandler] +- client.ledger_event_handlers.delete(id) -> LedgerEventHandler # LedgerTransactions diff --git a/src/modern_treasury/resources/account_collection_flows.py b/src/modern_treasury/resources/account_collection_flows.py index 972fcd64..326a4767 100644 --- a/src/modern_treasury/resources/account_collection_flows.py +++ b/src/modern_treasury/resources/account_collection_flows.py @@ -45,6 +45,7 @@ def create( "NLD", "PER", "ESP", + "GBR", ] ] | NotGiven = NOT_GIVEN, @@ -246,6 +247,7 @@ async def create( "NLD", "PER", "ESP", + "GBR", ] ] | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/counterparties.py b/src/modern_treasury/resources/counterparties.py index 9643a79d..f3a6af80 100644 --- a/src/modern_treasury/resources/counterparties.py +++ b/src/modern_treasury/resources/counterparties.py @@ -336,6 +336,8 @@ def collect_account( "routingNumberType", "address", "jp_zengin_code", + "se_bankgiro_clearing_code", + "nz_national_clearing_code", ] ] | NotGiven = NOT_GIVEN, @@ -715,6 +717,8 @@ async def collect_account( "routingNumberType", "address", "jp_zengin_code", + "se_bankgiro_clearing_code", + "nz_national_clearing_code", ] ] | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/documents.py b/src/modern_treasury/resources/documents.py index 30f282c6..7f415247 100644 --- a/src/modern_treasury/resources/documents.py +++ b/src/modern_treasury/resources/documents.py @@ -25,6 +25,7 @@ def create( "counterparties", "expected_payments", "external_accounts", + "incoming_payment_details", "internal_accounts", "organizations", "paper_items", @@ -131,6 +132,7 @@ def list( "counterparties", "expected_payments", "external_accounts", + "incoming_payment_details", "internal_accounts", "organizations", "paper_items", @@ -198,6 +200,7 @@ async def create( "counterparties", "expected_payments", "external_accounts", + "incoming_payment_details", "internal_accounts", "organizations", "paper_items", @@ -304,6 +307,7 @@ def list( "counterparties", "expected_payments", "external_accounts", + "incoming_payment_details", "internal_accounts", "organizations", "paper_items", diff --git a/src/modern_treasury/resources/expected_payments.py b/src/modern_treasury/resources/expected_payments.py index ea162b88..5aabf181 100644 --- a/src/modern_treasury/resources/expected_payments.py +++ b/src/modern_treasury/resources/expected_payments.py @@ -40,6 +40,7 @@ def create( metadata: Dict[str, str] | NotGiven = NOT_GIVEN, reconciliation_filters: Optional[object] | NotGiven = NOT_GIVEN, reconciliation_groups: Optional[object] | NotGiven = NOT_GIVEN, + reconciliation_rule_variables: Optional[List[object]] | NotGiven = NOT_GIVEN, remittance_information: Optional[str] | NotGiven = NOT_GIVEN, statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN, type: Optional[ExpectedPaymentType] | NotGiven = NOT_GIVEN, @@ -83,6 +84,8 @@ def create( reconciliation_groups: The reconciliation groups you have for this payment. + reconciliation_rule_variables: An array of reconciliation rule variables for this payment. + remittance_information: For `ach`, this field will be passed through on an addenda record. For `wire` payments the field will be passed through as the "Originator to Beneficiary Information", also known as OBI or Fedwire tag 6000. @@ -122,6 +125,7 @@ def create( "metadata": metadata, "reconciliation_filters": reconciliation_filters, "reconciliation_groups": reconciliation_groups, + "reconciliation_rule_variables": reconciliation_rule_variables, "remittance_information": remittance_information, "statement_descriptor": statement_descriptor, "type": type, @@ -185,6 +189,7 @@ def update( metadata: Dict[str, str] | NotGiven = NOT_GIVEN, reconciliation_filters: Optional[object] | NotGiven = NOT_GIVEN, reconciliation_groups: Optional[object] | NotGiven = NOT_GIVEN, + reconciliation_rule_variables: Optional[List[object]] | NotGiven = NOT_GIVEN, remittance_information: Optional[str] | NotGiven = NOT_GIVEN, statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN, type: Optional[ExpectedPaymentType] | NotGiven = NOT_GIVEN, @@ -228,6 +233,8 @@ def update( reconciliation_groups: The reconciliation groups you have for this payment. + reconciliation_rule_variables: An array of reconciliation rule variables for this payment. + remittance_information: For `ach`, this field will be passed through on an addenda record. For `wire` payments the field will be passed through as the "Originator to Beneficiary Information", also known as OBI or Fedwire tag 6000. @@ -266,6 +273,7 @@ def update( "metadata": metadata, "reconciliation_filters": reconciliation_filters, "reconciliation_groups": reconciliation_groups, + "reconciliation_rule_variables": reconciliation_rule_variables, "remittance_information": remittance_information, "statement_descriptor": statement_descriptor, "type": type, @@ -300,6 +308,7 @@ def list( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -307,6 +316,7 @@ def list( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -439,6 +449,7 @@ async def create( metadata: Dict[str, str] | NotGiven = NOT_GIVEN, reconciliation_filters: Optional[object] | NotGiven = NOT_GIVEN, reconciliation_groups: Optional[object] | NotGiven = NOT_GIVEN, + reconciliation_rule_variables: Optional[List[object]] | NotGiven = NOT_GIVEN, remittance_information: Optional[str] | NotGiven = NOT_GIVEN, statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN, type: Optional[ExpectedPaymentType] | NotGiven = NOT_GIVEN, @@ -482,6 +493,8 @@ async def create( reconciliation_groups: The reconciliation groups you have for this payment. + reconciliation_rule_variables: An array of reconciliation rule variables for this payment. + remittance_information: For `ach`, this field will be passed through on an addenda record. For `wire` payments the field will be passed through as the "Originator to Beneficiary Information", also known as OBI or Fedwire tag 6000. @@ -521,6 +534,7 @@ async def create( "metadata": metadata, "reconciliation_filters": reconciliation_filters, "reconciliation_groups": reconciliation_groups, + "reconciliation_rule_variables": reconciliation_rule_variables, "remittance_information": remittance_information, "statement_descriptor": statement_descriptor, "type": type, @@ -584,6 +598,7 @@ async def update( metadata: Dict[str, str] | NotGiven = NOT_GIVEN, reconciliation_filters: Optional[object] | NotGiven = NOT_GIVEN, reconciliation_groups: Optional[object] | NotGiven = NOT_GIVEN, + reconciliation_rule_variables: Optional[List[object]] | NotGiven = NOT_GIVEN, remittance_information: Optional[str] | NotGiven = NOT_GIVEN, statement_descriptor: Optional[str] | NotGiven = NOT_GIVEN, type: Optional[ExpectedPaymentType] | NotGiven = NOT_GIVEN, @@ -627,6 +642,8 @@ async def update( reconciliation_groups: The reconciliation groups you have for this payment. + reconciliation_rule_variables: An array of reconciliation rule variables for this payment. + remittance_information: For `ach`, this field will be passed through on an addenda record. For `wire` payments the field will be passed through as the "Originator to Beneficiary Information", also known as OBI or Fedwire tag 6000. @@ -665,6 +682,7 @@ async def update( "metadata": metadata, "reconciliation_filters": reconciliation_filters, "reconciliation_groups": reconciliation_groups, + "reconciliation_rule_variables": reconciliation_rule_variables, "remittance_information": remittance_information, "statement_descriptor": statement_descriptor, "type": type, @@ -699,6 +717,7 @@ def list( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -706,6 +725,7 @@ def list( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/resources/external_accounts.py b/src/modern_treasury/resources/external_accounts.py index 6cd27356..a659ca3c 100644 --- a/src/modern_treasury/resources/external_accounts.py +++ b/src/modern_treasury/resources/external_accounts.py @@ -364,6 +364,7 @@ def verify( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -371,6 +372,7 @@ def verify( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -772,6 +774,7 @@ async def verify( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -779,6 +782,7 @@ async def verify( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/resources/internal_accounts/internal_accounts.py b/src/modern_treasury/resources/internal_accounts/internal_accounts.py index 51493597..c206ac3a 100644 --- a/src/modern_treasury/resources/internal_accounts/internal_accounts.py +++ b/src/modern_treasury/resources/internal_accounts/internal_accounts.py @@ -213,6 +213,7 @@ def list( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -220,6 +221,7 @@ def list( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -476,6 +478,7 @@ def list( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -483,6 +486,7 @@ def list( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/resources/invoices/invoices.py b/src/modern_treasury/resources/invoices/invoices.py index e68f3132..4b90575f 100644 --- a/src/modern_treasury/resources/invoices/invoices.py +++ b/src/modern_treasury/resources/invoices/invoices.py @@ -8,6 +8,7 @@ from ...types import ( Invoice, + PaymentOrderType, shared_params, invoice_list_params, invoice_create_params, @@ -50,30 +51,7 @@ def create( notifications_enabled: bool | NotGiven = NOT_GIVEN, payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN, payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN, - payment_type: Literal[ - "ach", - "au_becs", - "se_bankgirot", - "bacs", - "book", - "card", - "check", - "eft", - "cross_border", - "interac", - "masav", - "neft", - "nics", - "provxchange", - "rtp", - "sen", - "sic", - "sepa", - "signet", - "wire", - "zengin", - ] - | NotGiven = NOT_GIVEN, + payment_type: PaymentOrderType | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, recipient_email: Optional[str] | NotGiven = NOT_GIVEN, recipient_name: Optional[str] | NotGiven = NOT_GIVEN, @@ -127,8 +105,8 @@ def create( direction will be credit. One of `manual`, `ui`, or `automatic`. payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. @@ -234,30 +212,7 @@ def update( originating_account_id: str | NotGiven = NOT_GIVEN, payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN, payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN, - payment_type: Literal[ - "ach", - "au_becs", - "se_bankgirot", - "bacs", - "book", - "card", - "check", - "eft", - "cross_border", - "interac", - "masav", - "neft", - "nics", - "provxchange", - "rtp", - "sen", - "sic", - "sepa", - "signet", - "wire", - "zengin", - ] - | NotGiven = NOT_GIVEN, + payment_type: PaymentOrderType | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, recipient_email: Optional[str] | NotGiven = NOT_GIVEN, recipient_name: Optional[str] | NotGiven = NOT_GIVEN, @@ -312,8 +267,8 @@ def update( direction will be credit. One of `manual`, `ui`, or `automatic`. payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. @@ -483,30 +438,7 @@ async def create( notifications_enabled: bool | NotGiven = NOT_GIVEN, payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN, payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN, - payment_type: Literal[ - "ach", - "au_becs", - "se_bankgirot", - "bacs", - "book", - "card", - "check", - "eft", - "cross_border", - "interac", - "masav", - "neft", - "nics", - "provxchange", - "rtp", - "sen", - "sic", - "sepa", - "signet", - "wire", - "zengin", - ] - | NotGiven = NOT_GIVEN, + payment_type: PaymentOrderType | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, recipient_email: Optional[str] | NotGiven = NOT_GIVEN, recipient_name: Optional[str] | NotGiven = NOT_GIVEN, @@ -560,8 +492,8 @@ async def create( direction will be credit. One of `manual`, `ui`, or `automatic`. payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. @@ -667,30 +599,7 @@ async def update( originating_account_id: str | NotGiven = NOT_GIVEN, payment_effective_date: Union[str, date] | NotGiven = NOT_GIVEN, payment_method: Literal["ui", "manual", "automatic"] | NotGiven = NOT_GIVEN, - payment_type: Literal[ - "ach", - "au_becs", - "se_bankgirot", - "bacs", - "book", - "card", - "check", - "eft", - "cross_border", - "interac", - "masav", - "neft", - "nics", - "provxchange", - "rtp", - "sen", - "sic", - "sepa", - "signet", - "wire", - "zengin", - ] - | NotGiven = NOT_GIVEN, + payment_type: PaymentOrderType | NotGiven = NOT_GIVEN, receiving_account_id: str | NotGiven = NOT_GIVEN, recipient_email: Optional[str] | NotGiven = NOT_GIVEN, recipient_name: Optional[str] | NotGiven = NOT_GIVEN, @@ -745,8 +654,8 @@ async def update( direction will be credit. One of `manual`, `ui`, or `automatic`. payment_type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. receiving_account_id: The receiving account ID. Can be an `external_account`. diff --git a/src/modern_treasury/resources/ledger_account_payouts.py b/src/modern_treasury/resources/ledger_account_payouts.py index d57fe8f7..33615cc5 100644 --- a/src/modern_treasury/resources/ledger_account_payouts.py +++ b/src/modern_treasury/resources/ledger_account_payouts.py @@ -27,6 +27,7 @@ def create( *, funding_ledger_account_id: str, payout_ledger_account_id: str, + allow_either_direction: Optional[bool] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_at_upper_bound: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -50,6 +51,9 @@ def create( payout_ledger_account_id: The id of the payout ledger account whose ledger entries are queried against, and its balance is reduced as a result. + allow_either_direction: If true, the payout amount and payout_entry_direction will bring the payout + ledger account’s balance closer to zero, even if the balance is negative. + description: The description of the ledger account payout. effective_at_upper_bound: The exclusive upper bound of the effective_at timestamp of the ledger entries to @@ -81,6 +85,7 @@ def create( { "funding_ledger_account_id": funding_ledger_account_id, "payout_ledger_account_id": payout_ledger_account_id, + "allow_either_direction": allow_either_direction, "description": description, "effective_at_upper_bound": effective_at_upper_bound, "metadata": metadata, @@ -193,6 +198,7 @@ def list( id: List[str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + payout_entry_direction: str | NotGiven = NOT_GIVEN, payout_ledger_account_id: str | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -234,6 +240,7 @@ def list( "id": id, "after_cursor": after_cursor, "metadata": metadata, + "payout_entry_direction": payout_entry_direction, "payout_ledger_account_id": payout_ledger_account_id, "per_page": per_page, }, @@ -278,6 +285,7 @@ async def create( *, funding_ledger_account_id: str, payout_ledger_account_id: str, + allow_either_direction: Optional[bool] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, effective_at_upper_bound: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -301,6 +309,9 @@ async def create( payout_ledger_account_id: The id of the payout ledger account whose ledger entries are queried against, and its balance is reduced as a result. + allow_either_direction: If true, the payout amount and payout_entry_direction will bring the payout + ledger account’s balance closer to zero, even if the balance is negative. + description: The description of the ledger account payout. effective_at_upper_bound: The exclusive upper bound of the effective_at timestamp of the ledger entries to @@ -332,6 +343,7 @@ async def create( { "funding_ledger_account_id": funding_ledger_account_id, "payout_ledger_account_id": payout_ledger_account_id, + "allow_either_direction": allow_either_direction, "description": description, "effective_at_upper_bound": effective_at_upper_bound, "metadata": metadata, @@ -444,6 +456,7 @@ def list( id: List[str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, + payout_entry_direction: str | NotGiven = NOT_GIVEN, payout_ledger_account_id: str | NotGiven = NOT_GIVEN, per_page: int | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -485,6 +498,7 @@ def list( "id": id, "after_cursor": after_cursor, "metadata": metadata, + "payout_entry_direction": payout_entry_direction, "payout_ledger_account_id": payout_ledger_account_id, "per_page": per_page, }, diff --git a/src/modern_treasury/resources/ledger_account_statements.py b/src/modern_treasury/resources/ledger_account_statements.py index 66fe23e8..f4f784a9 100644 --- a/src/modern_treasury/resources/ledger_account_statements.py +++ b/src/modern_treasury/resources/ledger_account_statements.py @@ -2,7 +2,8 @@ from __future__ import annotations -from typing import Dict, Optional +from typing import Dict, Union, Optional +from datetime import datetime from ..types import ( LedgerAccountStatementCreateResponse, @@ -21,8 +22,8 @@ class LedgerAccountStatements(SyncAPIResource): def create( self, *, - effective_at_lower_bound: str, - effective_at_upper_bound: str, + effective_at_lower_bound: Union[str, datetime], + effective_at_upper_bound: Union[str, datetime], ledger_account_id: str, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, @@ -120,8 +121,8 @@ class AsyncLedgerAccountStatements(AsyncAPIResource): async def create( self, *, - effective_at_lower_bound: str, - effective_at_upper_bound: str, + effective_at_lower_bound: Union[str, datetime], + effective_at_upper_bound: Union[str, datetime], ledger_account_id: str, description: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/ledger_event_handlers.py b/src/modern_treasury/resources/ledger_event_handlers.py index 6f67876e..1abfb7a8 100644 --- a/src/modern_treasury/resources/ledger_event_handlers.py +++ b/src/modern_treasury/resources/ledger_event_handlers.py @@ -6,10 +6,8 @@ from datetime import datetime from ..types import ( - LedgerEventHandlerListResponse, - LedgerEventHandlerCreateResponse, - LedgerEventHandlerDeleteResponse, - LedgerEventHandlerRetrieveResponse, + LedgerEventHandler, + LedgerEventHandlerVariableParam, ledger_event_handler_list_params, ledger_event_handler_create_params, ) @@ -32,6 +30,7 @@ def create( description: Optional[str] | NotGiven = NOT_GIVEN, ledger_id: str | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + variables: Optional[Dict[str, LedgerEventHandlerVariableParam]] | 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, @@ -39,7 +38,7 @@ def create( extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerEventHandlerCreateResponse: + ) -> LedgerEventHandler: """ create ledger_event_handler @@ -73,6 +72,7 @@ def create( "description": description, "ledger_id": ledger_id, "metadata": metadata, + "variables": variables, }, ledger_event_handler_create_params.LedgerEventHandlerCreateParams, ), @@ -83,7 +83,7 @@ def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=LedgerEventHandlerCreateResponse, + cast_to=LedgerEventHandler, ) def retrieve( @@ -96,7 +96,7 @@ def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, - ) -> LedgerEventHandlerRetrieveResponse: + ) -> LedgerEventHandler: """ Get details on a single ledger event handler. @@ -114,7 +114,7 @@ def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=LedgerEventHandlerRetrieveResponse, + cast_to=LedgerEventHandler, ) def list( @@ -131,7 +131,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, - ) -> SyncPage[LedgerEventHandlerListResponse]: + ) -> SyncPage[LedgerEventHandler]: """ Get a list of ledger event handlers. @@ -154,7 +154,7 @@ def list( """ return self._get_api_list( "/api/ledger_event_handlers", - page=SyncPage[LedgerEventHandlerListResponse], + page=SyncPage[LedgerEventHandler], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -171,7 +171,7 @@ def list( ledger_event_handler_list_params.LedgerEventHandlerListParams, ), ), - model=LedgerEventHandlerListResponse, + model=LedgerEventHandler, ) def delete( @@ -185,7 +185,7 @@ def delete( extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerEventHandlerDeleteResponse: + ) -> LedgerEventHandler: """ Archive a ledger event handler. @@ -209,7 +209,7 @@ def delete( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=LedgerEventHandlerDeleteResponse, + cast_to=LedgerEventHandler, ) @@ -223,6 +223,7 @@ async def create( description: Optional[str] | NotGiven = NOT_GIVEN, ledger_id: str | NotGiven = NOT_GIVEN, metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, + variables: Optional[Dict[str, LedgerEventHandlerVariableParam]] | 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, @@ -230,7 +231,7 @@ async def create( extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerEventHandlerCreateResponse: + ) -> LedgerEventHandler: """ create ledger_event_handler @@ -264,6 +265,7 @@ async def create( "description": description, "ledger_id": ledger_id, "metadata": metadata, + "variables": variables, }, ledger_event_handler_create_params.LedgerEventHandlerCreateParams, ), @@ -274,7 +276,7 @@ async def create( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=LedgerEventHandlerCreateResponse, + cast_to=LedgerEventHandler, ) async def retrieve( @@ -287,7 +289,7 @@ async def retrieve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, - ) -> LedgerEventHandlerRetrieveResponse: + ) -> LedgerEventHandler: """ Get details on a single ledger event handler. @@ -305,7 +307,7 @@ async def retrieve( options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=LedgerEventHandlerRetrieveResponse, + cast_to=LedgerEventHandler, ) def list( @@ -322,7 +324,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[LedgerEventHandlerListResponse, AsyncPage[LedgerEventHandlerListResponse]]: + ) -> AsyncPaginator[LedgerEventHandler, AsyncPage[LedgerEventHandler]]: """ Get a list of ledger event handlers. @@ -345,7 +347,7 @@ def list( """ return self._get_api_list( "/api/ledger_event_handlers", - page=AsyncPage[LedgerEventHandlerListResponse], + page=AsyncPage[LedgerEventHandler], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -362,7 +364,7 @@ def list( ledger_event_handler_list_params.LedgerEventHandlerListParams, ), ), - model=LedgerEventHandlerListResponse, + model=LedgerEventHandler, ) async def delete( @@ -376,7 +378,7 @@ async def delete( extra_body: Body | None = None, timeout: float | None | NotGiven = NOT_GIVEN, idempotency_key: str | None = None, - ) -> LedgerEventHandlerDeleteResponse: + ) -> LedgerEventHandler: """ Archive a ledger event handler. @@ -400,5 +402,5 @@ async def delete( timeout=timeout, idempotency_key=idempotency_key, ), - cast_to=LedgerEventHandlerDeleteResponse, + cast_to=LedgerEventHandler, ) diff --git a/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py b/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py index efdfffc0..de9b03b6 100644 --- a/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py +++ b/src/modern_treasury/resources/ledger_transactions/ledger_transactions.py @@ -231,7 +231,7 @@ def list( *, id: List[str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, - effective_at: Dict[str, str] | NotGiven = NOT_GIVEN, + effective_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, effective_date: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, external_id: str | NotGiven = NOT_GIVEN, ledger_account_category_id: str | NotGiven = NOT_GIVEN, @@ -636,7 +636,7 @@ def list( *, id: List[str] | NotGiven = NOT_GIVEN, after_cursor: Optional[str] | NotGiven = NOT_GIVEN, - effective_at: Dict[str, str] | NotGiven = NOT_GIVEN, + effective_at: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, effective_date: Dict[str, Union[str, datetime]] | NotGiven = NOT_GIVEN, external_id: str | NotGiven = NOT_GIVEN, ledger_account_category_id: str | NotGiven = NOT_GIVEN, diff --git a/src/modern_treasury/resources/ledgerable_events.py b/src/modern_treasury/resources/ledgerable_events.py index dd1a0adb..62cafe3b 100644 --- a/src/modern_treasury/resources/ledgerable_events.py +++ b/src/modern_treasury/resources/ledgerable_events.py @@ -17,13 +17,9 @@ class LedgerableEvents(SyncAPIResource): def create( self, *, - amount: int, name: str, - currency: Optional[str] | NotGiven = NOT_GIVEN, - currency_exponent: Optional[int] | NotGiven = NOT_GIVEN, custom_data: Optional[object] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - direction: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -34,26 +30,15 @@ def create( idempotency_key: str | None = None, ) -> LedgerableEvent: """ - Translation missing: - en.openapi.descriptions.ledger.operations.create_ledgerable_event + Create a ledgerable event. Args: - amount: Value in specified currency's smallest unit. e.g. $10 would be represented - as 1000. - name: Name of the ledgerable event. - currency: An ISO 4217 conformed currency or a custom currency. - - currency_exponent: Must be included if currency is a custom currency. The currency_exponent cannot - exceed 30. - custom_data: Additionally data to be used by the Ledger Event Handler. description: Description of the ledgerable event. - direction: One of `credit`, `debit`. - metadata: Additional data represented as key-value pairs. Both the key and value must be strings. @@ -71,13 +56,9 @@ def create( "/api/ledgerable_events", body=maybe_transform( { - "amount": amount, "name": name, - "currency": currency, - "currency_exponent": currency_exponent, "custom_data": custom_data, "description": description, - "direction": direction, "metadata": metadata, }, ledgerable_event_create_params.LedgerableEventCreateParams, @@ -128,13 +109,9 @@ class AsyncLedgerableEvents(AsyncAPIResource): async def create( self, *, - amount: int, name: str, - currency: Optional[str] | NotGiven = NOT_GIVEN, - currency_exponent: Optional[int] | NotGiven = NOT_GIVEN, custom_data: Optional[object] | NotGiven = NOT_GIVEN, description: Optional[str] | NotGiven = NOT_GIVEN, - direction: Optional[str] | NotGiven = NOT_GIVEN, metadata: Dict[str, str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -145,26 +122,15 @@ async def create( idempotency_key: str | None = None, ) -> LedgerableEvent: """ - Translation missing: - en.openapi.descriptions.ledger.operations.create_ledgerable_event + Create a ledgerable event. Args: - amount: Value in specified currency's smallest unit. e.g. $10 would be represented - as 1000. - name: Name of the ledgerable event. - currency: An ISO 4217 conformed currency or a custom currency. - - currency_exponent: Must be included if currency is a custom currency. The currency_exponent cannot - exceed 30. - custom_data: Additionally data to be used by the Ledger Event Handler. description: Description of the ledgerable event. - direction: One of `credit`, `debit`. - metadata: Additional data represented as key-value pairs. Both the key and value must be strings. @@ -182,13 +148,9 @@ async def create( "/api/ledgerable_events", body=maybe_transform( { - "amount": amount, "name": name, - "currency": currency, - "currency_exponent": currency_exponent, "custom_data": custom_data, "description": description, - "direction": direction, "metadata": metadata, }, ledgerable_event_create_params.LedgerableEventCreateParams, diff --git a/src/modern_treasury/resources/payment_orders/payment_orders.py b/src/modern_treasury/resources/payment_orders/payment_orders.py index 18c774fa..e2ebd7cd 100644 --- a/src/modern_treasury/resources/payment_orders/payment_orders.py +++ b/src/modern_treasury/resources/payment_orders/payment_orders.py @@ -97,8 +97,8 @@ def create( originating_account_id: The ID of one of your organization's internal accounts. type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. @@ -458,8 +458,8 @@ def update( `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`. type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. ultimate_originating_party_identifier: This represents the identifier by which the person is known to the receiver when using the CIE subtype for ACH payments. Only the first 22 characters of this @@ -571,6 +571,7 @@ def list( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -578,6 +579,7 @@ def list( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -713,8 +715,8 @@ def create_async( originating_account_id: The ID of one of your organization's internal accounts. type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. @@ -940,8 +942,8 @@ async def create( originating_account_id: The ID of one of your organization's internal accounts. type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. @@ -1301,8 +1303,8 @@ async def update( `CCD`, `PPD`, `IAT`, `CTX`, `WEB`, `CIE`, and `TEL`. type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. ultimate_originating_party_identifier: This represents the identifier by which the person is known to the receiver when using the CIE subtype for ACH payments. Only the first 22 characters of this @@ -1414,6 +1416,7 @@ def list( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -1421,6 +1424,7 @@ def list( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -1556,8 +1560,8 @@ async def create_async( originating_account_id: The ID of one of your organization's internal accounts. type: One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. accounting_category_id: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected. diff --git a/src/modern_treasury/resources/routing_details.py b/src/modern_treasury/resources/routing_details.py index 07c24697..c494112e 100644 --- a/src/modern_treasury/resources/routing_details.py +++ b/src/modern_treasury/resources/routing_details.py @@ -35,9 +35,11 @@ def create( "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], @@ -48,6 +50,7 @@ def create( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -55,6 +58,7 @@ def create( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -81,7 +85,9 @@ def create( Args: routing_number: The routing number of the bank. - routing_number_type: One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`. + routing_number_type: The type of routing number. See + https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. payment_type: If the routing detail is to be used for a specific payment type this field will be populated, otherwise null. @@ -251,9 +257,11 @@ async def create( "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], @@ -264,6 +272,7 @@ async def create( "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -271,6 +280,7 @@ async def create( "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -297,7 +307,9 @@ async def create( Args: routing_number: The routing number of the bank. - routing_number_type: One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`. + routing_number_type: The type of routing number. See + https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. payment_type: If the routing detail is to be used for a specific payment type this field will be populated, otherwise null. diff --git a/src/modern_treasury/resources/validations.py b/src/modern_treasury/resources/validations.py index 9bdd6435..516cf9c8 100644 --- a/src/modern_treasury/resources/validations.py +++ b/src/modern_treasury/resources/validations.py @@ -29,9 +29,11 @@ def validate_routing_number( "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], @@ -49,10 +51,10 @@ def validate_routing_number( Args: routing_number: The routing number that is being validated. - routing_number_type: One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox - mode we currently only support `aba` and `swift` with routing numbers - '123456789' and 'GRINUST0XXX' respectively. + routing_number_type: The type of routing number. See + https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. In sandbox mode we currently only support `aba` and `swift` with + routing numbers '123456789' and 'GRINUST0XXX' respectively. extra_headers: Send extra headers @@ -94,9 +96,11 @@ async def validate_routing_number( "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ], @@ -114,10 +118,10 @@ async def validate_routing_number( Args: routing_number: The routing number that is being validated. - routing_number_type: One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox - mode we currently only support `aba` and `swift` with routing numbers - '123456789' and 'GRINUST0XXX' respectively. + routing_number_type: The type of routing number. See + https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. In sandbox mode we currently only support `aba` and `swift` with + routing numbers '123456789' and 'GRINUST0XXX' respectively. extra_headers: Send extra headers diff --git a/src/modern_treasury/types/__init__.py b/src/modern_treasury/types/__init__.py index 3fd20bfe..20d83cec 100644 --- a/src/modern_treasury/types/__init__.py +++ b/src/modern_treasury/types/__init__.py @@ -37,6 +37,7 @@ from .invoice_list_params import InvoiceListParams as InvoiceListParams from .document_list_params import DocumentListParams as DocumentListParams from .ledger_create_params import LedgerCreateParams as LedgerCreateParams +from .ledger_event_handler import LedgerEventHandler as LedgerEventHandler from .ledger_update_params import LedgerUpdateParams as LedgerUpdateParams from .return_create_params import ReturnCreateParams as ReturnCreateParams from .expected_payment_type import ExpectedPaymentType as ExpectedPaymentType @@ -115,6 +116,9 @@ from .routing_detail_create_params import ( RoutingDetailCreateParams as RoutingDetailCreateParams, ) +from .ledger_event_handler_variable import ( + LedgerEventHandlerVariable as LedgerEventHandlerVariable, +) from .payment_reference_list_params import ( PaymentReferenceListParams as PaymentReferenceListParams, ) @@ -178,9 +182,6 @@ from .ledger_event_handler_create_params import ( LedgerEventHandlerCreateParams as LedgerEventHandlerCreateParams, ) -from .ledger_event_handler_list_response import ( - LedgerEventHandlerListResponse as LedgerEventHandlerListResponse, -) from .account_collection_flow_list_params import ( AccountCollectionFlowListParams as AccountCollectionFlowListParams, ) @@ -199,11 +200,8 @@ from .ledger_account_payout_update_params import ( LedgerAccountPayoutUpdateParams as LedgerAccountPayoutUpdateParams, ) -from .ledger_event_handler_create_response import ( - LedgerEventHandlerCreateResponse as LedgerEventHandlerCreateResponse, -) -from .ledger_event_handler_delete_response import ( - LedgerEventHandlerDeleteResponse as LedgerEventHandlerDeleteResponse, +from .ledger_event_handler_variable_param import ( + LedgerEventHandlerVariableParam as LedgerEventHandlerVariableParam, ) from .account_collection_flow_create_params import ( AccountCollectionFlowCreateParams as AccountCollectionFlowCreateParams, @@ -226,9 +224,6 @@ from .ledger_account_statement_create_params import ( LedgerAccountStatementCreateParams as LedgerAccountStatementCreateParams, ) -from .ledger_event_handler_retrieve_response import ( - LedgerEventHandlerRetrieveResponse as LedgerEventHandlerRetrieveResponse, -) from .ledger_account_category_retrieve_params import ( LedgerAccountCategoryRetrieveParams as LedgerAccountCategoryRetrieveParams, ) diff --git a/src/modern_treasury/types/account_collection_flow.py b/src/modern_treasury/types/account_collection_flow.py index 87ed9092..1fd712f3 100644 --- a/src/modern_treasury/types/account_collection_flow.py +++ b/src/modern_treasury/types/account_collection_flow.py @@ -61,6 +61,7 @@ class AccountCollectionFlow(BaseModel): "NLD", "PER", "ESP", + "GBR", ] ] ] = None diff --git a/src/modern_treasury/types/account_collection_flow_create_params.py b/src/modern_treasury/types/account_collection_flow_create_params.py index e4931c52..46d2b0e3 100644 --- a/src/modern_treasury/types/account_collection_flow_create_params.py +++ b/src/modern_treasury/types/account_collection_flow_create_params.py @@ -33,5 +33,6 @@ class AccountCollectionFlowCreateParams(TypedDict, total=False): "NLD", "PER", "ESP", + "GBR", ] ] diff --git a/src/modern_treasury/types/counterparty_collect_account_params.py b/src/modern_treasury/types/counterparty_collect_account_params.py index dfea93a2..ea7339e7 100644 --- a/src/modern_treasury/types/counterparty_collect_account_params.py +++ b/src/modern_treasury/types/counterparty_collect_account_params.py @@ -50,6 +50,8 @@ class CounterpartyCollectAccountParams(TypedDict, total=False): "routingNumberType", "address", "jp_zengin_code", + "se_bankgiro_clearing_code", + "nz_national_clearing_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 b0735971..64cd0964 100644 --- a/src/modern_treasury/types/counterparty_create_params.py +++ b/src/modern_treasury/types/counterparty_create_params.py @@ -181,8 +181,10 @@ class AccountRoutingDetail(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "my_branch_code", + "nz_national_clearing_code", "swift", "jp_zengin_code", ] @@ -191,22 +193,24 @@ class AccountRoutingDetail(TypedDict, total=False): payment_type: Literal[ "ach", "au_becs", - "se_bankgirot", "bacs", "book", "card", + "chats", "check", - "eft", "cross_border", + "eft", "interac", "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", + "se_bankgirot", "sen", - "sic", "sepa", + "sic", "signet", "wire", "zengin", diff --git a/src/modern_treasury/types/document.py b/src/modern_treasury/types/document.py index 8605d212..a2937c76 100644 --- a/src/modern_treasury/types/document.py +++ b/src/modern_treasury/types/document.py @@ -69,6 +69,7 @@ class Document(BaseModel): "counterparty", "expected_payment", "external_account", + "incoming_payment_detail", "internal_account", "organization", "paper_item", diff --git a/src/modern_treasury/types/document_create_params.py b/src/modern_treasury/types/document_create_params.py index 42a14886..e39208e0 100644 --- a/src/modern_treasury/types/document_create_params.py +++ b/src/modern_treasury/types/document_create_params.py @@ -19,6 +19,7 @@ class DocumentCreateParams(TypedDict, total=False): "counterparties", "expected_payments", "external_accounts", + "incoming_payment_details", "internal_accounts", "organizations", "paper_items", diff --git a/src/modern_treasury/types/document_list_params.py b/src/modern_treasury/types/document_list_params.py index 09ffb0df..419b6e46 100644 --- a/src/modern_treasury/types/document_list_params.py +++ b/src/modern_treasury/types/document_list_params.py @@ -19,6 +19,7 @@ class DocumentListParams(TypedDict, total=False): "counterparties", "expected_payments", "external_accounts", + "incoming_payment_details", "internal_accounts", "organizations", "paper_items", diff --git a/src/modern_treasury/types/expected_payment.py b/src/modern_treasury/types/expected_payment.py index 5e96dc56..86a1b18e 100644 --- a/src/modern_treasury/types/expected_payment.py +++ b/src/modern_treasury/types/expected_payment.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. import builtins -from typing import Dict, Optional +from typing import Dict, List, Optional from datetime import date, datetime from typing_extensions import Literal @@ -85,6 +85,9 @@ class ExpectedPayment(BaseModel): is unreconciled. """ + reconciliation_rule_variables: Optional[List[builtins.object]] + """An array of reconciliation rule variables for this payment.""" + remittance_information: Optional[str] """For `ach`, this field will be passed through on an addenda record. diff --git a/src/modern_treasury/types/expected_payment_create_params.py b/src/modern_treasury/types/expected_payment_create_params.py index 55c5d7fc..9997c4a9 100644 --- a/src/modern_treasury/types/expected_payment_create_params.py +++ b/src/modern_treasury/types/expected_payment_create_params.py @@ -66,6 +66,9 @@ class ExpectedPaymentCreateParams(TypedDict, total=False): reconciliation_groups: Optional[object] """The reconciliation groups you have for this payment.""" + reconciliation_rule_variables: Optional[List[object]] + """An array of reconciliation rule variables for this payment.""" + remittance_information: Optional[str] """For `ach`, this field will be passed through on an addenda record. diff --git a/src/modern_treasury/types/expected_payment_list_params.py b/src/modern_treasury/types/expected_payment_list_params.py index a4cc9cb8..6839f3b2 100644 --- a/src/modern_treasury/types/expected_payment_list_params.py +++ b/src/modern_treasury/types/expected_payment_list_params.py @@ -48,6 +48,7 @@ class ExpectedPaymentListParams(TypedDict, total=False): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -55,6 +56,7 @@ class ExpectedPaymentListParams(TypedDict, total=False): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/expected_payment_type.py b/src/modern_treasury/types/expected_payment_type.py index 680d7ba0..dc42c879 100644 --- a/src/modern_treasury/types/expected_payment_type.py +++ b/src/modern_treasury/types/expected_payment_type.py @@ -12,6 +12,7 @@ "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -19,6 +20,7 @@ "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/expected_payment_update_params.py b/src/modern_treasury/types/expected_payment_update_params.py index 8de54d8e..2f306f0a 100644 --- a/src/modern_treasury/types/expected_payment_update_params.py +++ b/src/modern_treasury/types/expected_payment_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Optional +from typing import Dict, List, Union, Optional from datetime import date from typing_extensions import Annotated, TypedDict @@ -64,6 +64,9 @@ class ExpectedPaymentUpdateParams(TypedDict, total=False): reconciliation_groups: Optional[object] """The reconciliation groups you have for this payment.""" + reconciliation_rule_variables: Optional[List[object]] + """An array of reconciliation rule variables for this payment.""" + remittance_information: Optional[str] """For `ach`, this field will be passed through on an addenda record. diff --git a/src/modern_treasury/types/external_account_create_params.py b/src/modern_treasury/types/external_account_create_params.py index 0a5ab891..594b88e3 100644 --- a/src/modern_treasury/types/external_account_create_params.py +++ b/src/modern_treasury/types/external_account_create_params.py @@ -171,8 +171,10 @@ class RoutingDetail(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "my_branch_code", + "nz_national_clearing_code", "swift", "jp_zengin_code", ] @@ -181,22 +183,24 @@ class RoutingDetail(TypedDict, total=False): payment_type: Literal[ "ach", "au_becs", - "se_bankgirot", "bacs", "book", "card", + "chats", "check", - "eft", "cross_border", + "eft", "interac", "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", + "se_bankgirot", "sen", - "sic", "sepa", + "sic", "signet", "wire", "zengin", diff --git a/src/modern_treasury/types/external_account_verify_params.py b/src/modern_treasury/types/external_account_verify_params.py index b6fd4a32..15b24650 100644 --- a/src/modern_treasury/types/external_account_verify_params.py +++ b/src/modern_treasury/types/external_account_verify_params.py @@ -24,6 +24,7 @@ class ExternalAccountVerifyParams(TypedDict, total=False): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -31,6 +32,7 @@ class ExternalAccountVerifyParams(TypedDict, total=False): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/incoming_payment_detail.py b/src/modern_treasury/types/incoming_payment_detail.py index 5513298c..e68fb6b9 100644 --- a/src/modern_treasury/types/incoming_payment_detail.py +++ b/src/modern_treasury/types/incoming_payment_detail.py @@ -82,9 +82,11 @@ class IncomingPaymentDetail(BaseModel): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_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 fa940ffb..db9ac8fa 100644 --- a/src/modern_treasury/types/internal_account_list_params.py +++ b/src/modern_treasury/types/internal_account_list_params.py @@ -35,6 +35,7 @@ class InternalAccountListParams(TypedDict, total=False): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -42,6 +43,7 @@ class InternalAccountListParams(TypedDict, total=False): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/invoice.py b/src/modern_treasury/types/invoice.py index 054508ab..764c45ba 100644 --- a/src/modern_treasury/types/invoice.py +++ b/src/modern_treasury/types/invoice.py @@ -9,6 +9,7 @@ from .shared import Currency from .._compat import PYDANTIC_V2 from .._models import BaseModel +from .expected_payment import ExpectedPayment __all__ = [ "Invoice", @@ -106,6 +107,18 @@ class InvoicerAddress(BaseModel): class Invoice(BaseModel): id: str + amount_paid: int + """ + Amount paid on the invoice in specified currency's smallest unit, e.g., $10 USD + would be represented as 1000. + """ + + amount_remaining: int + """ + Amount remaining due on the invoice in specified currency's smallest unit, e.g., + $10 USD would be represented as 1000. + """ + contact_details: List[ContactDetail] """The invoicer's contact details displayed at the top of the invoice.""" @@ -129,6 +142,9 @@ class Invoice(BaseModel): due_date: datetime """A future date by when the invoice needs to be paid.""" + expected_payments: List[ExpectedPayment] + """The expected payments created for an unpaid invoice.""" + hosted_url: str """The URL of the hosted web UI where the invoice can be viewed.""" @@ -202,7 +218,7 @@ class Invoice(BaseModel): Leaving this value as null will fallback to using the counterparty's name. """ - status: Literal["draft", "paid", "payment_pending", "unpaid", "voided"] + status: Literal["draft", "paid", "partially_paid", "payment_pending", "unpaid", "voided"] """The status of the invoice.""" total_amount: int diff --git a/src/modern_treasury/types/invoice_create_params.py b/src/modern_treasury/types/invoice_create_params.py index f01ba605..c0493c16 100644 --- a/src/modern_treasury/types/invoice_create_params.py +++ b/src/modern_treasury/types/invoice_create_params.py @@ -8,6 +8,7 @@ from ..types import shared_params from .._utils import PropertyInfo +from .payment_order_type import PaymentOrderType __all__ = [ "InvoiceCreateParams", @@ -78,33 +79,11 @@ class InvoiceCreateParams(TypedDict, total=False): One of `manual`, `ui`, or `automatic`. """ - payment_type: Literal[ - "ach", - "au_becs", - "se_bankgirot", - "bacs", - "book", - "card", - "check", - "eft", - "cross_border", - "interac", - "masav", - "neft", - "nics", - "provxchange", - "rtp", - "sen", - "sic", - "sepa", - "signet", - "wire", - "zengin", - ] + payment_type: PaymentOrderType """ One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. """ receiving_account_id: str diff --git a/src/modern_treasury/types/invoice_update_params.py b/src/modern_treasury/types/invoice_update_params.py index 30f04057..70c9d534 100644 --- a/src/modern_treasury/types/invoice_update_params.py +++ b/src/modern_treasury/types/invoice_update_params.py @@ -8,6 +8,7 @@ from ..types import shared_params from .._utils import PropertyInfo +from .payment_order_type import PaymentOrderType __all__ = [ "InvoiceUpdateParams", @@ -78,33 +79,11 @@ class InvoiceUpdateParams(TypedDict, total=False): One of `manual`, `ui`, or `automatic`. """ - payment_type: Literal[ - "ach", - "au_becs", - "se_bankgirot", - "bacs", - "book", - "card", - "check", - "eft", - "cross_border", - "interac", - "masav", - "neft", - "nics", - "provxchange", - "rtp", - "sen", - "sic", - "sepa", - "signet", - "wire", - "zengin", - ] + payment_type: PaymentOrderType """ One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. """ receiving_account_id: str diff --git a/src/modern_treasury/types/ledger_account.py b/src/modern_treasury/types/ledger_account.py index 64febac0..3ad9dd16 100644 --- a/src/modern_treasury/types/ledger_account.py +++ b/src/modern_treasury/types/ledger_account.py @@ -61,13 +61,13 @@ class Balances(BaseModel): pending_credits. """ - effective_at_lower_bound: Optional[str] + effective_at_lower_bound: Optional[datetime] """ The inclusive lower bound of the effective_at timestamp for the returned balances. """ - effective_at_upper_bound: Optional[str] + effective_at_upper_bound: Optional[datetime] """ The exclusive upper bound of the effective_at timestamp for the returned balances. diff --git a/src/modern_treasury/types/ledger_account_payout.py b/src/modern_treasury/types/ledger_account_payout.py index cf442605..9773245a 100644 --- a/src/modern_treasury/types/ledger_account_payout.py +++ b/src/modern_treasury/types/ledger_account_payout.py @@ -26,7 +26,7 @@ class LedgerAccountPayout(BaseModel): description: Optional[str] """The description of the ledger account payout.""" - effective_at_upper_bound: str + 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 payout. The default value is the created_at @@ -59,6 +59,9 @@ class LedgerAccountPayout(BaseModel): object: str + payout_entry_direction: Optional[str] + """The direction of the ledger entry with the payout_ledger_account.""" + payout_ledger_account_id: str """ The id of the payout ledger account whose ledger entries are queried against, diff --git a/src/modern_treasury/types/ledger_account_payout_create_params.py b/src/modern_treasury/types/ledger_account_payout_create_params.py index 57543f05..b594f3f3 100644 --- a/src/modern_treasury/types/ledger_account_payout_create_params.py +++ b/src/modern_treasury/types/ledger_account_payout_create_params.py @@ -21,6 +21,12 @@ class LedgerAccountPayoutCreateParams(TypedDict, total=False): and its balance is reduced as a result. """ + allow_either_direction: Optional[bool] + """ + If true, the payout amount and payout_entry_direction will bring the payout + ledger account’s balance closer to zero, even if the balance is negative. + """ + description: Optional[str] """The description of the ledger account payout.""" diff --git a/src/modern_treasury/types/ledger_account_payout_list_params.py b/src/modern_treasury/types/ledger_account_payout_list_params.py index d8117d99..9f31b508 100644 --- a/src/modern_treasury/types/ledger_account_payout_list_params.py +++ b/src/modern_treasury/types/ledger_account_payout_list_params.py @@ -24,6 +24,8 @@ class LedgerAccountPayoutListParams(TypedDict, total=False): parameters. """ + payout_entry_direction: str + payout_ledger_account_id: str per_page: int diff --git a/src/modern_treasury/types/ledger_account_statement_create_params.py b/src/modern_treasury/types/ledger_account_statement_create_params.py index 1090ea97..07d9f0be 100644 --- a/src/modern_treasury/types/ledger_account_statement_create_params.py +++ b/src/modern_treasury/types/ledger_account_statement_create_params.py @@ -2,20 +2,23 @@ from __future__ import annotations -from typing import Dict, Optional -from typing_extensions import Required, TypedDict +from typing import Dict, Union, Optional +from datetime import datetime +from typing_extensions import Required, Annotated, TypedDict + +from .._utils import PropertyInfo __all__ = ["LedgerAccountStatementCreateParams"] class LedgerAccountStatementCreateParams(TypedDict, total=False): - effective_at_lower_bound: Required[str] + effective_at_lower_bound: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] """ The inclusive lower bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement. """ - effective_at_upper_bound: Required[str] + effective_at_upper_bound: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] """ The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement. diff --git a/src/modern_treasury/types/ledger_account_statement_create_response.py b/src/modern_treasury/types/ledger_account_statement_create_response.py index 45561fea..af5e2705 100644 --- a/src/modern_treasury/types/ledger_account_statement_create_response.py +++ b/src/modern_treasury/types/ledger_account_statement_create_response.py @@ -143,13 +143,13 @@ class LedgerAccountStatementCreateResponse(BaseModel): description: Optional[str] """The description of the ledger account statement.""" - effective_at_lower_bound: str + effective_at_lower_bound: datetime """ The inclusive lower bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement. """ - effective_at_upper_bound: str + 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 statement. diff --git a/src/modern_treasury/types/ledger_account_statement_retrieve_response.py b/src/modern_treasury/types/ledger_account_statement_retrieve_response.py index 9d35234e..0701b178 100644 --- a/src/modern_treasury/types/ledger_account_statement_retrieve_response.py +++ b/src/modern_treasury/types/ledger_account_statement_retrieve_response.py @@ -143,13 +143,13 @@ class LedgerAccountStatementRetrieveResponse(BaseModel): description: Optional[str] """The description of the ledger account statement.""" - effective_at_lower_bound: str + effective_at_lower_bound: datetime """ The inclusive lower bound of the effective_at timestamp of the ledger entries to be included in the ledger account statement. """ - effective_at_upper_bound: str + 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 statement. diff --git a/src/modern_treasury/types/ledger_event_handler_list_response.py b/src/modern_treasury/types/ledger_event_handler.py similarity index 70% rename from src/modern_treasury/types/ledger_event_handler_list_response.py rename to src/modern_treasury/types/ledger_event_handler.py index 6c59ef6c..e14364c1 100644 --- a/src/modern_treasury/types/ledger_event_handler_list_response.py +++ b/src/modern_treasury/types/ledger_event_handler.py @@ -4,9 +4,10 @@ from datetime import datetime from .._models import BaseModel +from .ledger_event_handler_variable import LedgerEventHandlerVariable __all__ = [ - "LedgerEventHandlerListResponse", + "LedgerEventHandler", "Conditions", "LedgerTransactionTemplate", "LedgerTransactionTemplateLedgerEntries", @@ -16,30 +17,24 @@ class Conditions(BaseModel): field: str - """The field you're fetching from the `ledgerable_event`.""" + """The LHS of the conditional.""" operator: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ + """What the operator between the `field` and `value` is.""" value: str - """What raw string you are comparing the `field` against.""" + """The RHS of the conditional.""" class LedgerTransactionTemplateLedgerEntry(BaseModel): amount: str - """The field you're fetching from the `ledgerable_event`.""" + """The LHS of the conditional.""" direction: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ + """What the operator between the `field` and `value` is.""" ledger_account_id: str - """What raw string you are comparing the `field` against.""" + """The RHS of the conditional.""" LedgerTransactionTemplateLedgerEntries = LedgerTransactionTemplateLedgerEntry @@ -53,7 +48,7 @@ class LedgerTransactionTemplate(BaseModel): description: Optional[str] """An optional description for internal use.""" - effective_at: Optional[datetime] + effective_at: Optional[str] """ The timestamp (ISO8601 format) at which the ledger transaction happened for reporting purposes. @@ -62,14 +57,11 @@ class LedgerTransactionTemplate(BaseModel): ledger_entries: List[LedgerTransactionTemplateLedgerEntry] """An array of ledger entry objects.""" - metadata: Optional[Dict[str, str]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ + status: Optional[str] + """To post a ledger transaction at creation, use `posted`.""" -class LedgerEventHandlerListResponse(BaseModel): +class LedgerEventHandler(BaseModel): id: str conditions: Optional[Conditions] @@ -81,6 +73,9 @@ class LedgerEventHandlerListResponse(BaseModel): discarded_at: Optional[datetime] + ledger_id: Optional[str] + """The id of the ledger that this event handler belongs to.""" + ledger_transaction_template: LedgerTransactionTemplate live_mode: bool @@ -101,3 +96,5 @@ class LedgerEventHandlerListResponse(BaseModel): object: str updated_at: datetime + + variables: Optional[Dict[str, LedgerEventHandlerVariable]] diff --git a/src/modern_treasury/types/ledger_event_handler_create_params.py b/src/modern_treasury/types/ledger_event_handler_create_params.py index b154a32b..790153bc 100644 --- a/src/modern_treasury/types/ledger_event_handler_create_params.py +++ b/src/modern_treasury/types/ledger_event_handler_create_params.py @@ -2,11 +2,10 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional -from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict +from typing import Dict, List, Optional +from typing_extensions import Required, TypedDict -from .._utils import PropertyInfo +from .ledger_event_handler_variable_param import LedgerEventHandlerVariableParam __all__ = [ "LedgerEventHandlerCreateParams", @@ -37,19 +36,18 @@ class LedgerEventHandlerCreateParams(TypedDict, total=False): Both the key and value must be strings. """ + variables: Optional[Dict[str, LedgerEventHandlerVariableParam]] + class LedgerTransactionTemplateLedgerEntry(TypedDict, total=False): amount: Required[str] - """The field you're fetching from the `ledgerable_event`.""" + """The LHS of the conditional.""" direction: Required[str] - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ + """What the operator between the `field` and `value` is.""" ledger_account_id: Required[str] - """What raw string you are comparing the `field` against.""" + """The RHS of the conditional.""" LedgerTransactionTemplateLedgerEntries = LedgerTransactionTemplateLedgerEntry @@ -63,7 +61,7 @@ class LedgerTransactionTemplate(TypedDict, total=False): description: Required[Optional[str]] """An optional description for internal use.""" - effective_at: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] + effective_at: Required[Optional[str]] """ The timestamp (ISO8601 format) at which the ledger transaction happened for reporting purposes. @@ -72,22 +70,16 @@ class LedgerTransactionTemplate(TypedDict, total=False): ledger_entries: Required[List[LedgerTransactionTemplateLedgerEntry]] """An array of ledger entry objects.""" - metadata: Required[Optional[Dict[str, str]]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ + status: Required[Optional[str]] + """To post a ledger transaction at creation, use `posted`.""" class Conditions(TypedDict, total=False): field: Required[str] - """The field you're fetching from the `ledgerable_event`.""" + """The LHS of the conditional.""" operator: Required[str] - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ + """What the operator between the `field` and `value` is.""" value: Required[str] - """What raw string you are comparing the `field` against.""" + """The RHS of the conditional.""" diff --git a/src/modern_treasury/types/ledger_event_handler_create_response.py b/src/modern_treasury/types/ledger_event_handler_create_response.py deleted file mode 100644 index 38732da3..00000000 --- a/src/modern_treasury/types/ledger_event_handler_create_response.py +++ /dev/null @@ -1,103 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Dict, List, Optional -from datetime import datetime - -from .._models import BaseModel - -__all__ = [ - "LedgerEventHandlerCreateResponse", - "Conditions", - "LedgerTransactionTemplate", - "LedgerTransactionTemplateLedgerEntries", - "LedgerTransactionTemplateLedgerEntry", -] - - -class Conditions(BaseModel): - field: str - """The field you're fetching from the `ledgerable_event`.""" - - operator: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ - - value: str - """What raw string you are comparing the `field` against.""" - - -class LedgerTransactionTemplateLedgerEntry(BaseModel): - amount: str - """The field you're fetching from the `ledgerable_event`.""" - - direction: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ - - ledger_account_id: str - """What raw string you are comparing the `field` against.""" - - -LedgerTransactionTemplateLedgerEntries = LedgerTransactionTemplateLedgerEntry -"""This type is deprecated and will be removed in a future release. - -Please use LedgerTransactionTemplateLedgerEntry instead. -""" - - -class LedgerTransactionTemplate(BaseModel): - description: Optional[str] - """An optional description for internal use.""" - - effective_at: Optional[datetime] - """ - The timestamp (ISO8601 format) at which the ledger transaction happened for - reporting purposes. - """ - - ledger_entries: List[LedgerTransactionTemplateLedgerEntry] - """An array of ledger entry objects.""" - - metadata: Optional[Dict[str, str]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ - - -class LedgerEventHandlerCreateResponse(BaseModel): - id: str - - conditions: Optional[Conditions] - - created_at: datetime - - description: Optional[str] - """An optional description.""" - - discarded_at: Optional[datetime] - - ledger_transaction_template: LedgerTransactionTemplate - - 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: Optional[Dict[str, str]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ - - name: str - """Name of the ledger event handler.""" - - object: str - - updated_at: datetime diff --git a/src/modern_treasury/types/ledger_event_handler_delete_response.py b/src/modern_treasury/types/ledger_event_handler_delete_response.py deleted file mode 100644 index 5f439167..00000000 --- a/src/modern_treasury/types/ledger_event_handler_delete_response.py +++ /dev/null @@ -1,103 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Dict, List, Optional -from datetime import datetime - -from .._models import BaseModel - -__all__ = [ - "LedgerEventHandlerDeleteResponse", - "Conditions", - "LedgerTransactionTemplate", - "LedgerTransactionTemplateLedgerEntries", - "LedgerTransactionTemplateLedgerEntry", -] - - -class Conditions(BaseModel): - field: str - """The field you're fetching from the `ledgerable_event`.""" - - operator: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ - - value: str - """What raw string you are comparing the `field` against.""" - - -class LedgerTransactionTemplateLedgerEntry(BaseModel): - amount: str - """The field you're fetching from the `ledgerable_event`.""" - - direction: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ - - ledger_account_id: str - """What raw string you are comparing the `field` against.""" - - -LedgerTransactionTemplateLedgerEntries = LedgerTransactionTemplateLedgerEntry -"""This type is deprecated and will be removed in a future release. - -Please use LedgerTransactionTemplateLedgerEntry instead. -""" - - -class LedgerTransactionTemplate(BaseModel): - description: Optional[str] - """An optional description for internal use.""" - - effective_at: Optional[datetime] - """ - The timestamp (ISO8601 format) at which the ledger transaction happened for - reporting purposes. - """ - - ledger_entries: List[LedgerTransactionTemplateLedgerEntry] - """An array of ledger entry objects.""" - - metadata: Optional[Dict[str, str]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ - - -class LedgerEventHandlerDeleteResponse(BaseModel): - id: str - - conditions: Optional[Conditions] - - created_at: datetime - - description: Optional[str] - """An optional description.""" - - discarded_at: Optional[datetime] - - ledger_transaction_template: LedgerTransactionTemplate - - 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: Optional[Dict[str, str]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ - - name: str - """Name of the ledger event handler.""" - - object: str - - updated_at: datetime diff --git a/src/modern_treasury/types/ledger_event_handler_retrieve_response.py b/src/modern_treasury/types/ledger_event_handler_retrieve_response.py deleted file mode 100644 index 19753bf1..00000000 --- a/src/modern_treasury/types/ledger_event_handler_retrieve_response.py +++ /dev/null @@ -1,103 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. - -from typing import Dict, List, Optional -from datetime import datetime - -from .._models import BaseModel - -__all__ = [ - "LedgerEventHandlerRetrieveResponse", - "Conditions", - "LedgerTransactionTemplate", - "LedgerTransactionTemplateLedgerEntries", - "LedgerTransactionTemplateLedgerEntry", -] - - -class Conditions(BaseModel): - field: str - """The field you're fetching from the `ledgerable_event`.""" - - operator: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ - - value: str - """What raw string you are comparing the `field` against.""" - - -class LedgerTransactionTemplateLedgerEntry(BaseModel): - amount: str - """The field you're fetching from the `ledgerable_event`.""" - - direction: str - """What the operator between the `field` and `value` is. - - Currently only supports `equals`. - """ - - ledger_account_id: str - """What raw string you are comparing the `field` against.""" - - -LedgerTransactionTemplateLedgerEntries = LedgerTransactionTemplateLedgerEntry -"""This type is deprecated and will be removed in a future release. - -Please use LedgerTransactionTemplateLedgerEntry instead. -""" - - -class LedgerTransactionTemplate(BaseModel): - description: Optional[str] - """An optional description for internal use.""" - - effective_at: Optional[datetime] - """ - The timestamp (ISO8601 format) at which the ledger transaction happened for - reporting purposes. - """ - - ledger_entries: List[LedgerTransactionTemplateLedgerEntry] - """An array of ledger entry objects.""" - - metadata: Optional[Dict[str, str]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ - - -class LedgerEventHandlerRetrieveResponse(BaseModel): - id: str - - conditions: Optional[Conditions] - - created_at: datetime - - description: Optional[str] - """An optional description.""" - - discarded_at: Optional[datetime] - - ledger_transaction_template: LedgerTransactionTemplate - - 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: Optional[Dict[str, str]] - """Additional data represented as key-value pairs. - - Both the key and value must be strings. - """ - - name: str - """Name of the ledger event handler.""" - - object: str - - updated_at: datetime diff --git a/src/modern_treasury/types/ledger_event_handler_variable.py b/src/modern_treasury/types/ledger_event_handler_variable.py new file mode 100644 index 00000000..b40c0256 --- /dev/null +++ b/src/modern_treasury/types/ledger_event_handler_variable.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. + +from .._models import BaseModel + +__all__ = ["LedgerEventHandlerVariable", "Query"] + + +class Query(BaseModel): + field: str + """The LHS of the conditional.""" + + operator: str + """What the operator between the `field` and `value` is.""" + + value: str + """The RHS of the conditional.""" + + +class LedgerEventHandlerVariable(BaseModel): + query: Query + + type: str + """The type of object this variable is. + + Currently, only "ledger_account" is supported. + """ diff --git a/src/modern_treasury/types/ledger_event_handler_variable_param.py b/src/modern_treasury/types/ledger_event_handler_variable_param.py new file mode 100644 index 00000000..1564d44c --- /dev/null +++ b/src/modern_treasury/types/ledger_event_handler_variable_param.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["LedgerEventHandlerVariableParam", "Query"] + + +class Query(TypedDict, total=False): + field: Required[str] + """The LHS of the conditional.""" + + operator: Required[str] + """What the operator between the `field` and `value` is.""" + + value: Required[str] + """The RHS of the conditional.""" + + +class LedgerEventHandlerVariableParam(TypedDict, total=False): + query: Required[Query] + + type: Required[str] + """The type of object this variable is. + + Currently, only "ledger_account" is supported. + """ diff --git a/src/modern_treasury/types/ledger_transaction.py b/src/modern_treasury/types/ledger_transaction.py index 8c8b573b..0bf50b5e 100644 --- a/src/modern_treasury/types/ledger_transaction.py +++ b/src/modern_treasury/types/ledger_transaction.py @@ -82,7 +82,7 @@ class LedgerTransaction(BaseModel): object: str - posted_at: Optional[str] + posted_at: Optional[datetime] """The time on which the ledger transaction posted. This is null if the ledger transaction is pending. diff --git a/src/modern_treasury/types/ledger_transaction_list_params.py b/src/modern_treasury/types/ledger_transaction_list_params.py index 13ca3d3a..3339b9f9 100644 --- a/src/modern_treasury/types/ledger_transaction_list_params.py +++ b/src/modern_treasury/types/ledger_transaction_list_params.py @@ -18,7 +18,7 @@ class LedgerTransactionListParams(TypedDict, total=False): after_cursor: Optional[str] - effective_at: Dict[str, str] + effective_at: Dict[str, Union[str, datetime]] """ Use "gt" (>), "gte" (>=), "lt" (<), "lte" (<=), or "eq" (=) to filter by effective at. For example, for all transactions after Jan 1 2000, use diff --git a/src/modern_treasury/types/ledger_transactions/ledger_transaction_version.py b/src/modern_treasury/types/ledger_transactions/ledger_transaction_version.py index ba6597c1..1c0dfbad 100644 --- a/src/modern_treasury/types/ledger_transactions/ledger_transaction_version.py +++ b/src/modern_treasury/types/ledger_transactions/ledger_transaction_version.py @@ -262,7 +262,7 @@ class LedgerTransactionVersion(BaseModel): object: str - posted_at: Optional[str] + posted_at: Optional[datetime] """The time on which the ledger transaction posted. This is null if the ledger transaction is pending. diff --git a/src/modern_treasury/types/ledgerable_event.py b/src/modern_treasury/types/ledgerable_event.py index 21b860dc..bf1ae95e 100644 --- a/src/modern_treasury/types/ledgerable_event.py +++ b/src/modern_treasury/types/ledgerable_event.py @@ -12,32 +12,14 @@ class LedgerableEvent(BaseModel): id: str - amount: int - """Value in specified currency's smallest unit. - - e.g. $10 would be represented as 1000. - """ - created_at: datetime - currency: str - """An ISO 4217 conformed currency or a custom currency.""" - - currency_exponent: Optional[int] - """Must be included if currency is a custom currency. - - The currency_exponent cannot exceed 30. - """ - custom_data: Optional[builtins.object] """Additionally data to be used by the Ledger Event Handler.""" description: Optional[str] """Description of the ledgerable event.""" - direction: Optional[str] - """One of `credit`, `debit`.""" - ledger_event_handler_id: str """Id of the ledger event handler that is used to create a ledger transaction.""" diff --git a/src/modern_treasury/types/ledgerable_event_create_params.py b/src/modern_treasury/types/ledgerable_event_create_params.py index 973b21dd..8a9b20ff 100644 --- a/src/modern_treasury/types/ledgerable_event_create_params.py +++ b/src/modern_treasury/types/ledgerable_event_create_params.py @@ -9,33 +9,15 @@ class LedgerableEventCreateParams(TypedDict, total=False): - amount: Required[int] - """Value in specified currency's smallest unit. - - e.g. $10 would be represented as 1000. - """ - name: Required[str] """Name of the ledgerable event.""" - currency: Optional[str] - """An ISO 4217 conformed currency or a custom currency.""" - - currency_exponent: Optional[int] - """Must be included if currency is a custom currency. - - The currency_exponent cannot exceed 30. - """ - custom_data: Optional[object] """Additionally data to be used by the Ledger Event Handler.""" description: Optional[str] """Description of the ledgerable event.""" - direction: Optional[str] - """One of `credit`, `debit`.""" - metadata: Dict[str, str] """Additional data represented as key-value pairs. diff --git a/src/modern_treasury/types/payment_order.py b/src/modern_treasury/types/payment_order.py index f2ec3e25..8d73f392 100644 --- a/src/modern_treasury/types/payment_order.py +++ b/src/modern_treasury/types/payment_order.py @@ -3,17 +3,19 @@ from __future__ import annotations import builtins -from typing import Dict, List, Optional +from typing import Dict, List, Union, Optional from datetime import date, datetime from typing_extensions import Literal from .shared import Currency from .._compat import PYDANTIC_V2 from .._models import BaseModel +from .virtual_account import VirtualAccount +from .internal_account import InternalAccount from .payment_order_type import PaymentOrderType from .payment_order_subtype import PaymentOrderSubtype -__all__ = ["PaymentOrder", "Accounting", "ReferenceNumbers", "ReferenceNumber"] +__all__ = ["PaymentOrder", "Accounting", "ReferenceNumbers", "ReferenceNumber", "UltimateOriginatingAccount"] class Accounting(BaseModel): @@ -117,6 +119,8 @@ class ReferenceNumber(BaseModel): Please use ReferenceNumber instead. """ +UltimateOriginatingAccount = Union[VirtualAccount, InternalAccount, None] + class PaymentOrder(BaseModel): id: str @@ -336,10 +340,24 @@ class PaymentOrder(BaseModel): type: PaymentOrderType """ One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. + """ + + ultimate_originating_account: UltimateOriginatingAccount + """The account to which the originating of this payment should be attributed to. + + Can be a `virtual_account` or `internal_account`. """ + ultimate_originating_account_id: Optional[str] + """The ultimate originating account ID. + + Can be a `virtual_account` or `internal_account`. + """ + + ultimate_originating_account_type: Optional[Literal["internal_account", "virtual_account"]] + ultimate_originating_party_identifier: Optional[str] """Identifier of the ultimate originator of the payment order.""" 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 a9830959..25ac4004 100644 --- a/src/modern_treasury/types/payment_order_create_async_params.py +++ b/src/modern_treasury/types/payment_order_create_async_params.py @@ -55,8 +55,8 @@ class PaymentOrderCreateAsyncParams(TypedDict, total=False): type: Required[PaymentOrderType] """ One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. """ accounting: Accounting @@ -501,8 +501,10 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "my_branch_code", + "nz_national_clearing_code", "swift", "jp_zengin_code", ] @@ -511,22 +513,24 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): payment_type: Literal[ "ach", "au_becs", - "se_bankgirot", "bacs", "book", "card", + "chats", "check", - "eft", "cross_border", + "eft", "interac", "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", + "se_bankgirot", "sen", - "sic", "sepa", + "sic", "signet", "wire", "zengin", diff --git a/src/modern_treasury/types/payment_order_create_params.py b/src/modern_treasury/types/payment_order_create_params.py index 96b1517f..7e6b51bc 100644 --- a/src/modern_treasury/types/payment_order_create_params.py +++ b/src/modern_treasury/types/payment_order_create_params.py @@ -58,8 +58,8 @@ class PaymentOrderCreateParams(TypedDict, total=False): type: Required[PaymentOrderType] """ One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. """ accounting: Accounting @@ -267,6 +267,7 @@ class Document(TypedDict, total=False): "counterparties", "expected_payments", "external_accounts", + "incoming_payment_details", "internal_accounts", "organizations", "paper_items", @@ -544,8 +545,10 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "my_branch_code", + "nz_national_clearing_code", "swift", "jp_zengin_code", ] @@ -554,22 +557,24 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): payment_type: Literal[ "ach", "au_becs", - "se_bankgirot", "bacs", "book", "card", + "chats", "check", - "eft", "cross_border", + "eft", "interac", "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", + "se_bankgirot", "sen", - "sic", "sepa", + "sic", "signet", "wire", "zengin", diff --git a/src/modern_treasury/types/payment_order_list_params.py b/src/modern_treasury/types/payment_order_list_params.py index 9dfc144c..e41cbb05 100644 --- a/src/modern_treasury/types/payment_order_list_params.py +++ b/src/modern_treasury/types/payment_order_list_params.py @@ -70,6 +70,7 @@ class PaymentOrderListParams(TypedDict, total=False): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -77,6 +78,7 @@ class PaymentOrderListParams(TypedDict, total=False): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/payment_order_type.py b/src/modern_treasury/types/payment_order_type.py index 8b09e563..f73bee60 100644 --- a/src/modern_treasury/types/payment_order_type.py +++ b/src/modern_treasury/types/payment_order_type.py @@ -10,6 +10,7 @@ "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -17,6 +18,7 @@ "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/payment_order_update_params.py b/src/modern_treasury/types/payment_order_update_params.py index 76292963..439b1cd6 100644 --- a/src/modern_treasury/types/payment_order_update_params.py +++ b/src/modern_treasury/types/payment_order_update_params.py @@ -218,8 +218,8 @@ class PaymentOrderUpdateParams(TypedDict, total=False): type: PaymentOrderType """ One of `ach`, `bankgirot`, `eft`, `wire`, `check`, `sen`, `book`, `rtp`, `sepa`, - `bacs`, `au_becs`, `interac`, `neft`, `nics`, `sic`, `signet`, `provexchange`, - `zengin`. + `bacs`, `au_becs`, `interac`, `neft`, `nics`, `nz_national_clearing_code`, + `sic`, `signet`, `provexchange`, `zengin`. """ ultimate_originating_party_identifier: Optional[str] @@ -395,8 +395,10 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "my_branch_code", + "nz_national_clearing_code", "swift", "jp_zengin_code", ] @@ -405,22 +407,24 @@ class ReceivingAccountRoutingDetail(TypedDict, total=False): payment_type: Literal[ "ach", "au_becs", - "se_bankgirot", "bacs", "book", "card", + "chats", "check", - "eft", "cross_border", + "eft", "interac", "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", + "se_bankgirot", "sen", - "sic", "sepa", + "sic", "signet", "wire", "zengin", diff --git a/src/modern_treasury/types/return_object.py b/src/modern_treasury/types/return_object.py index 4c88544b..06b52dc3 100644 --- a/src/modern_treasury/types/return_object.py +++ b/src/modern_treasury/types/return_object.py @@ -101,12 +101,6 @@ class ReferenceNumber(BaseModel): class ReturnObject(BaseModel): id: str - additional_information: Optional[str] - """Some returns may include additional information from the bank. - - In these cases, this string will be present. - """ - amount: int """Value in specified currency's smallest unit. @@ -237,6 +231,12 @@ class ReturnObject(BaseModel): updated_at: datetime + additional_information: Optional[str] = None + """Some returns may include additional information from the bank. + + In these cases, this string will be present. + """ + if PYDANTIC_V2: ReturnObject.model_rebuild() diff --git a/src/modern_treasury/types/routing_detail.py b/src/modern_treasury/types/routing_detail.py index f4d00b8f..7d7f7294 100644 --- a/src/modern_treasury/types/routing_detail.py +++ b/src/modern_treasury/types/routing_detail.py @@ -68,6 +68,7 @@ class RoutingDetail(BaseModel): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -75,6 +76,7 @@ class RoutingDetail(BaseModel): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -102,12 +104,18 @@ class RoutingDetail(BaseModel): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] - """One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.""" + """The type of routing number. + + See https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. + """ updated_at: datetime diff --git a/src/modern_treasury/types/routing_detail_create_params.py b/src/modern_treasury/types/routing_detail_create_params.py index 5214e32f..65a2980f 100644 --- a/src/modern_treasury/types/routing_detail_create_params.py +++ b/src/modern_treasury/types/routing_detail_create_params.py @@ -23,14 +23,20 @@ class RoutingDetailCreateParams(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] ] - """One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.""" + """The type of routing number. + + See https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. + """ payment_type: Optional[ Literal[ @@ -39,6 +45,7 @@ class RoutingDetailCreateParams(TypedDict, total=False): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -46,6 +53,7 @@ class RoutingDetailCreateParams(TypedDict, total=False): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/routing_number_lookup_request.py b/src/modern_treasury/types/routing_number_lookup_request.py index 3050143c..a1983f0b 100644 --- a/src/modern_treasury/types/routing_number_lookup_request.py +++ b/src/modern_treasury/types/routing_number_lookup_request.py @@ -37,13 +37,22 @@ class RoutingNumberLookupRequest(BaseModel): """The routing number of the bank.""" routing_number_type: Optional[ - Literal["aba", "au_bsb", "ca_cpa", "gb_sort_code", "in_ifsc", "se_bankgiro_clearing_code", "swift"] + Literal[ + "aba", + "au_bsb", + "ca_cpa", + "gb_sort_code", + "in_ifsc", + "nz_national_clearing_code", + "se_bankgiro_clearing_code", + "swift", + ] ] = None - """ - One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox - mode we currently only support `aba` and `swift` with routing numbers - '123456789' and 'GRINUST0XXX' respectively. + """The type of routing number. + + See https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. In sandbox mode we currently only support `aba` and `swift` with + routing numbers '123456789' and 'GRINUST0XXX' respectively. """ sanctions: Optional[Dict[str, object]] = None @@ -61,6 +70,7 @@ class RoutingNumberLookupRequest(BaseModel): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -68,6 +78,7 @@ class RoutingNumberLookupRequest(BaseModel): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/src/modern_treasury/types/transaction.py b/src/modern_treasury/types/transaction.py index 82120585..7af62ac9 100644 --- a/src/modern_treasury/types/transaction.py +++ b/src/modern_treasury/types/transaction.py @@ -34,17 +34,6 @@ class Transaction(BaseModel): currency: Optional[Currency] """Currency that this transaction is denominated in.""" - details: Dict[str, str] - """ - This field contains additional information that the bank provided about the - transaction. This is structured data. Some of the data in here might overlap - with what is in the `vendor_description`. For example, the OBI could be a part - of the vendor description, and it would also be included in here. The attributes - that are passed through the details field will vary based on your banking - partner. Currently, the following keys may be in the details object: - `originator_name`, `originator_to_beneficiary_information`. - """ - direction: str """Either `credit` or `debit`.""" @@ -83,6 +72,7 @@ class Transaction(BaseModel): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -90,6 +80,7 @@ class Transaction(BaseModel): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", @@ -147,11 +138,22 @@ class Transaction(BaseModel): vendor_customer_id: Optional[str] """An identifier given to this transaction by the bank, often `null`.""" - vendor_description: Optional[str] + vendor_id: Optional[str] + """An identifier given to this transaction by the bank.""" + + details: Optional[Dict[str, str]] = None + """ + This field contains additional information that the bank provided about the + transaction. This is structured data. Some of the data in here might overlap + with what is in the `vendor_description`. For example, the OBI could be a part + of the vendor description, and it would also be included in here. The attributes + that are passed through the details field will vary based on your banking + partner. Currently, the following keys may be in the details object: + `originator_name`, `originator_to_beneficiary_information`. + """ + + vendor_description: Optional[str] = None """ The transaction detail text that often appears in on your bank statement and in your banking portal. """ - - vendor_id: Optional[str] - """An identifier given to this transaction by the bank.""" diff --git a/src/modern_treasury/types/transactions/transaction_line_item.py b/src/modern_treasury/types/transactions/transaction_line_item.py index 784b1f6d..de2a83fa 100644 --- a/src/modern_treasury/types/transactions/transaction_line_item.py +++ b/src/modern_treasury/types/transactions/transaction_line_item.py @@ -45,6 +45,12 @@ class TransactionLineItem(BaseModel): object: str + reconcilable: bool + """ + Describes whether this line item should be counted towards the corresponding + transaction’s reconciliation. + """ + transactable_id: Optional[str] """ If a matching object exists in Modern Treasury, the ID will be populated here, 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 6ad0dcbc..f8ce9035 100644 --- a/src/modern_treasury/types/validation_validate_routing_number_params.py +++ b/src/modern_treasury/types/validation_validate_routing_number_params.py @@ -20,16 +20,18 @@ class ValidationValidateRoutingNumberParams(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] ] - """ - One of `aba`, `au_bsb`, `br_codigo`, `ca_cpa`, `cnaps`, `gb_sort_code`, - `in_ifsc`, `my_branch_code`, `se_bankgiro_clearing_code`, or `swift`. In sandbox - mode we currently only support `aba` and `swift` with routing numbers - '123456789' and 'GRINUST0XXX' respectively. + """The type of routing number. + + See https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. In sandbox mode we currently only support `aba` and `swift` with + routing numbers '123456789' and 'GRINUST0XXX' respectively. """ diff --git a/src/modern_treasury/types/virtual_account_create_params.py b/src/modern_treasury/types/virtual_account_create_params.py index 7c38173d..049a7369 100644 --- a/src/modern_treasury/types/virtual_account_create_params.py +++ b/src/modern_treasury/types/virtual_account_create_params.py @@ -79,14 +79,20 @@ class RoutingDetail(TypedDict, total=False): "chips", "cnaps", "gb_sort_code", + "hk_interbank_clearing_code", "in_ifsc", "jp_zengin_code", "my_branch_code", + "nz_national_clearing_code", "se_bankgiro_clearing_code", "swift", ] ] - """One of `aba`, `swift`, `ca_cpa`, `au_bsb`, `gb_sort_code`, `in_ifsc`, `cnaps`.""" + """The type of routing number. + + See https://docs.moderntreasury.com/platform/reference/routing-detail-object for + more details. + """ payment_type: Optional[ Literal[ @@ -95,6 +101,7 @@ class RoutingDetail(TypedDict, total=False): "bacs", "book", "card", + "chats", "check", "cross_border", "eft", @@ -102,6 +109,7 @@ class RoutingDetail(TypedDict, total=False): "masav", "neft", "nics", + "nz_becs", "provxchange", "rtp", "se_bankgirot", diff --git a/tests/api_resources/payment_orders/test_reversals.py b/tests/api_resources/payment_orders/test_reversals.py index a63fec54..1a5a416e 100644 --- a/tests/api_resources/payment_orders/test_reversals.py +++ b/tests/api_resources/payment_orders/test_reversals.py @@ -29,7 +29,7 @@ class TestReversals: @parametrize def test_method_create(self, client: ModernTreasury) -> None: reversal = client.payment_orders.reversals.create( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", reason="duplicate", ) assert_matches_type(Reversal, reversal, path=["response"]) @@ -37,7 +37,7 @@ def test_method_create(self, client: ModernTreasury) -> None: @parametrize def test_method_create_with_all_params(self, client: ModernTreasury) -> None: reversal = client.payment_orders.reversals.create( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", reason="duplicate", ledger_transaction={ "description": "string", @@ -111,8 +111,8 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: @parametrize def test_method_retrieve(self, client: ModernTreasury) -> None: reversal = client.payment_orders.reversals.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - payment_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", + payment_order_id="string", ) assert_matches_type(Reversal, reversal, path=["response"]) @@ -145,7 +145,7 @@ class TestAsyncReversals: @parametrize async def test_method_create(self, client: AsyncModernTreasury) -> None: reversal = await client.payment_orders.reversals.create( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", reason="duplicate", ) assert_matches_type(Reversal, reversal, path=["response"]) @@ -153,7 +153,7 @@ async def test_method_create(self, client: AsyncModernTreasury) -> None: @parametrize async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: reversal = await client.payment_orders.reversals.create( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", reason="duplicate", ledger_transaction={ "description": "string", @@ -227,8 +227,8 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) @parametrize async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: reversal = await client.payment_orders.reversals.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - payment_order_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", + payment_order_id="string", ) assert_matches_type(Reversal, reversal, path=["response"]) diff --git a/tests/api_resources/test_connections.py b/tests/api_resources/test_connections.py index a244c7a7..abaac2b0 100644 --- a/tests/api_resources/test_connections.py +++ b/tests/api_resources/test_connections.py @@ -36,7 +36,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: after_cursor="string", entity="string", per_page=0, - vendor_customer_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + vendor_customer_id="string", ) assert_matches_type(SyncPage[Connection], connection, path=["response"]) @@ -61,6 +61,6 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> after_cursor="string", entity="string", per_page=0, - vendor_customer_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + vendor_customer_id="string", ) assert_matches_type(AsyncPage[Connection], connection, path=["response"]) diff --git a/tests/api_resources/test_documents.py b/tests/api_resources/test_documents.py index e99bcfdf..370d46b9 100644 --- a/tests/api_resources/test_documents.py +++ b/tests/api_resources/test_documents.py @@ -47,7 +47,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: @parametrize def test_method_retrieve(self, client: ModernTreasury) -> None: document = client.documents.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", ) assert_matches_type(Document, document, path=["response"]) @@ -98,7 +98,7 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) @parametrize async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: document = await client.documents.retrieve( - "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + "string", ) assert_matches_type(Document, document, path=["response"]) diff --git a/tests/api_resources/test_expected_payments.py b/tests/api_resources/test_expected_payments.py index c71c7e06..064b5f99 100644 --- a/tests/api_resources/test_expected_payments.py +++ b/tests/api_resources/test_expected_payments.py @@ -87,6 +87,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: }, reconciliation_filters={}, reconciliation_groups={}, + reconciliation_rule_variables=[{}, {}, {}], remittance_information="string", statement_descriptor="string", type="ach", @@ -127,6 +128,7 @@ def test_method_update_with_all_params(self, client: ModernTreasury) -> None: }, reconciliation_filters={}, reconciliation_groups={}, + reconciliation_rule_variables=[{}, {}, {}], remittance_information="string", statement_descriptor="string", type="ach", @@ -232,6 +234,7 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) }, reconciliation_filters={}, reconciliation_groups={}, + reconciliation_rule_variables=[{}, {}, {}], remittance_information="string", statement_descriptor="string", type="ach", @@ -272,6 +275,7 @@ async def test_method_update_with_all_params(self, client: AsyncModernTreasury) }, reconciliation_filters={}, reconciliation_groups={}, + reconciliation_rule_variables=[{}, {}, {}], remittance_information="string", statement_descriptor="string", type="ach", diff --git a/tests/api_resources/test_ledger_account_payouts.py b/tests/api_resources/test_ledger_account_payouts.py index f56239b9..175e6dde 100644 --- a/tests/api_resources/test_ledger_account_payouts.py +++ b/tests/api_resources/test_ledger_account_payouts.py @@ -38,6 +38,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: ledger_account_payout = client.ledger_account_payouts.create( funding_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", payout_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + allow_either_direction=True, description="string", effective_at_upper_bound="14:15:22Z", metadata={ @@ -89,6 +90,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: id=["string", "string", "string"], after_cursor="string", metadata={"foo": "string"}, + payout_entry_direction="string", payout_ledger_account_id="string", per_page=0, ) @@ -125,6 +127,7 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) ledger_account_payout = await client.ledger_account_payouts.create( funding_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", payout_ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + allow_either_direction=True, description="string", effective_at_upper_bound="14:15:22Z", metadata={ @@ -176,6 +179,7 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> id=["string", "string", "string"], after_cursor="string", metadata={"foo": "string"}, + payout_entry_direction="string", payout_ledger_account_id="string", per_page=0, ) diff --git a/tests/api_resources/test_ledger_account_statements.py b/tests/api_resources/test_ledger_account_statements.py index cdb64ebc..4936ef2d 100644 --- a/tests/api_resources/test_ledger_account_statements.py +++ b/tests/api_resources/test_ledger_account_statements.py @@ -12,6 +12,7 @@ LedgerAccountStatementCreateResponse, LedgerAccountStatementRetrieveResponse, ) +from modern_treasury._utils import parse_datetime base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") api_key = "My API Key" @@ -31,8 +32,8 @@ class TestLedgerAccountStatements: @parametrize def test_method_create(self, client: ModernTreasury) -> None: ledger_account_statement = client.ledger_account_statements.create( - effective_at_lower_bound="string", - effective_at_upper_bound="string", + effective_at_lower_bound=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_at_upper_bound=parse_datetime("2019-12-27T18:11:19.117Z"), ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(LedgerAccountStatementCreateResponse, ledger_account_statement, path=["response"]) @@ -41,8 +42,8 @@ def test_method_create(self, client: ModernTreasury) -> None: @parametrize def test_method_create_with_all_params(self, client: ModernTreasury) -> None: ledger_account_statement = client.ledger_account_statements.create( - effective_at_lower_bound="string", - effective_at_upper_bound="string", + effective_at_lower_bound=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_at_upper_bound=parse_datetime("2019-12-27T18:11:19.117Z"), ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", description="string", metadata={ @@ -74,8 +75,8 @@ class TestAsyncLedgerAccountStatements: @parametrize async def test_method_create(self, client: AsyncModernTreasury) -> None: ledger_account_statement = await client.ledger_account_statements.create( - effective_at_lower_bound="string", - effective_at_upper_bound="string", + effective_at_lower_bound=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_at_upper_bound=parse_datetime("2019-12-27T18:11:19.117Z"), ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(LedgerAccountStatementCreateResponse, ledger_account_statement, path=["response"]) @@ -84,8 +85,8 @@ async def test_method_create(self, client: AsyncModernTreasury) -> None: @parametrize async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: ledger_account_statement = await client.ledger_account_statements.create( - effective_at_lower_bound="string", - effective_at_upper_bound="string", + effective_at_lower_bound=parse_datetime("2019-12-27T18:11:19.117Z"), + effective_at_upper_bound=parse_datetime("2019-12-27T18:11:19.117Z"), ledger_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", description="string", metadata={ diff --git a/tests/api_resources/test_ledger_event_handlers.py b/tests/api_resources/test_ledger_event_handlers.py index 0785e209..aa2790bf 100644 --- a/tests/api_resources/test_ledger_event_handlers.py +++ b/tests/api_resources/test_ledger_event_handlers.py @@ -8,12 +8,7 @@ from tests.utils import assert_matches_type from modern_treasury import ModernTreasury, AsyncModernTreasury -from modern_treasury.types import ( - LedgerEventHandlerListResponse, - LedgerEventHandlerCreateResponse, - LedgerEventHandlerDeleteResponse, - LedgerEventHandlerRetrieveResponse, -) +from modern_treasury.types import LedgerEventHandler from modern_treasury._utils import parse_datetime from modern_treasury.pagination import SyncPage, AsyncPage @@ -35,8 +30,9 @@ class TestLedgerEventHandlers: def test_method_create(self, client: ModernTreasury) -> None: ledger_event_handler = client.ledger_event_handlers.create( ledger_transaction_template={ - "description": "string", - "effective_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "description": "My Ledger Transaction Template Description", + "effective_at": "{{ledgerable_event.custom_data.effective_at}}", + "status": "posted", "ledger_entries": [ { "amount": "string", @@ -54,22 +50,18 @@ def test_method_create(self, client: ModernTreasury) -> None: "ledger_account_id": "string", }, ], - "metadata": { - "key": "value", - "foo": "bar", - "modern": "treasury", - }, }, name="string", ) - assert_matches_type(LedgerEventHandlerCreateResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: ModernTreasury) -> None: ledger_event_handler = client.ledger_event_handlers.create( ledger_transaction_template={ - "description": "string", - "effective_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "description": "My Ledger Transaction Template Description", + "effective_at": "{{ledgerable_event.custom_data.effective_at}}", + "status": "posted", "ledger_entries": [ { "amount": "string", @@ -87,17 +79,12 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "ledger_account_id": "string", }, ], - "metadata": { - "key": "value", - "foo": "bar", - "modern": "treasury", - }, }, name="string", conditions={ - "field": "string", - "operator": "string", - "value": "string", + "field": "ledgerable_event.name", + "operator": "equals", + "value": "credit_card_swipe", }, description="string", ledger_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -106,20 +93,30 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "foo": "bar", "modern": "treasury", }, + variables={ + "credit_account": { + "type": "ledger_account", + "query": { + "field": "name", + "operator": "equals", + "value": "my_credit_account", + }, + } + }, ) - assert_matches_type(LedgerEventHandlerCreateResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) @parametrize def test_method_retrieve(self, client: ModernTreasury) -> None: ledger_event_handler = client.ledger_event_handlers.retrieve( "string", ) - assert_matches_type(LedgerEventHandlerRetrieveResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) @parametrize def test_method_list(self, client: ModernTreasury) -> None: ledger_event_handler = client.ledger_event_handlers.list() - assert_matches_type(SyncPage[LedgerEventHandlerListResponse], ledger_event_handler, path=["response"]) + assert_matches_type(SyncPage[LedgerEventHandler], ledger_event_handler, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: ModernTreasury) -> None: @@ -130,14 +127,14 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: name="string", per_page=0, ) - assert_matches_type(SyncPage[LedgerEventHandlerListResponse], ledger_event_handler, path=["response"]) + assert_matches_type(SyncPage[LedgerEventHandler], ledger_event_handler, path=["response"]) @parametrize def test_method_delete(self, client: ModernTreasury) -> None: ledger_event_handler = client.ledger_event_handlers.delete( "string", ) - assert_matches_type(LedgerEventHandlerDeleteResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) class TestAsyncLedgerEventHandlers: @@ -153,8 +150,9 @@ class TestAsyncLedgerEventHandlers: async def test_method_create(self, client: AsyncModernTreasury) -> None: ledger_event_handler = await client.ledger_event_handlers.create( ledger_transaction_template={ - "description": "string", - "effective_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "description": "My Ledger Transaction Template Description", + "effective_at": "{{ledgerable_event.custom_data.effective_at}}", + "status": "posted", "ledger_entries": [ { "amount": "string", @@ -172,22 +170,18 @@ async def test_method_create(self, client: AsyncModernTreasury) -> None: "ledger_account_id": "string", }, ], - "metadata": { - "key": "value", - "foo": "bar", - "modern": "treasury", - }, }, name="string", ) - assert_matches_type(LedgerEventHandlerCreateResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) @parametrize async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: ledger_event_handler = await client.ledger_event_handlers.create( ledger_transaction_template={ - "description": "string", - "effective_at": parse_datetime("2019-12-27T18:11:19.117Z"), + "description": "My Ledger Transaction Template Description", + "effective_at": "{{ledgerable_event.custom_data.effective_at}}", + "status": "posted", "ledger_entries": [ { "amount": "string", @@ -205,17 +199,12 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) "ledger_account_id": "string", }, ], - "metadata": { - "key": "value", - "foo": "bar", - "modern": "treasury", - }, }, name="string", conditions={ - "field": "string", - "operator": "string", - "value": "string", + "field": "ledgerable_event.name", + "operator": "equals", + "value": "credit_card_swipe", }, description="string", ledger_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", @@ -224,20 +213,30 @@ async def test_method_create_with_all_params(self, client: AsyncModernTreasury) "foo": "bar", "modern": "treasury", }, + variables={ + "credit_account": { + "type": "ledger_account", + "query": { + "field": "name", + "operator": "equals", + "value": "my_credit_account", + }, + } + }, ) - assert_matches_type(LedgerEventHandlerCreateResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) @parametrize async def test_method_retrieve(self, client: AsyncModernTreasury) -> None: ledger_event_handler = await client.ledger_event_handlers.retrieve( "string", ) - assert_matches_type(LedgerEventHandlerRetrieveResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) @parametrize async def test_method_list(self, client: AsyncModernTreasury) -> None: ledger_event_handler = await client.ledger_event_handlers.list() - assert_matches_type(AsyncPage[LedgerEventHandlerListResponse], ledger_event_handler, path=["response"]) + assert_matches_type(AsyncPage[LedgerEventHandler], ledger_event_handler, path=["response"]) @parametrize async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> None: @@ -248,11 +247,11 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> name="string", per_page=0, ) - assert_matches_type(AsyncPage[LedgerEventHandlerListResponse], ledger_event_handler, path=["response"]) + assert_matches_type(AsyncPage[LedgerEventHandler], ledger_event_handler, path=["response"]) @parametrize async def test_method_delete(self, client: AsyncModernTreasury) -> None: ledger_event_handler = await client.ledger_event_handlers.delete( "string", ) - assert_matches_type(LedgerEventHandlerDeleteResponse, ledger_event_handler, path=["response"]) + assert_matches_type(LedgerEventHandler, ledger_event_handler, path=["response"]) diff --git a/tests/api_resources/test_ledger_transactions.py b/tests/api_resources/test_ledger_transactions.py index bf1d135e..cdc19066 100644 --- a/tests/api_resources/test_ledger_transactions.py +++ b/tests/api_resources/test_ledger_transactions.py @@ -200,7 +200,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: ledger_transaction = client.ledger_transactions.list( id=["string", "string", "string"], after_cursor="string", - effective_at={"foo": "string"}, + effective_at={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, effective_date={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, external_id="string", ledger_account_category_id="string", @@ -431,7 +431,7 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> ledger_transaction = await client.ledger_transactions.list( id=["string", "string", "string"], after_cursor="string", - effective_at={"foo": "string"}, + effective_at={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, effective_date={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, external_id="string", ledger_account_category_id="string", diff --git a/tests/api_resources/test_ledgerable_events.py b/tests/api_resources/test_ledgerable_events.py index 792d55c9..1847121e 100644 --- a/tests/api_resources/test_ledgerable_events.py +++ b/tests/api_resources/test_ledgerable_events.py @@ -27,7 +27,6 @@ class TestLedgerableEvents: @parametrize def test_method_create(self, client: ModernTreasury) -> None: ledgerable_event = client.ledgerable_events.create( - amount=0, name="string", ) assert_matches_type(LedgerableEvent, ledgerable_event, path=["response"]) @@ -35,13 +34,9 @@ def test_method_create(self, client: ModernTreasury) -> None: @parametrize def test_method_create_with_all_params(self, client: ModernTreasury) -> None: ledgerable_event = client.ledgerable_events.create( - amount=0, name="string", - currency="string", - currency_exponent=0, custom_data={}, description="string", - direction="string", metadata={ "key": "value", "foo": "bar", @@ -70,7 +65,6 @@ class TestAsyncLedgerableEvents: @parametrize async def test_method_create(self, client: AsyncModernTreasury) -> None: ledgerable_event = await client.ledgerable_events.create( - amount=0, name="string", ) assert_matches_type(LedgerableEvent, ledgerable_event, path=["response"]) @@ -78,13 +72,9 @@ async def test_method_create(self, client: AsyncModernTreasury) -> None: @parametrize async def test_method_create_with_all_params(self, client: AsyncModernTreasury) -> None: ledgerable_event = await client.ledgerable_events.create( - amount=0, name="string", - currency="string", - currency_exponent=0, custom_data={}, description="string", - direction="string", metadata={ "key": "value", "foo": "bar", diff --git a/tests/api_resources/test_payment_orders.py b/tests/api_resources/test_payment_orders.py index 99145ff3..9bc06cb9 100644 --- a/tests/api_resources/test_payment_orders.py +++ b/tests/api_resources/test_payment_orders.py @@ -457,17 +457,17 @@ def test_method_list(self, client: ModernTreasury) -> None: def test_method_list_with_all_params(self, client: ModernTreasury) -> None: payment_order = client.payment_orders.list( after_cursor="string", - counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + counterparty_id="string", direction="credit", effective_date_end=parse_date("2019-12-27"), effective_date_start=parse_date("2019-12-27"), metadata={"foo": "string"}, - originating_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + originating_account_id="string", per_page=0, priority="high", reference_number="string", status="approved", - transaction_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + transaction_id="string", type="ach", ) assert_matches_type(SyncPage[PaymentOrder], payment_order, path=["response"]) @@ -1139,17 +1139,17 @@ async def test_method_list(self, client: AsyncModernTreasury) -> None: async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> None: payment_order = await client.payment_orders.list( after_cursor="string", - counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + counterparty_id="string", direction="credit", effective_date_end=parse_date("2019-12-27"), effective_date_start=parse_date("2019-12-27"), metadata={"foo": "string"}, - originating_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + originating_account_id="string", per_page=0, priority="high", reference_number="string", status="approved", - transaction_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + transaction_id="string", type="ach", ) assert_matches_type(AsyncPage[PaymentOrder], payment_order, path=["response"]) diff --git a/tests/api_resources/test_transactions.py b/tests/api_resources/test_transactions.py index 34788cc9..9d48e541 100644 --- a/tests/api_resources/test_transactions.py +++ b/tests/api_resources/test_transactions.py @@ -59,17 +59,17 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: after_cursor="string", as_of_date_end=parse_date("2019-12-27"), as_of_date_start=parse_date("2019-12-27"), - counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + counterparty_id="string", description="string", direction="string", - internal_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + internal_account_id="string", metadata={"foo": "string"}, payment_type="string", per_page=0, posted=True, transactable_type="string", vendor_id="string", - virtual_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + virtual_account_id="string", ) assert_matches_type(SyncPage[Transaction], transaction, path=["response"]) @@ -116,16 +116,16 @@ async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> after_cursor="string", as_of_date_end=parse_date("2019-12-27"), as_of_date_start=parse_date("2019-12-27"), - counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + counterparty_id="string", description="string", direction="string", - internal_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + internal_account_id="string", metadata={"foo": "string"}, payment_type="string", per_page=0, posted=True, transactable_type="string", vendor_id="string", - virtual_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + virtual_account_id="string", ) assert_matches_type(AsyncPage[Transaction], transaction, path=["response"]) diff --git a/tests/api_resources/test_virtual_accounts.py b/tests/api_resources/test_virtual_accounts.py index 390b27c2..6138c2d9 100644 --- a/tests/api_resources/test_virtual_accounts.py +++ b/tests/api_resources/test_virtual_accounts.py @@ -110,8 +110,8 @@ def test_method_list(self, client: ModernTreasury) -> None: def test_method_list_with_all_params(self, client: ModernTreasury) -> None: virtual_account = client.virtual_accounts.list( after_cursor="string", - counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - internal_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + counterparty_id="string", + internal_account_id="string", metadata={"foo": "string"}, per_page=0, ) @@ -219,8 +219,8 @@ async def test_method_list(self, client: AsyncModernTreasury) -> None: async def test_method_list_with_all_params(self, client: AsyncModernTreasury) -> None: virtual_account = await client.virtual_accounts.list( after_cursor="string", - counterparty_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - internal_account_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + counterparty_id="string", + internal_account_id="string", metadata={"foo": "string"}, per_page=0, )