Skip to content

Commit

Permalink
feat(api): updates (#475)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 1, 2024
1 parent 1baa3f7 commit e71c1fe
Show file tree
Hide file tree
Showing 32 changed files with 452 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 158
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury-b8e6b7422f42fdd348a261b4dbf7a2acd931dde684f6d1c8ce2120b0b325263e.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury-c27744e18a0ea38825b41f133bb8b61d41d3c6649d96ff605581a0000dc80f06.yml
8 changes: 6 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ Methods:
Types:

```python
from modern_treasury.types import ExternalAccount, ExternalAccountType
from modern_treasury.types import (
ExternalAccount,
ExternalAccountType,
ExternalAccountVerifyResponse,
)
```

Methods:
Expand All @@ -90,7 +94,7 @@ Methods:
- <code title="get /api/external_accounts">client.external_accounts.<a href="./src/modern_treasury/resources/external_accounts.py">list</a>(\*\*<a href="src/modern_treasury/types/external_account_list_params.py">params</a>) -> <a href="./src/modern_treasury/types/external_account.py">SyncPage[ExternalAccount]</a></code>
- <code title="delete /api/external_accounts/{id}">client.external_accounts.<a href="./src/modern_treasury/resources/external_accounts.py">delete</a>(id) -> None</code>
- <code title="post /api/external_accounts/{id}/complete_verification">client.external_accounts.<a href="./src/modern_treasury/resources/external_accounts.py">complete_verification</a>(id, \*\*<a href="src/modern_treasury/types/external_account_complete_verification_params.py">params</a>) -> <a href="./src/modern_treasury/types/external_account.py">ExternalAccount</a></code>
- <code title="post /api/external_accounts/{id}/verify">client.external_accounts.<a href="./src/modern_treasury/resources/external_accounts.py">verify</a>(id, \*\*<a href="src/modern_treasury/types/external_account_verify_params.py">params</a>) -> <a href="./src/modern_treasury/types/external_account.py">ExternalAccount</a></code>
- <code title="post /api/external_accounts/{id}/verify">client.external_accounts.<a href="./src/modern_treasury/resources/external_accounts.py">verify</a>(id, \*\*<a href="src/modern_treasury/types/external_account_verify_params.py">params</a>) -> <a href="./src/modern_treasury/types/external_account_verify_response.py">ExternalAccountVerifyResponse</a></code>

# IncomingPaymentDetails

Expand Down
26 changes: 24 additions & 2 deletions src/modern_treasury/resources/account_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,18 @@ def create(
*,
accounts_type: Literal["external_accounts"],
account_number: str,
account_number_type: Literal["clabe", "hk_number", "iban", "nz_number", "other", "pan", "wallet_address"]
account_number_type: Literal[
"au_number",
"clabe",
"hk_number",
"iban",
"id_number",
"nz_number",
"other",
"pan",
"sg_number",
"wallet_address",
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -246,7 +257,18 @@ async def create(
*,
accounts_type: Literal["external_accounts"],
account_number: str,
account_number_type: Literal["clabe", "hk_number", "iban", "nz_number", "other", "pan", "wallet_address"]
account_number_type: Literal[
"au_number",
"clabe",
"hk_number",
"iban",
"id_number",
"nz_number",
"other",
"pan",
"sg_number",
"wallet_address",
]
| NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down
28 changes: 14 additions & 14 deletions src/modern_treasury/resources/counterparties.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,13 @@ def collect_account(
"brCodigo",
"routingNumberType",
"address",
"jp_zengin_code",
"se_bankgiro_clearing_code",
"nz_national_clearing_code",
"hk_interbank_clearing_code",
"hu_interbank_clearing_code",
"dk_interbank_clearing_code",
"id_sknbi_code",
"jpZenginCode",
"seBankgiroClearingCode",
"nzNationalClearingCode",
"hkInterbankClearingCode",
"huInterbankClearingCode",
"dkInterbankClearingCode",
"idSknbiCode",
]
]
| NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -789,13 +789,13 @@ async def collect_account(
"brCodigo",
"routingNumberType",
"address",
"jp_zengin_code",
"se_bankgiro_clearing_code",
"nz_national_clearing_code",
"hk_interbank_clearing_code",
"hu_interbank_clearing_code",
"dk_interbank_clearing_code",
"id_sknbi_code",
"jpZenginCode",
"seBankgiroClearingCode",
"nzNationalClearingCode",
"hkInterbankClearingCode",
"huInterbankClearingCode",
"dkInterbankClearingCode",
"idSknbiCode",
]
]
| NotGiven = NOT_GIVEN,
Expand Down
93 changes: 52 additions & 41 deletions src/modern_treasury/resources/external_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Dict, Iterable, Optional
from typing import Any, Dict, Iterable, Optional, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -32,6 +32,7 @@
from ..types.shared.currency import Currency
from ..types.external_account import ExternalAccount
from ..types.external_account_type import ExternalAccountType
from ..types.external_account_verify_response import ExternalAccountVerifyResponse

__all__ = ["ExternalAccounts", "AsyncExternalAccounts"]

Expand Down Expand Up @@ -428,7 +429,7 @@ def verify(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> ExternalAccount:
) -> ExternalAccountVerifyResponse:
"""
verify external account
Expand Down Expand Up @@ -459,26 +460,31 @@ def verify(
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
f"/api/external_accounts/{id}/verify",
body=maybe_transform(
{
"originating_account_id": originating_account_id,
"payment_type": payment_type,
"currency": currency,
"fallback_type": fallback_type,
"priority": priority,
},
external_account_verify_params.ExternalAccountVerifyParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
return cast(
ExternalAccountVerifyResponse,
self._post(
f"/api/external_accounts/{id}/verify",
body=maybe_transform(
{
"originating_account_id": originating_account_id,
"payment_type": payment_type,
"currency": currency,
"fallback_type": fallback_type,
"priority": priority,
},
external_account_verify_params.ExternalAccountVerifyParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=cast(
Any, ExternalAccountVerifyResponse
), # Union types cannot be passed in as arguments in the type system
),
cast_to=ExternalAccount,
)


Expand Down Expand Up @@ -874,7 +880,7 @@ async def verify(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> ExternalAccount:
) -> ExternalAccountVerifyResponse:
"""
verify external account
Expand Down Expand Up @@ -905,26 +911,31 @@ async def verify(
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
f"/api/external_accounts/{id}/verify",
body=await async_maybe_transform(
{
"originating_account_id": originating_account_id,
"payment_type": payment_type,
"currency": currency,
"fallback_type": fallback_type,
"priority": priority,
},
external_account_verify_params.ExternalAccountVerifyParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
return cast(
ExternalAccountVerifyResponse,
await self._post(
f"/api/external_accounts/{id}/verify",
body=await async_maybe_transform(
{
"originating_account_id": originating_account_id,
"payment_type": payment_type,
"currency": currency,
"fallback_type": fallback_type,
"priority": priority,
},
external_account_verify_params.ExternalAccountVerifyParams,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
idempotency_key=idempotency_key,
),
cast_to=cast(
Any, ExternalAccountVerifyResponse
), # Union types cannot be passed in as arguments in the type system
),
cast_to=ExternalAccount,
)


Expand Down
10 changes: 8 additions & 2 deletions src/modern_treasury/resources/ledger_accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def list(
ledger_account_category_id: str | NotGiven = NOT_GIVEN,
ledger_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
name: List[str] | NotGiven = NOT_GIVEN,
pending_balance_amount: ledger_account_list_params.PendingBalanceAmount | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
posted_balance_amount: ledger_account_list_params.PostedBalanceAmount | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -284,6 +284,9 @@ def list(
`Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
parameters.
name: If you have specific names to retrieve in bulk, you can pass them as query
parameters delimited with `name[]=`, for example `?name[]=123&name[]=abc`.
pending_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to
filter by balance amount.
Expand Down Expand Up @@ -588,7 +591,7 @@ def list(
ledger_account_category_id: str | NotGiven = NOT_GIVEN,
ledger_id: str | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
name: List[str] | NotGiven = NOT_GIVEN,
pending_balance_amount: ledger_account_list_params.PendingBalanceAmount | NotGiven = NOT_GIVEN,
per_page: int | NotGiven = NOT_GIVEN,
posted_balance_amount: ledger_account_list_params.PostedBalanceAmount | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -624,6 +627,9 @@ def list(
`Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query
parameters.
name: If you have specific names to retrieve in bulk, you can pass them as query
parameters delimited with `name[]=`, for example `?name[]=123&name[]=abc`.
pending_balance_amount: Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), `eq` (=), or `not_eq` (!=) to
filter by balance amount.
Expand Down
1 change: 1 addition & 0 deletions src/modern_treasury/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
from .ledger_account_retrieve_params import LedgerAccountRetrieveParams as LedgerAccountRetrieveParams
from .ledger_transaction_list_params import LedgerTransactionListParams as LedgerTransactionListParams
from .ledgerable_event_create_params import LedgerableEventCreateParams as LedgerableEventCreateParams
from .external_account_verify_response import ExternalAccountVerifyResponse as ExternalAccountVerifyResponse
from .ledger_event_handler_list_params import LedgerEventHandlerListParams as LedgerEventHandlerListParams
from .ledger_transaction_create_params import LedgerTransactionCreateParams as LedgerTransactionCreateParams
from .ledger_transaction_update_params import LedgerTransactionUpdateParams as LedgerTransactionUpdateParams
Expand Down
13 changes: 12 additions & 1 deletion src/modern_treasury/types/account_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,18 @@ class AccountDetail(BaseModel):
account_number_safe: str
"""The last 4 digits of the account_number."""

account_number_type: Literal["clabe", "hk_number", "iban", "nz_number", "other", "pan", "wallet_address"]
account_number_type: Literal[
"au_number",
"clabe",
"hk_number",
"iban",
"id_number",
"nz_number",
"other",
"pan",
"sg_number",
"wallet_address",
]
"""One of `iban`, `clabe`, `wallet_address`, or `other`.
Use `other` if the bank account number is in a generic format.
Expand Down
13 changes: 12 additions & 1 deletion src/modern_treasury/types/account_detail_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ class AccountDetailCreateParams(TypedDict, total=False):
account_number: Required[str]
"""The account number for the bank account."""

account_number_type: Literal["clabe", "hk_number", "iban", "nz_number", "other", "pan", "wallet_address"]
account_number_type: Literal[
"au_number",
"clabe",
"hk_number",
"iban",
"id_number",
"nz_number",
"other",
"pan",
"sg_number",
"wallet_address",
]
"""One of `iban`, `clabe`, `wallet_address`, or `other`.
Use `other` if the bank account number is in a generic format.
Expand Down
26 changes: 24 additions & 2 deletions src/modern_treasury/types/bulk_request_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,18 @@ class ResourcePaymentOrderAsyncCreateRequestLineItem(TypedDict, total=False):
class ResourcePaymentOrderAsyncCreateRequestReceivingAccountAccountDetail(TypedDict, total=False):
account_number: Required[str]

account_number_type: Literal["iban", "hk_number", "clabe", "nz_number", "wallet_address", "pan", "other"]
account_number_type: Literal[
"au_number",
"clabe",
"hk_number",
"iban",
"id_number",
"nz_number",
"other",
"pan",
"sg_number",
"wallet_address",
]


ResourcesPaymentOrderAsyncCreateRequestReceivingAccountAccountDetails = (
Expand Down Expand Up @@ -1298,7 +1309,18 @@ class ResourcePaymentOrderUpdateRequestWithIDLineItem(TypedDict, total=False):
class ResourcePaymentOrderUpdateRequestWithIDReceivingAccountAccountDetail(TypedDict, total=False):
account_number: Required[str]

account_number_type: Literal["iban", "hk_number", "clabe", "nz_number", "wallet_address", "pan", "other"]
account_number_type: Literal[
"au_number",
"clabe",
"hk_number",
"iban",
"id_number",
"nz_number",
"other",
"pan",
"sg_number",
"wallet_address",
]


ResourcesPaymentOrderUpdateRequestWithIDReceivingAccountAccountDetails = (
Expand Down
3 changes: 3 additions & 0 deletions src/modern_treasury/types/connection_legal_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ class ConnectionLegalEntity(BaseModel):
"""The status of the connection legal entity."""

updated_at: datetime

vendor_id: str
"""The ID of the legal entity at the vendor."""
2 changes: 2 additions & 0 deletions src/modern_treasury/types/counterparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ class Account(BaseModel):

updated_at: Optional[datetime] = None

verification_source: Optional[Literal["ach_prenote", "microdeposits", "plaid"]] = None

verification_status: Optional[Literal["pending_verification", "unverified", "verified"]] = None


Expand Down
Loading

0 comments on commit e71c1fe

Please sign in to comment.