diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dc7ceeb..f3856da3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/modern-treasury-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -44,7 +44,7 @@ jobs: id-token: write runs-on: ${{ github.repository == 'stainless-sdks/modern-treasury-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | @@ -63,7 +63,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/modern-treasury-python' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -81,7 +81,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/modern-treasury-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 8411b943..c1e08532 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Install Rye run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 3777d44b..f1972652 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'Modern-Treasury/modern-treasury-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7b243c59..7ef7bb77 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.63.0" + ".": "1.64.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0b16fcb8..95ee6247 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 168 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-b70193f02d90e71e996b5cf45038db80fe123344267e22207026f755e3198f56.yml -openapi_spec_hash: 289fdda5739de528fa149e924511e428 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-e4fb4d2325c0fbb78e23f4695b974e00d81dc4480789478dbdd0e077152cd623.yml +openapi_spec_hash: 218b6e6d70e344395adc2fc5ff4c8f66 config_hash: 196d1bf0caae233683efb6abc123941f diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ea3d7ab..a21809ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## 1.64.0 (2026-02-13) + +Full Changelog: [v1.63.0...v1.64.0](https://github.com/Modern-Treasury/modern-treasury-python/compare/v1.63.0...v1.64.0) + +### Features + +* **api:** api update ([ab0c565](https://github.com/Modern-Treasury/modern-treasury-python/commit/ab0c565b4220c6c9236181b4e1699dfe3d542147)) +* **api:** api update ([1894bde](https://github.com/Modern-Treasury/modern-treasury-python/commit/1894bdef23f2afc6d0e2e5b3e968838bce0c8130)) +* **api:** api update ([a36277e](https://github.com/Modern-Treasury/modern-treasury-python/commit/a36277e15343038decd3bf610f9e1ae68235a86a)) +* **api:** api update ([c92a9ce](https://github.com/Modern-Treasury/modern-treasury-python/commit/c92a9ce0dd768e53518a263241cdef81f1648a56)) +* **api:** api update ([80ff1b5](https://github.com/Modern-Treasury/modern-treasury-python/commit/80ff1b53fec639b70236541e6f5b9a8e548e5846)) +* **api:** api update ([a8c7d8d](https://github.com/Modern-Treasury/modern-treasury-python/commit/a8c7d8d62b7ab86c8cbd940b6a66905d218a2002)) +* **api:** api update ([59421e9](https://github.com/Modern-Treasury/modern-treasury-python/commit/59421e99d18c022caeeae69b34b21c3ad4d44311)) +* **client:** add custom JSON encoder for extended type support ([8e9e7dd](https://github.com/Modern-Treasury/modern-treasury-python/commit/8e9e7dd9ff628d218581f0ad3b3ab0d4521af898)) + + +### Bug Fixes + +* **docs:** fix mcp installation instructions for remote servers ([81262fe](https://github.com/Modern-Treasury/modern-treasury-python/commit/81262fe918cf0613b744fc25e49be04e34d578cc)) + + +### Chores + +* **ci:** upgrade `actions/github-script` ([b019b1f](https://github.com/Modern-Treasury/modern-treasury-python/commit/b019b1f45f89acebdfb3cd77e9485403c2671f8f)) +* format all `api.md` files ([586eba0](https://github.com/Modern-Treasury/modern-treasury-python/commit/586eba00e21d0ff37997d7ef257a23a042f42a21)) +* **internal:** bump dependencies ([f21a8b1](https://github.com/Modern-Treasury/modern-treasury-python/commit/f21a8b106ca2bd401fc9d5782574d11d700e6e4c)) +* **internal:** codegen related update ([4471585](https://github.com/Modern-Treasury/modern-treasury-python/commit/447158528a5c121ed3040901e6cb7b1117210b46)) +* **internal:** fix lint error on Python 3.14 ([f2a9d02](https://github.com/Modern-Treasury/modern-treasury-python/commit/f2a9d02bab75a30b9c614fe7c7369466ce2839d0)) +* **internal:** update `actions/checkout` version ([7e8aa74](https://github.com/Modern-Treasury/modern-treasury-python/commit/7e8aa742c35f82615786e9f3d70597b08dc9ca1d)) + ## 1.63.0 (2026-01-13) Full Changelog: [v1.62.0...v1.63.0](https://github.com/Modern-Treasury/modern-treasury-python/compare/v1.62.0...v1.63.0) diff --git a/README.md b/README.md index 1be579cb..20556e27 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ https://user-images.githubusercontent.com/704302/216504942-09ed8dd7-7f44-40a6-a5 Use the Modern Treasury MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. -[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXX0) -[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%7D) +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXSwiZW52Ijp7Ik1PREVSTl9UUkVBU1VSWV9BUElfS0VZIjoiTXkgQVBJIEtleSIsIk1PREVSTl9UUkVBU1VSWV9PUkdBTklaQVRJT05fSUQiOiJteS1vcmdhbml6YXRpb24tSUQiLCJNT0RFUk5fVFJFQVNVUllfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%2C%22env%22%3A%7B%22MODERN_TREASURY_API_KEY%22%3A%22My%20API%20Key%22%2C%22MODERN_TREASURY_ORGANIZATION_ID%22%3A%22my-organization-ID%22%2C%22MODERN_TREASURY_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D) > Note: You may need to set environment variables in your MCP client. diff --git a/api.md b/api.md index 59f3b76a..23df3500 100644 --- a/api.md +++ b/api.md @@ -18,7 +18,6 @@ from modern_treasury.types import ( LedgerTransactionCreateRequest, LegalEntityAddressCreateRequest, LegalEntityAssociationInlineCreate, - LegalEntityComplianceDetail, LegalEntityIndustryClassification, TransactionDirection, ) diff --git a/pyproject.toml b/pyproject.toml index d1289f6d..a662419c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "modern-treasury" -version = "1.63.0" +version = "1.64.0" description = "The official Python library for the Modern Treasury API" dynamic = ["readme"] license = "MIT" @@ -69,7 +69,7 @@ format = { chain = [ # run formatting again to fix any inconsistencies when imports are stripped "format:ruff", ]} -"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md" +"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'" "format:ruff" = "ruff format" "lint" = { chain = [ diff --git a/requirements-dev.lock b/requirements-dev.lock index 9c531347..739f62e1 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -12,14 +12,14 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.13.2 +aiohttp==3.13.3 # via httpx-aiohttp # via modern-treasury aiosignal==1.4.0 # via aiohttp annotated-types==0.7.0 # via pydantic -anyio==4.12.0 +anyio==4.12.1 # via httpx # via modern-treasury argcomplete==3.6.3 @@ -31,7 +31,7 @@ attrs==25.4.0 # via nox backports-asyncio-runner==1.2.0 # via pytest-asyncio -certifi==2025.11.12 +certifi==2026.1.4 # via httpcore # via httpx colorlog==6.10.1 @@ -61,7 +61,7 @@ httpx==0.28.1 # via httpx-aiohttp # via modern-treasury # via respx -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via modern-treasury humanize==4.13.0 # via nox @@ -69,7 +69,7 @@ idna==3.11 # via anyio # via httpx # via yarl -importlib-metadata==8.7.0 +importlib-metadata==8.7.1 iniconfig==2.1.0 # via pytest markdown-it-py==3.0.0 @@ -82,14 +82,14 @@ multidict==6.7.0 mypy==1.17.0 mypy-extensions==1.1.0 # via mypy -nodeenv==1.9.1 +nodeenv==1.10.0 # via pyright nox==2025.11.12 packaging==25.0 # via dependency-groups # via nox # via pytest -pathspec==0.12.1 +pathspec==1.0.3 # via mypy platformdirs==4.4.0 # via virtualenv @@ -115,13 +115,13 @@ python-dateutil==2.9.0.post0 # via time-machine respx==0.22.0 rich==14.2.0 -ruff==0.14.7 +ruff==0.14.13 six==1.17.0 # via python-dateutil sniffio==1.3.1 # via modern-treasury time-machine==2.19.0 -tomli==2.3.0 +tomli==2.4.0 # via dependency-groups # via mypy # via nox @@ -141,7 +141,7 @@ typing-extensions==4.15.0 # via virtualenv typing-inspection==0.4.2 # via pydantic -virtualenv==20.35.4 +virtualenv==20.36.1 # via nox yarl==1.22.0 # via aiohttp diff --git a/requirements.lock b/requirements.lock index d7ea0864..de46d637 100644 --- a/requirements.lock +++ b/requirements.lock @@ -12,21 +12,21 @@ -e file:. aiohappyeyeballs==2.6.1 # via aiohttp -aiohttp==3.13.2 +aiohttp==3.13.3 # via httpx-aiohttp # via modern-treasury aiosignal==1.4.0 # via aiohttp annotated-types==0.7.0 # via pydantic -anyio==4.12.0 +anyio==4.12.1 # via httpx # via modern-treasury async-timeout==5.0.1 # via aiohttp attrs==25.4.0 # via aiohttp -certifi==2025.11.12 +certifi==2026.1.4 # via httpcore # via httpx distro==1.9.0 @@ -43,7 +43,7 @@ httpcore==1.0.9 httpx==0.28.1 # via httpx-aiohttp # via modern-treasury -httpx-aiohttp==0.1.9 +httpx-aiohttp==0.1.12 # via modern-treasury idna==3.11 # via anyio diff --git a/src/modern_treasury/_base_client.py b/src/modern_treasury/_base_client.py index 1efbd879..2e6cff22 100644 --- a/src/modern_treasury/_base_client.py +++ b/src/modern_treasury/_base_client.py @@ -86,6 +86,7 @@ APIConnectionError, APIResponseValidationError, ) +from ._utils._json import openapi_dumps from ._legacy_response import LegacyAPIResponse log: logging.Logger = logging.getLogger(__name__) @@ -556,8 +557,10 @@ def _build_request( kwargs["content"] = options.content elif isinstance(json_data, bytes): kwargs["content"] = json_data - else: - kwargs["json"] = json_data if is_given(json_data) else None + elif not files: + # Don't set content when JSON is sent as multipart/form-data, + # since httpx's content param overrides other body arguments + kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/modern_treasury/_compat.py b/src/modern_treasury/_compat.py index bdef67f0..786ff42a 100644 --- a/src/modern_treasury/_compat.py +++ b/src/modern_treasury/_compat.py @@ -139,6 +139,7 @@ def model_dump( exclude_defaults: bool = False, warnings: bool = True, mode: Literal["json", "python"] = "python", + by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): return model.model_dump( @@ -148,13 +149,12 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, + by_alias=by_alias, ) return cast( "dict[str, Any]", model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast] - exclude=exclude, - exclude_unset=exclude_unset, - exclude_defaults=exclude_defaults, + exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias) ), ) diff --git a/src/modern_treasury/_utils/_compat.py b/src/modern_treasury/_utils/_compat.py index dd703233..2c70b299 100644 --- a/src/modern_treasury/_utils/_compat.py +++ b/src/modern_treasury/_utils/_compat.py @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool: else: import types - return tp is Union or tp is types.UnionType + return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap] def is_typeddict(tp: Type[Any]) -> bool: diff --git a/src/modern_treasury/_utils/_json.py b/src/modern_treasury/_utils/_json.py new file mode 100644 index 00000000..60584214 --- /dev/null +++ b/src/modern_treasury/_utils/_json.py @@ -0,0 +1,35 @@ +import json +from typing import Any +from datetime import datetime +from typing_extensions import override + +import pydantic + +from .._compat import model_dump + + +def openapi_dumps(obj: Any) -> bytes: + """ + Serialize an object to UTF-8 encoded JSON bytes. + + Extends the standard json.dumps with support for additional types + commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc. + """ + return json.dumps( + obj, + cls=_CustomEncoder, + # Uses the same defaults as httpx's JSON serialization + ensure_ascii=False, + separators=(",", ":"), + allow_nan=False, + ).encode() + + +class _CustomEncoder(json.JSONEncoder): + @override + def default(self, o: Any) -> Any: + if isinstance(o, datetime): + return o.isoformat() + if isinstance(o, pydantic.BaseModel): + return model_dump(o, exclude_unset=True, mode="json", by_alias=True) + return super().default(o) diff --git a/src/modern_treasury/_version.py b/src/modern_treasury/_version.py index 729c45eb..43e8064c 100644 --- a/src/modern_treasury/_version.py +++ b/src/modern_treasury/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "modern_treasury" -__version__ = "1.63.0" # x-release-please-version +__version__ = "1.64.0" # x-release-please-version diff --git a/src/modern_treasury/resources/account_details.py b/src/modern_treasury/resources/account_details.py index be1a7f0d..acce2106 100644 --- a/src/modern_treasury/resources/account_details.py +++ b/src/modern_treasury/resources/account_details.py @@ -51,6 +51,7 @@ def create( account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", @@ -280,6 +281,7 @@ async def create( account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/resources/ledger_account_categories.py b/src/modern_treasury/resources/ledger_account_categories.py index 8f5a6f9e..1540d418 100644 --- a/src/modern_treasury/resources/ledger_account_categories.py +++ b/src/modern_treasury/resources/ledger_account_categories.py @@ -55,6 +55,7 @@ def create( normal_balance: TransactionDirection, currency_exponent: Optional[int] | Omit = omit, description: Optional[str] | Omit = omit, + external_id: Optional[str] | Omit = omit, ledger_account_category_ids: SequenceNotStr[str] | Omit = omit, metadata: Dict[str, str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -81,6 +82,8 @@ def create( description: The description of the ledger account category. + external_id: An optional user-defined 180 character unique identifier. + ledger_account_category_ids: The array of ledger account category ids that this ledger account category should be a child of. @@ -107,6 +110,7 @@ def create( "normal_balance": normal_balance, "currency_exponent": currency_exponent, "description": description, + "external_id": external_id, "ledger_account_category_ids": ledger_account_category_ids, "metadata": metadata, }, @@ -236,7 +240,7 @@ def list( ledger_account_id: str | Omit = omit, ledger_id: str | Omit = omit, metadata: Dict[str, str] | Omit = omit, - name: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, parent_ledger_account_category_id: str | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -265,9 +269,6 @@ 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`. - parent_ledger_account_category_id: Query categories that are nested underneath a parent category extra_headers: Send extra headers @@ -552,6 +553,7 @@ async def create( normal_balance: TransactionDirection, currency_exponent: Optional[int] | Omit = omit, description: Optional[str] | Omit = omit, + external_id: Optional[str] | Omit = omit, ledger_account_category_ids: SequenceNotStr[str] | Omit = omit, metadata: Dict[str, str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -578,6 +580,8 @@ async def create( description: The description of the ledger account category. + external_id: An optional user-defined 180 character unique identifier. + ledger_account_category_ids: The array of ledger account category ids that this ledger account category should be a child of. @@ -604,6 +608,7 @@ async def create( "normal_balance": normal_balance, "currency_exponent": currency_exponent, "description": description, + "external_id": external_id, "ledger_account_category_ids": ledger_account_category_ids, "metadata": metadata, }, @@ -733,7 +738,7 @@ def list( ledger_account_id: str | Omit = omit, ledger_id: str | Omit = omit, metadata: Dict[str, str] | Omit = omit, - name: SequenceNotStr[str] | Omit = omit, + name: str | Omit = omit, parent_ledger_account_category_id: str | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -762,9 +767,6 @@ 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`. - parent_ledger_account_category_id: Query categories that are nested underneath a parent category extra_headers: Send extra headers diff --git a/src/modern_treasury/resources/ledger_accounts.py b/src/modern_treasury/resources/ledger_accounts.py index 74fe64a8..1d97c083 100644 --- a/src/modern_treasury/resources/ledger_accounts.py +++ b/src/modern_treasury/resources/ledger_accounts.py @@ -57,6 +57,7 @@ def create( normal_balance: TransactionDirection, currency_exponent: Optional[int] | Omit = omit, description: Optional[str] | Omit = omit, + external_id: Optional[str] | Omit = omit, ledger_account_category_ids: SequenceNotStr[str] | Omit = omit, ledgerable_id: str | Omit = omit, ledgerable_type: Literal["counterparty", "external_account", "internal_account", "virtual_account"] @@ -86,6 +87,8 @@ def create( description: The description of the ledger account. + external_id: An optional user-defined 180 character unique identifier. + ledger_account_category_ids: The array of ledger account category ids that this ledger account should be a child of. @@ -119,6 +122,7 @@ def create( "normal_balance": normal_balance, "currency_exponent": currency_exponent, "description": description, + "external_id": external_id, "ledger_account_category_ids": ledger_account_category_ids, "ledgerable_id": ledgerable_id, "ledgerable_type": ledgerable_type, @@ -415,6 +419,7 @@ async def create( normal_balance: TransactionDirection, currency_exponent: Optional[int] | Omit = omit, description: Optional[str] | Omit = omit, + external_id: Optional[str] | Omit = omit, ledger_account_category_ids: SequenceNotStr[str] | Omit = omit, ledgerable_id: str | Omit = omit, ledgerable_type: Literal["counterparty", "external_account", "internal_account", "virtual_account"] @@ -444,6 +449,8 @@ async def create( description: The description of the ledger account. + external_id: An optional user-defined 180 character unique identifier. + ledger_account_category_ids: The array of ledger account category ids that this ledger account should be a child of. @@ -477,6 +484,7 @@ async def create( "normal_balance": normal_balance, "currency_exponent": currency_exponent, "description": description, + "external_id": external_id, "ledger_account_category_ids": ledger_account_category_ids, "ledgerable_id": ledgerable_id, "ledgerable_type": ledgerable_type, diff --git a/src/modern_treasury/resources/ledger_entries.py b/src/modern_treasury/resources/ledger_entries.py index dac115d6..7a818d4a 100644 --- a/src/modern_treasury/resources/ledger_entries.py +++ b/src/modern_treasury/resources/ledger_entries.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from datetime import date, datetime from typing_extensions import Literal @@ -153,7 +153,7 @@ def list( per_page: int | Omit = omit, show_balances: bool | Omit = omit, show_deleted: bool | Omit = omit, - status: List[Literal["pending", "posted", "archived"]] | Omit = omit, + status: Literal["pending", "posted", "archived"] | Omit = omit, updated_at: Dict[str, Union[str, datetime]] | Omit = omit, # 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. @@ -396,7 +396,7 @@ def list( per_page: int | Omit = omit, show_balances: bool | Omit = omit, show_deleted: bool | Omit = omit, - status: List[Literal["pending", "posted", "archived"]] | Omit = omit, + status: Literal["pending", "posted", "archived"] | Omit = omit, updated_at: Dict[str, Union[str, datetime]] | Omit = omit, # 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. diff --git a/src/modern_treasury/resources/legal_entities.py b/src/modern_treasury/resources/legal_entities.py index 591dcf75..1c12c51e 100644 --- a/src/modern_treasury/resources/legal_entities.py +++ b/src/modern_treasury/resources/legal_entities.py @@ -19,7 +19,6 @@ from .._base_client import AsyncPaginator, make_request_options from ..types.legal_entity import LegalEntity from ..types.shared_params.identification_create_request import IdentificationCreateRequest -from ..types.shared_params.legal_entity_compliance_detail import LegalEntityComplianceDetail from ..types.shared_params.legal_entity_address_create_request import LegalEntityAddressCreateRequest from ..types.shared_params.legal_entity_industry_classification import LegalEntityIndustryClassification from ..types.shared_params.legal_entity_association_inline_create import LegalEntityAssociationInlineCreate @@ -56,7 +55,7 @@ def create( business_description: Optional[str] | Omit = omit, business_name: Optional[str] | Omit = omit, citizenship_country: Optional[str] | Omit = omit, - compliance_details: Optional[LegalEntityComplianceDetail] | Omit = omit, + connection_id: Optional[str] | Omit = omit, country_of_incorporation: Optional[str] | Omit = omit, date_formed: Union[str, date, None] | Omit = omit, date_of_birth: Union[str, date, None] | Omit = omit, @@ -73,6 +72,7 @@ def create( Literal["corporation", "llc", "non_profit", "partnership", "sole_proprietorship", "trust"] ] | Omit = omit, + listed_exchange: Optional[str] | Omit = omit, metadata: Dict[str, str] | Omit = omit, middle_name: Optional[str] | Omit = omit, operating_jurisdictions: SequenceNotStr[str] | Omit = omit, @@ -81,8 +81,12 @@ def create( preferred_name: Optional[str] | Omit = omit, prefix: Optional[str] | Omit = omit, primary_social_media_sites: SequenceNotStr[str] | Omit = omit, + regulators: Optional[Iterable[legal_entity_create_params.Regulator]] | Omit = omit, risk_rating: Optional[Literal["low", "medium", "high"]] | Omit = omit, + status: Optional[Literal["active", "closed", "pending", "suspended"]] | Omit = omit, suffix: Optional[str] | Omit = omit, + third_party_verification: Optional[legal_entity_create_params.ThirdPartyVerification] | Omit = omit, + ticker_symbol: Optional[str] | Omit = omit, wealth_and_employment_details: Optional[legal_entity_create_params.WealthAndEmploymentDetails] | Omit = omit, website: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -107,6 +111,12 @@ def create( citizenship_country: The country of citizenship for an individual. + connection_id: The connection ID for the connection the legal entity is associated with. + Defaults to the id of the connection designated with an is_default value of true + or the id of an existing operational connection if only one is available. Pass + in a value of null to prevent the connection from being associated with the + legal entity. + country_of_incorporation: The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 formats. @@ -116,7 +126,7 @@ def create( email: The entity's primary email. - expected_activity_volume: Monthly expected transaction volume in entity's local currency. + expected_activity_volume: Monthly expected transaction volume in USD. first_name: An individual's first name. @@ -132,6 +142,8 @@ def create( legal_structure: The business's legal structure. + listed_exchange: ISO 10383 market identifier code. + metadata: Additional data represented as key-value pairs. Both the key and value must be strings. @@ -148,10 +160,19 @@ def create( primary_social_media_sites: A list of primary social media URLs for the business. + regulators: Array of regulatory bodies overseeing this institution. + risk_rating: The risk rating of the legal entity. One of low, medium, high. + status: The activation status of the legal entity. One of pending, active, suspended, or + closed. + suffix: An individual's suffix. + third_party_verification: Information describing a third-party verification run by an external vendor. + + ticker_symbol: Stock ticker symbol for publicly traded companies. + website: The entity's primary website URL. extra_headers: Send extra headers @@ -174,7 +195,7 @@ def create( "business_description": business_description, "business_name": business_name, "citizenship_country": citizenship_country, - "compliance_details": compliance_details, + "connection_id": connection_id, "country_of_incorporation": country_of_incorporation, "date_formed": date_formed, "date_of_birth": date_of_birth, @@ -188,6 +209,7 @@ def create( "last_name": last_name, "legal_entity_associations": legal_entity_associations, "legal_structure": legal_structure, + "listed_exchange": listed_exchange, "metadata": metadata, "middle_name": middle_name, "operating_jurisdictions": operating_jurisdictions, @@ -196,8 +218,12 @@ def create( "preferred_name": preferred_name, "prefix": prefix, "primary_social_media_sites": primary_social_media_sites, + "regulators": regulators, "risk_rating": risk_rating, + "status": status, "suffix": suffix, + "third_party_verification": third_party_verification, + "ticker_symbol": ticker_symbol, "wealth_and_employment_details": wealth_and_employment_details, "website": website, }, @@ -255,7 +281,6 @@ def update( business_description: Optional[str] | Omit = omit, business_name: Optional[str] | Omit = omit, citizenship_country: Optional[str] | Omit = omit, - compliance_details: Optional[LegalEntityComplianceDetail] | Omit = omit, country_of_incorporation: Optional[str] | Omit = omit, date_formed: Union[str, date, None] | Omit = omit, date_of_birth: Union[str, date, None] | Omit = omit, @@ -271,6 +296,7 @@ def update( Literal["corporation", "llc", "non_profit", "partnership", "sole_proprietorship", "trust"] ] | Omit = omit, + listed_exchange: Optional[str] | Omit = omit, metadata: Dict[str, str] | Omit = omit, middle_name: Optional[str] | Omit = omit, operating_jurisdictions: SequenceNotStr[str] | Omit = omit, @@ -279,8 +305,12 @@ def update( preferred_name: Optional[str] | Omit = omit, prefix: Optional[str] | Omit = omit, primary_social_media_sites: SequenceNotStr[str] | Omit = omit, + regulators: Optional[Iterable[legal_entity_update_params.Regulator]] | Omit = omit, risk_rating: Optional[Literal["low", "medium", "high"]] | Omit = omit, + status: Optional[Literal["active", "closed", "pending", "suspended"]] | Omit = omit, suffix: Optional[str] | Omit = omit, + third_party_verification: Optional[legal_entity_update_params.ThirdPartyVerification] | Omit = omit, + ticker_symbol: Optional[str] | Omit = omit, wealth_and_employment_details: Optional[legal_entity_update_params.WealthAndEmploymentDetails] | Omit = omit, website: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -312,7 +342,7 @@ def update( email: The entity's primary email. - expected_activity_volume: Monthly expected transaction volume in entity's local currency. + expected_activity_volume: Monthly expected transaction volume in USD. first_name: An individual's first name. @@ -326,6 +356,8 @@ def update( legal_structure: The business's legal structure. + listed_exchange: ISO 10383 market identifier code. + metadata: Additional data represented as key-value pairs. Both the key and value must be strings. @@ -342,10 +374,19 @@ def update( primary_social_media_sites: A list of primary social media URLs for the business. + regulators: Array of regulatory bodies overseeing this institution. + risk_rating: The risk rating of the legal entity. One of low, medium, high. + status: The activation status of the legal entity. One of pending, active, suspended, or + closed. + suffix: An individual's suffix. + third_party_verification: Information describing a third-party verification run by an external vendor. + + ticker_symbol: Stock ticker symbol for publicly traded companies. + website: The entity's primary website URL. extra_headers: Send extra headers @@ -369,7 +410,6 @@ def update( "business_description": business_description, "business_name": business_name, "citizenship_country": citizenship_country, - "compliance_details": compliance_details, "country_of_incorporation": country_of_incorporation, "date_formed": date_formed, "date_of_birth": date_of_birth, @@ -382,6 +422,7 @@ def update( "intended_use": intended_use, "last_name": last_name, "legal_structure": legal_structure, + "listed_exchange": listed_exchange, "metadata": metadata, "middle_name": middle_name, "operating_jurisdictions": operating_jurisdictions, @@ -390,8 +431,12 @@ def update( "preferred_name": preferred_name, "prefix": prefix, "primary_social_media_sites": primary_social_media_sites, + "regulators": regulators, "risk_rating": risk_rating, + "status": status, "suffix": suffix, + "third_party_verification": third_party_verification, + "ticker_symbol": ticker_symbol, "wealth_and_employment_details": wealth_and_employment_details, "website": website, }, @@ -415,6 +460,7 @@ def list( metadata: Dict[str, str] | Omit = omit, per_page: int | Omit = omit, show_deleted: str | Omit = omit, + status: Literal["pending", "active", "suspended", "closed"] | Omit = omit, # 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, @@ -453,6 +499,7 @@ def list( "metadata": metadata, "per_page": per_page, "show_deleted": show_deleted, + "status": status, }, legal_entity_list_params.LegalEntityListParams, ), @@ -490,7 +537,7 @@ async def create( business_description: Optional[str] | Omit = omit, business_name: Optional[str] | Omit = omit, citizenship_country: Optional[str] | Omit = omit, - compliance_details: Optional[LegalEntityComplianceDetail] | Omit = omit, + connection_id: Optional[str] | Omit = omit, country_of_incorporation: Optional[str] | Omit = omit, date_formed: Union[str, date, None] | Omit = omit, date_of_birth: Union[str, date, None] | Omit = omit, @@ -507,6 +554,7 @@ async def create( Literal["corporation", "llc", "non_profit", "partnership", "sole_proprietorship", "trust"] ] | Omit = omit, + listed_exchange: Optional[str] | Omit = omit, metadata: Dict[str, str] | Omit = omit, middle_name: Optional[str] | Omit = omit, operating_jurisdictions: SequenceNotStr[str] | Omit = omit, @@ -515,8 +563,12 @@ async def create( preferred_name: Optional[str] | Omit = omit, prefix: Optional[str] | Omit = omit, primary_social_media_sites: SequenceNotStr[str] | Omit = omit, + regulators: Optional[Iterable[legal_entity_create_params.Regulator]] | Omit = omit, risk_rating: Optional[Literal["low", "medium", "high"]] | Omit = omit, + status: Optional[Literal["active", "closed", "pending", "suspended"]] | Omit = omit, suffix: Optional[str] | Omit = omit, + third_party_verification: Optional[legal_entity_create_params.ThirdPartyVerification] | Omit = omit, + ticker_symbol: Optional[str] | Omit = omit, wealth_and_employment_details: Optional[legal_entity_create_params.WealthAndEmploymentDetails] | Omit = omit, website: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -541,6 +593,12 @@ async def create( citizenship_country: The country of citizenship for an individual. + connection_id: The connection ID for the connection the legal entity is associated with. + Defaults to the id of the connection designated with an is_default value of true + or the id of an existing operational connection if only one is available. Pass + in a value of null to prevent the connection from being associated with the + legal entity. + country_of_incorporation: The country code where the business is incorporated in the ISO 3166-1 alpha-2 or alpha-3 formats. @@ -550,7 +608,7 @@ async def create( email: The entity's primary email. - expected_activity_volume: Monthly expected transaction volume in entity's local currency. + expected_activity_volume: Monthly expected transaction volume in USD. first_name: An individual's first name. @@ -566,6 +624,8 @@ async def create( legal_structure: The business's legal structure. + listed_exchange: ISO 10383 market identifier code. + metadata: Additional data represented as key-value pairs. Both the key and value must be strings. @@ -582,10 +642,19 @@ async def create( primary_social_media_sites: A list of primary social media URLs for the business. + regulators: Array of regulatory bodies overseeing this institution. + risk_rating: The risk rating of the legal entity. One of low, medium, high. + status: The activation status of the legal entity. One of pending, active, suspended, or + closed. + suffix: An individual's suffix. + third_party_verification: Information describing a third-party verification run by an external vendor. + + ticker_symbol: Stock ticker symbol for publicly traded companies. + website: The entity's primary website URL. extra_headers: Send extra headers @@ -608,7 +677,7 @@ async def create( "business_description": business_description, "business_name": business_name, "citizenship_country": citizenship_country, - "compliance_details": compliance_details, + "connection_id": connection_id, "country_of_incorporation": country_of_incorporation, "date_formed": date_formed, "date_of_birth": date_of_birth, @@ -622,6 +691,7 @@ async def create( "last_name": last_name, "legal_entity_associations": legal_entity_associations, "legal_structure": legal_structure, + "listed_exchange": listed_exchange, "metadata": metadata, "middle_name": middle_name, "operating_jurisdictions": operating_jurisdictions, @@ -630,8 +700,12 @@ async def create( "preferred_name": preferred_name, "prefix": prefix, "primary_social_media_sites": primary_social_media_sites, + "regulators": regulators, "risk_rating": risk_rating, + "status": status, "suffix": suffix, + "third_party_verification": third_party_verification, + "ticker_symbol": ticker_symbol, "wealth_and_employment_details": wealth_and_employment_details, "website": website, }, @@ -689,7 +763,6 @@ async def update( business_description: Optional[str] | Omit = omit, business_name: Optional[str] | Omit = omit, citizenship_country: Optional[str] | Omit = omit, - compliance_details: Optional[LegalEntityComplianceDetail] | Omit = omit, country_of_incorporation: Optional[str] | Omit = omit, date_formed: Union[str, date, None] | Omit = omit, date_of_birth: Union[str, date, None] | Omit = omit, @@ -705,6 +778,7 @@ async def update( Literal["corporation", "llc", "non_profit", "partnership", "sole_proprietorship", "trust"] ] | Omit = omit, + listed_exchange: Optional[str] | Omit = omit, metadata: Dict[str, str] | Omit = omit, middle_name: Optional[str] | Omit = omit, operating_jurisdictions: SequenceNotStr[str] | Omit = omit, @@ -713,8 +787,12 @@ async def update( preferred_name: Optional[str] | Omit = omit, prefix: Optional[str] | Omit = omit, primary_social_media_sites: SequenceNotStr[str] | Omit = omit, + regulators: Optional[Iterable[legal_entity_update_params.Regulator]] | Omit = omit, risk_rating: Optional[Literal["low", "medium", "high"]] | Omit = omit, + status: Optional[Literal["active", "closed", "pending", "suspended"]] | Omit = omit, suffix: Optional[str] | Omit = omit, + third_party_verification: Optional[legal_entity_update_params.ThirdPartyVerification] | Omit = omit, + ticker_symbol: Optional[str] | Omit = omit, wealth_and_employment_details: Optional[legal_entity_update_params.WealthAndEmploymentDetails] | Omit = omit, website: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -746,7 +824,7 @@ async def update( email: The entity's primary email. - expected_activity_volume: Monthly expected transaction volume in entity's local currency. + expected_activity_volume: Monthly expected transaction volume in USD. first_name: An individual's first name. @@ -760,6 +838,8 @@ async def update( legal_structure: The business's legal structure. + listed_exchange: ISO 10383 market identifier code. + metadata: Additional data represented as key-value pairs. Both the key and value must be strings. @@ -776,10 +856,19 @@ async def update( primary_social_media_sites: A list of primary social media URLs for the business. + regulators: Array of regulatory bodies overseeing this institution. + risk_rating: The risk rating of the legal entity. One of low, medium, high. + status: The activation status of the legal entity. One of pending, active, suspended, or + closed. + suffix: An individual's suffix. + third_party_verification: Information describing a third-party verification run by an external vendor. + + ticker_symbol: Stock ticker symbol for publicly traded companies. + website: The entity's primary website URL. extra_headers: Send extra headers @@ -803,7 +892,6 @@ async def update( "business_description": business_description, "business_name": business_name, "citizenship_country": citizenship_country, - "compliance_details": compliance_details, "country_of_incorporation": country_of_incorporation, "date_formed": date_formed, "date_of_birth": date_of_birth, @@ -816,6 +904,7 @@ async def update( "intended_use": intended_use, "last_name": last_name, "legal_structure": legal_structure, + "listed_exchange": listed_exchange, "metadata": metadata, "middle_name": middle_name, "operating_jurisdictions": operating_jurisdictions, @@ -824,8 +913,12 @@ async def update( "preferred_name": preferred_name, "prefix": prefix, "primary_social_media_sites": primary_social_media_sites, + "regulators": regulators, "risk_rating": risk_rating, + "status": status, "suffix": suffix, + "third_party_verification": third_party_verification, + "ticker_symbol": ticker_symbol, "wealth_and_employment_details": wealth_and_employment_details, "website": website, }, @@ -849,6 +942,7 @@ def list( metadata: Dict[str, str] | Omit = omit, per_page: int | Omit = omit, show_deleted: str | Omit = omit, + status: Literal["pending", "active", "suspended", "closed"] | Omit = omit, # 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, @@ -887,6 +981,7 @@ def list( "metadata": metadata, "per_page": per_page, "show_deleted": show_deleted, + "status": status, }, legal_entity_list_params.LegalEntityListParams, ), diff --git a/src/modern_treasury/types/__init__.py b/src/modern_treasury/types/__init__.py index b0ab0559..155475c7 100644 --- a/src/modern_treasury/types/__init__.py +++ b/src/modern_treasury/types/__init__.py @@ -30,7 +30,6 @@ LedgerEntryCreateRequest as LedgerEntryCreateRequest, LedgerAccountCreateRequest as LedgerAccountCreateRequest, IdentificationCreateRequest as IdentificationCreateRequest, - LegalEntityComplianceDetail as LegalEntityComplianceDetail, LedgerTransactionCreateRequest as LedgerTransactionCreateRequest, LegalEntityAddressCreateRequest as LegalEntityAddressCreateRequest, LegalEntityIndustryClassification as LegalEntityIndustryClassification, diff --git a/src/modern_treasury/types/account_detail.py b/src/modern_treasury/types/account_detail.py index 72a03d3d..ec3f279c 100644 --- a/src/modern_treasury/types/account_detail.py +++ b/src/modern_treasury/types/account_detail.py @@ -18,6 +18,7 @@ class AccountDetail(BaseModel): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/types/account_detail_create_params.py b/src/modern_treasury/types/account_detail_create_params.py index cd7b49e9..df0ba20b 100644 --- a/src/modern_treasury/types/account_detail_create_params.py +++ b/src/modern_treasury/types/account_detail_create_params.py @@ -16,6 +16,7 @@ class AccountDetailCreateParams(TypedDict, total=False): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/types/bulk_request_create_params.py b/src/modern_treasury/types/bulk_request_create_params.py index 35209659..56e81531 100644 --- a/src/modern_treasury/types/bulk_request_create_params.py +++ b/src/modern_treasury/types/bulk_request_create_params.py @@ -155,6 +155,7 @@ class ResourcePaymentOrderAsyncCreateRequestReceivingAccountAccountDetail(TypedD account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", @@ -882,6 +883,7 @@ class ResourcePaymentOrderUpdateRequestWithIDReceivingAccountAccountDetail(Typed account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/types/child_legal_entity.py b/src/modern_treasury/types/child_legal_entity.py index 32c3d007..9ab36dd9 100644 --- a/src/modern_treasury/types/child_legal_entity.py +++ b/src/modern_treasury/types/child_legal_entity.py @@ -7,7 +7,7 @@ from typing_extensions import Literal from .._models import BaseModel -from .shared.legal_entity_compliance_detail import LegalEntityComplianceDetail +from .document import Document from .shared.legal_entity_industry_classification import LegalEntityIndustryClassification __all__ = [ @@ -19,6 +19,9 @@ "Identification", "PhoneNumbers", "PhoneNumber", + "Regulators", + "Regulator", + "ThirdPartyVerification", "WealthAndEmploymentDetails", ] @@ -113,6 +116,8 @@ class Identification(BaseModel): discarded_at: Optional[datetime] = None + documents: List[Document] + expiration_date: Optional[date] = None """ The date when the Identification is no longer considered valid by the issuing @@ -185,11 +190,42 @@ class PhoneNumber(BaseModel): """ +class Regulator(BaseModel): + jurisdiction: str + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: str + """Full name of the regulatory body.""" + + registration_number: str + """Registration or identification number with the regulator.""" + + +Regulators = Regulator +"""This type is deprecated and will be removed in a future release. + +Please use Regulator instead. +""" + + +class ThirdPartyVerification(BaseModel): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Literal["persona"] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: str + """The identification of the third party verification in `vendor`'s system.""" + + class WealthAndEmploymentDetails(BaseModel): id: str annual_income: Optional[int] = None - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: datetime @@ -351,7 +387,7 @@ class ChildLegalEntity(BaseModel): citizenship_country: Optional[str] = None """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] = None + compliance_details: Optional[object] = None country_of_incorporation: Optional[str] = None """ @@ -369,13 +405,15 @@ class ChildLegalEntity(BaseModel): discarded_at: Optional[datetime] = None + documents: List[Document] + doing_business_as_names: List[str] email: Optional[str] = None """The entity's primary email.""" expected_activity_volume: Optional[int] = None - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] = None """An individual's first name.""" @@ -403,6 +441,9 @@ class ChildLegalEntity(BaseModel): ] = None """The business's legal structure.""" + listed_exchange: Optional[str] = None + """ISO 10383 market identifier code.""" + live_mode: bool """ This field will be true if this object exists in the live environment or false @@ -440,12 +481,27 @@ class ChildLegalEntity(BaseModel): primary_social_media_sites: List[str] """A list of primary social media URLs for the business.""" + regulators: Optional[List[Regulator]] = None + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] = None """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] = None + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] = None """An individual's suffix.""" + third_party_verification: Optional[ThirdPartyVerification] = None + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] = None + """Stock ticker symbol for publicly traded companies.""" + updated_at: datetime wealth_and_employment_details: Optional[WealthAndEmploymentDetails] = None diff --git a/src/modern_treasury/types/connection_legal_entity_create_params.py b/src/modern_treasury/types/connection_legal_entity_create_params.py index f0f9feb0..c7961030 100644 --- a/src/modern_treasury/types/connection_legal_entity_create_params.py +++ b/src/modern_treasury/types/connection_legal_entity_create_params.py @@ -9,7 +9,6 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo from .shared_params.identification_create_request import IdentificationCreateRequest -from .shared_params.legal_entity_compliance_detail import LegalEntityComplianceDetail from .shared_params.legal_entity_address_create_request import LegalEntityAddressCreateRequest from .shared_params.legal_entity_industry_classification import LegalEntityIndustryClassification @@ -19,6 +18,9 @@ "LegalEntityBankSettings", "LegalEntityPhoneNumbers", "LegalEntityPhoneNumber", + "LegalEntityRegulators", + "LegalEntityRegulator", + "LegalEntityThirdPartyVerification", "LegalEntityWealthAndEmploymentDetails", ] @@ -86,11 +88,42 @@ class LegalEntityPhoneNumber(TypedDict, total=False): """ +class LegalEntityRegulator(TypedDict, total=False): + jurisdiction: Required[str] + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: Required[str] + """Full name of the regulatory body.""" + + registration_number: Required[str] + """Registration or identification number with the regulator.""" + + +LegalEntityRegulators = LegalEntityRegulator +"""This type is deprecated and will be removed in a future release. + +Please use LegalEntityRegulator instead. +""" + + +class LegalEntityThirdPartyVerification(TypedDict, total=False): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Required[Literal["persona"]] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: Required[str] + """The identification of the third party verification in `vendor`'s system.""" + + class LegalEntityWealthAndEmploymentDetails(TypedDict, total=False): id: Required[str] annual_income: Required[Optional[int]] - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] @@ -262,7 +295,14 @@ class LegalEntity(TypedDict, total=False): citizenship_country: Optional[str] """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] + connection_id: Optional[str] + """The connection ID for the connection the legal entity is associated with. + + Defaults to the id of the connection designated with an is_default value of true + or the id of an existing operational connection if only one is available. Pass + in a value of null to prevent the connection from being associated with the + legal entity. + """ country_of_incorporation: Optional[str] """ @@ -282,7 +322,7 @@ class LegalEntity(TypedDict, total=False): """The entity's primary email.""" expected_activity_volume: Optional[int] - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] """An individual's first name.""" @@ -310,6 +350,9 @@ class LegalEntity(TypedDict, total=False): ] """The business's legal structure.""" + listed_exchange: Optional[str] + """ISO 10383 market identifier code.""" + metadata: Dict[str, str] """Additional data represented as key-value pairs. @@ -339,12 +382,27 @@ class LegalEntity(TypedDict, total=False): primary_social_media_sites: SequenceNotStr[str] """A list of primary social media URLs for the business.""" + regulators: Optional[Iterable[LegalEntityRegulator]] + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] """An individual's suffix.""" + third_party_verification: Optional[LegalEntityThirdPartyVerification] + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] + """Stock ticker symbol for publicly traded companies.""" + wealth_and_employment_details: Optional[LegalEntityWealthAndEmploymentDetails] website: Optional[str] diff --git a/src/modern_treasury/types/counterparty_create_params.py b/src/modern_treasury/types/counterparty_create_params.py index 4ba40cbb..37ff8482 100644 --- a/src/modern_treasury/types/counterparty_create_params.py +++ b/src/modern_treasury/types/counterparty_create_params.py @@ -13,7 +13,6 @@ from .contact_detail_create_request_param import ContactDetailCreateRequestParam from .shared_params.identification_create_request import IdentificationCreateRequest from .shared_params.ledger_account_create_request import LedgerAccountCreateRequest -from .shared_params.legal_entity_compliance_detail import LegalEntityComplianceDetail from .shared_params.legal_entity_address_create_request import LegalEntityAddressCreateRequest from .shared_params.legal_entity_industry_classification import LegalEntityIndustryClassification @@ -30,6 +29,9 @@ "LegalEntityBankSettings", "LegalEntityPhoneNumbers", "LegalEntityPhoneNumber", + "LegalEntityRegulators", + "LegalEntityRegulator", + "LegalEntityThirdPartyVerification", "LegalEntityWealthAndEmploymentDetails", ] @@ -93,6 +95,7 @@ class AccountAccountDetail(TypedDict, total=False): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", @@ -305,11 +308,42 @@ class LegalEntityPhoneNumber(TypedDict, total=False): """ +class LegalEntityRegulator(TypedDict, total=False): + jurisdiction: Required[str] + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: Required[str] + """Full name of the regulatory body.""" + + registration_number: Required[str] + """Registration or identification number with the regulator.""" + + +LegalEntityRegulators = LegalEntityRegulator +"""This type is deprecated and will be removed in a future release. + +Please use LegalEntityRegulator instead. +""" + + +class LegalEntityThirdPartyVerification(TypedDict, total=False): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Required[Literal["persona"]] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: Required[str] + """The identification of the third party verification in `vendor`'s system.""" + + class LegalEntityWealthAndEmploymentDetails(TypedDict, total=False): id: Required[str] annual_income: Required[Optional[int]] - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] @@ -482,7 +516,14 @@ class LegalEntity(TypedDict, total=False): citizenship_country: Optional[str] """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] + connection_id: Optional[str] + """The connection ID for the connection the legal entity is associated with. + + Defaults to the id of the connection designated with an is_default value of true + or the id of an existing operational connection if only one is available. Pass + in a value of null to prevent the connection from being associated with the + legal entity. + """ country_of_incorporation: Optional[str] """ @@ -502,7 +543,7 @@ class LegalEntity(TypedDict, total=False): """The entity's primary email.""" expected_activity_volume: Optional[int] - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] """An individual's first name.""" @@ -527,6 +568,9 @@ class LegalEntity(TypedDict, total=False): ] """The business's legal structure.""" + listed_exchange: Optional[str] + """ISO 10383 market identifier code.""" + metadata: Dict[str, str] """Additional data represented as key-value pairs. @@ -556,12 +600,27 @@ class LegalEntity(TypedDict, total=False): primary_social_media_sites: SequenceNotStr[str] """A list of primary social media URLs for the business.""" + regulators: Optional[Iterable[LegalEntityRegulator]] + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] """An individual's suffix.""" + third_party_verification: Optional[LegalEntityThirdPartyVerification] + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] + """Stock ticker symbol for publicly traded companies.""" + wealth_and_employment_details: Optional[LegalEntityWealthAndEmploymentDetails] website: Optional[str] diff --git a/src/modern_treasury/types/external_account_create_params.py b/src/modern_treasury/types/external_account_create_params.py index 051d0045..2729e2fb 100644 --- a/src/modern_treasury/types/external_account_create_params.py +++ b/src/modern_treasury/types/external_account_create_params.py @@ -76,6 +76,7 @@ class AccountDetail(TypedDict, total=False): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/types/incoming_payment_detail.py b/src/modern_treasury/types/incoming_payment_detail.py index ff8de187..b3a307e5 100644 --- a/src/modern_treasury/types/incoming_payment_detail.py +++ b/src/modern_treasury/types/incoming_payment_detail.py @@ -5,6 +5,7 @@ from typing_extensions import Literal from .._models import BaseModel +from .shared.address import Address from .shared.currency import Currency from .virtual_account import VirtualAccount from .shared.transaction_direction import TransactionDirection @@ -71,6 +72,7 @@ class IncomingPaymentDetail(BaseModel): Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", @@ -177,3 +179,17 @@ class IncomingPaymentDetail(BaseModel): originating_account_number: Optional[str] = None """The account number of the originating account for the incoming payment detail.""" + + originating_party_address: Optional[Address] = None + """ + The address of the originating party for the incoming payment detail, or `null`. + """ + + originating_party_name: Optional[str] = None + """The name of the originating party for the incoming payment detail.""" + + originating_party_vendor_identifier: Optional[str] = None + """ + The vendor-assigned identifier for the originating party of the incoming payment + detail, or `null`. + """ diff --git a/src/modern_treasury/types/ledger_account_category_create_params.py b/src/modern_treasury/types/ledger_account_category_create_params.py index 329d1600..3d8ee37f 100644 --- a/src/modern_treasury/types/ledger_account_category_create_params.py +++ b/src/modern_treasury/types/ledger_account_category_create_params.py @@ -30,6 +30,9 @@ class LedgerAccountCategoryCreateParams(TypedDict, total=False): description: Optional[str] """The description of the ledger account category.""" + external_id: Optional[str] + """An optional user-defined 180 character unique identifier.""" + ledger_account_category_ids: SequenceNotStr[str] """ The array of ledger account category ids that this ledger account category diff --git a/src/modern_treasury/types/ledger_account_category_list_params.py b/src/modern_treasury/types/ledger_account_category_list_params.py index 8855b3bc..804e356d 100644 --- a/src/modern_treasury/types/ledger_account_category_list_params.py +++ b/src/modern_treasury/types/ledger_account_category_list_params.py @@ -48,11 +48,7 @@ class LedgerAccountCategoryListParams(TypedDict, total=False): parameters. """ - name: SequenceNotStr[str] - """ - 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`. - """ + name: str parent_ledger_account_category_id: str """Query categories that are nested underneath a parent category""" diff --git a/src/modern_treasury/types/ledger_account_create_params.py b/src/modern_treasury/types/ledger_account_create_params.py index 09f33a2c..0e56366e 100644 --- a/src/modern_treasury/types/ledger_account_create_params.py +++ b/src/modern_treasury/types/ledger_account_create_params.py @@ -30,6 +30,9 @@ class LedgerAccountCreateParams(TypedDict, total=False): description: Optional[str] """The description of the ledger account.""" + external_id: Optional[str] + """An optional user-defined 180 character unique identifier.""" + ledger_account_category_ids: SequenceNotStr[str] """ The array of ledger account category ids that this ledger account should be a diff --git a/src/modern_treasury/types/ledger_entry_list_params.py b/src/modern_treasury/types/ledger_entry_list_params.py index ad931bd0..0e179f75 100644 --- a/src/modern_treasury/types/ledger_entry_list_params.py +++ b/src/modern_treasury/types/ledger_entry_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, List, Union, Optional +from typing import Dict, Union, Optional from datetime import date, datetime from typing_extensions import Literal, TypedDict @@ -106,7 +106,7 @@ class LedgerEntryListParams(TypedDict, total=False): previous entries are deleted. """ - status: List[Literal["pending", "posted", "archived"]] + status: Literal["pending", "posted", "archived"] """Get all ledger entries that match the status specified. One of `pending`, `posted`, or `archived`. For multiple statuses, use diff --git a/src/modern_treasury/types/legal_entity.py b/src/modern_treasury/types/legal_entity.py index d2138e2d..a596a2ca 100644 --- a/src/modern_treasury/types/legal_entity.py +++ b/src/modern_treasury/types/legal_entity.py @@ -7,7 +7,7 @@ from typing_extensions import Literal from .._models import BaseModel -from .shared.legal_entity_compliance_detail import LegalEntityComplianceDetail +from .document import Document from .shared.legal_entity_industry_classification import LegalEntityIndustryClassification __all__ = [ @@ -19,6 +19,9 @@ "Identification", "PhoneNumbers", "PhoneNumber", + "Regulators", + "Regulator", + "ThirdPartyVerification", "WealthAndEmploymentDetails", ] @@ -113,6 +116,8 @@ class Identification(BaseModel): discarded_at: Optional[datetime] = None + documents: List[Document] + expiration_date: Optional[date] = None """ The date when the Identification is no longer considered valid by the issuing @@ -185,11 +190,42 @@ class PhoneNumber(BaseModel): """ +class Regulator(BaseModel): + jurisdiction: str + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: str + """Full name of the regulatory body.""" + + registration_number: str + """Registration or identification number with the regulator.""" + + +Regulators = Regulator +"""This type is deprecated and will be removed in a future release. + +Please use Regulator instead. +""" + + +class ThirdPartyVerification(BaseModel): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Literal["persona"] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: str + """The identification of the third party verification in `vendor`'s system.""" + + class WealthAndEmploymentDetails(BaseModel): id: str annual_income: Optional[int] = None - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: datetime @@ -351,7 +387,7 @@ class LegalEntity(BaseModel): citizenship_country: Optional[str] = None """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] = None + compliance_details: Optional[object] = None country_of_incorporation: Optional[str] = None """ @@ -369,13 +405,15 @@ class LegalEntity(BaseModel): discarded_at: Optional[datetime] = None + documents: List[Document] + doing_business_as_names: List[str] email: Optional[str] = None """The entity's primary email.""" expected_activity_volume: Optional[int] = None - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] = None """An individual's first name.""" @@ -400,6 +438,9 @@ class LegalEntity(BaseModel): ] = None """The business's legal structure.""" + listed_exchange: Optional[str] = None + """ISO 10383 market identifier code.""" + live_mode: bool """ This field will be true if this object exists in the live environment or false @@ -437,12 +478,27 @@ class LegalEntity(BaseModel): primary_social_media_sites: List[str] """A list of primary social media URLs for the business.""" + regulators: Optional[List[Regulator]] = None + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] = None """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] = None + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] = None """An individual's suffix.""" + third_party_verification: Optional[ThirdPartyVerification] = None + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] = None + """Stock ticker symbol for publicly traded companies.""" + updated_at: datetime wealth_and_employment_details: Optional[WealthAndEmploymentDetails] = None diff --git a/src/modern_treasury/types/legal_entity_create_params.py b/src/modern_treasury/types/legal_entity_create_params.py index ecfdba5a..c404f095 100644 --- a/src/modern_treasury/types/legal_entity_create_params.py +++ b/src/modern_treasury/types/legal_entity_create_params.py @@ -9,11 +9,19 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo from .shared_params.identification_create_request import IdentificationCreateRequest -from .shared_params.legal_entity_compliance_detail import LegalEntityComplianceDetail from .shared_params.legal_entity_address_create_request import LegalEntityAddressCreateRequest from .shared_params.legal_entity_industry_classification import LegalEntityIndustryClassification -__all__ = ["LegalEntityCreateParams", "BankSettings", "PhoneNumbers", "PhoneNumber", "WealthAndEmploymentDetails"] +__all__ = [ + "LegalEntityCreateParams", + "BankSettings", + "PhoneNumbers", + "PhoneNumber", + "Regulators", + "Regulator", + "ThirdPartyVerification", + "WealthAndEmploymentDetails", +] class LegalEntityCreateParams(TypedDict, total=False): @@ -34,7 +42,14 @@ class LegalEntityCreateParams(TypedDict, total=False): citizenship_country: Optional[str] """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] + connection_id: Optional[str] + """The connection ID for the connection the legal entity is associated with. + + Defaults to the id of the connection designated with an is_default value of true + or the id of an existing operational connection if only one is available. Pass + in a value of null to prevent the connection from being associated with the + legal entity. + """ country_of_incorporation: Optional[str] """ @@ -54,7 +69,7 @@ class LegalEntityCreateParams(TypedDict, total=False): """The entity's primary email.""" expected_activity_volume: Optional[int] - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] """An individual's first name.""" @@ -79,6 +94,9 @@ class LegalEntityCreateParams(TypedDict, total=False): ] """The business's legal structure.""" + listed_exchange: Optional[str] + """ISO 10383 market identifier code.""" + metadata: Dict[str, str] """Additional data represented as key-value pairs. @@ -108,12 +126,27 @@ class LegalEntityCreateParams(TypedDict, total=False): primary_social_media_sites: SequenceNotStr[str] """A list of primary social media URLs for the business.""" + regulators: Optional[Iterable[Regulator]] + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] """An individual's suffix.""" + third_party_verification: Optional[ThirdPartyVerification] + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] + """Stock ticker symbol for publicly traded companies.""" + wealth_and_employment_details: Optional[WealthAndEmploymentDetails] website: Optional[str] @@ -172,11 +205,42 @@ class PhoneNumber(TypedDict, total=False): """ +class Regulator(TypedDict, total=False): + jurisdiction: Required[str] + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: Required[str] + """Full name of the regulatory body.""" + + registration_number: Required[str] + """Registration or identification number with the regulator.""" + + +Regulators = Regulator +"""This type is deprecated and will be removed in a future release. + +Please use Regulator instead. +""" + + +class ThirdPartyVerification(TypedDict, total=False): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Required[Literal["persona"]] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: Required[str] + """The identification of the third party verification in `vendor`'s system.""" + + class WealthAndEmploymentDetails(TypedDict, total=False): id: Required[str] annual_income: Required[Optional[int]] - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] diff --git a/src/modern_treasury/types/legal_entity_list_params.py b/src/modern_treasury/types/legal_entity_list_params.py index 19178adc..d87e43bd 100644 --- a/src/modern_treasury/types/legal_entity_list_params.py +++ b/src/modern_treasury/types/legal_entity_list_params.py @@ -23,3 +23,5 @@ class LegalEntityListParams(TypedDict, total=False): per_page: int show_deleted: str + + status: Literal["pending", "active", "suspended", "closed"] diff --git a/src/modern_treasury/types/legal_entity_update_params.py b/src/modern_treasury/types/legal_entity_update_params.py index 1356b488..fdcba691 100644 --- a/src/modern_treasury/types/legal_entity_update_params.py +++ b/src/modern_treasury/types/legal_entity_update_params.py @@ -9,11 +9,19 @@ from .._types import SequenceNotStr from .._utils import PropertyInfo from .shared_params.identification_create_request import IdentificationCreateRequest -from .shared_params.legal_entity_compliance_detail import LegalEntityComplianceDetail from .shared_params.legal_entity_address_create_request import LegalEntityAddressCreateRequest from .shared_params.legal_entity_industry_classification import LegalEntityIndustryClassification -__all__ = ["LegalEntityUpdateParams", "BankSettings", "PhoneNumbers", "PhoneNumber", "WealthAndEmploymentDetails"] +__all__ = [ + "LegalEntityUpdateParams", + "BankSettings", + "PhoneNumbers", + "PhoneNumber", + "Regulators", + "Regulator", + "ThirdPartyVerification", + "WealthAndEmploymentDetails", +] class LegalEntityUpdateParams(TypedDict, total=False): @@ -31,8 +39,6 @@ class LegalEntityUpdateParams(TypedDict, total=False): citizenship_country: Optional[str] """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] - country_of_incorporation: Optional[str] """ The country code where the business is incorporated in the ISO 3166-1 alpha-2 or @@ -51,7 +57,7 @@ class LegalEntityUpdateParams(TypedDict, total=False): """The entity's primary email.""" expected_activity_volume: Optional[int] - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] """An individual's first name.""" @@ -73,6 +79,9 @@ class LegalEntityUpdateParams(TypedDict, total=False): ] """The business's legal structure.""" + listed_exchange: Optional[str] + """ISO 10383 market identifier code.""" + metadata: Dict[str, str] """Additional data represented as key-value pairs. @@ -102,12 +111,27 @@ class LegalEntityUpdateParams(TypedDict, total=False): primary_social_media_sites: SequenceNotStr[str] """A list of primary social media URLs for the business.""" + regulators: Optional[Iterable[Regulator]] + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] """An individual's suffix.""" + third_party_verification: Optional[ThirdPartyVerification] + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] + """Stock ticker symbol for publicly traded companies.""" + wealth_and_employment_details: Optional[WealthAndEmploymentDetails] website: Optional[str] @@ -166,11 +190,42 @@ class PhoneNumber(TypedDict, total=False): """ +class Regulator(TypedDict, total=False): + jurisdiction: Required[str] + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: Required[str] + """Full name of the regulatory body.""" + + registration_number: Required[str] + """Registration or identification number with the regulator.""" + + +Regulators = Regulator +"""This type is deprecated and will be removed in a future release. + +Please use Regulator instead. +""" + + +class ThirdPartyVerification(TypedDict, total=False): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Required[Literal["persona"]] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: Required[str] + """The identification of the third party verification in `vendor`'s system.""" + + class WealthAndEmploymentDetails(TypedDict, total=False): id: Required[str] annual_income: Required[Optional[int]] - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] diff --git a/src/modern_treasury/types/payment_order.py b/src/modern_treasury/types/payment_order.py index 480f999a..08a719cd 100644 --- a/src/modern_treasury/types/payment_order.py +++ b/src/modern_treasury/types/payment_order.py @@ -175,8 +175,6 @@ class ReferenceNumber(BaseModel): "silvergate_payment_id", "svb_end_to_end_id", "svb_payment_id", - "svb_transaction_cleared_for_sanctions_review", - "svb_transaction_held_for_sanctions_review", "swift_mir", "swift_uetr", "umb_product_partner_account_number", @@ -232,6 +230,12 @@ class PaymentOrder(BaseModel): allowed by the network is $100,000. """ + batch_id: Optional[str] = None + """The ID of the batch in which the payment order is included. + + Only populated after the payment order begins processing. + """ + charge_bearer: Optional[Literal["shared", "sender", "receiver"]] = None """The party that will pay the fees for 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 8dc48305..196beb01 100644 --- a/src/modern_treasury/types/payment_order_create_async_params.py +++ b/src/modern_treasury/types/payment_order_create_async_params.py @@ -300,6 +300,7 @@ class ReceivingAccountAccountDetail(TypedDict, total=False): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/types/payment_order_create_params.py b/src/modern_treasury/types/payment_order_create_params.py index 14e6de91..12ebb784 100644 --- a/src/modern_treasury/types/payment_order_create_params.py +++ b/src/modern_treasury/types/payment_order_create_params.py @@ -341,6 +341,7 @@ class ReceivingAccountAccountDetail(TypedDict, total=False): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/types/payment_order_update_params.py b/src/modern_treasury/types/payment_order_update_params.py index 27765ce8..3b801d71 100644 --- a/src/modern_treasury/types/payment_order_update_params.py +++ b/src/modern_treasury/types/payment_order_update_params.py @@ -317,6 +317,7 @@ class ReceivingAccountAccountDetail(TypedDict, total=False): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/src/modern_treasury/types/payment_reference.py b/src/modern_treasury/types/payment_reference.py index 60650a6a..7b532c9c 100644 --- a/src/modern_treasury/types/payment_reference.py +++ b/src/modern_treasury/types/payment_reference.py @@ -99,8 +99,6 @@ class PaymentReference(BaseModel): "silvergate_payment_id", "svb_end_to_end_id", "svb_payment_id", - "svb_transaction_cleared_for_sanctions_review", - "svb_transaction_held_for_sanctions_review", "swift_mir", "swift_uetr", "umb_product_partner_account_number", diff --git a/src/modern_treasury/types/return_object.py b/src/modern_treasury/types/return_object.py index 48ee14a8..325a0918 100644 --- a/src/modern_treasury/types/return_object.py +++ b/src/modern_treasury/types/return_object.py @@ -147,8 +147,6 @@ class ReferenceNumber(BaseModel): "silvergate_payment_id", "svb_end_to_end_id", "svb_payment_id", - "svb_transaction_cleared_for_sanctions_review", - "svb_transaction_held_for_sanctions_review", "swift_mir", "swift_uetr", "umb_product_partner_account_number", diff --git a/src/modern_treasury/types/shared/__init__.py b/src/modern_treasury/types/shared/__init__.py index 32d066c6..f854d293 100644 --- a/src/modern_treasury/types/shared/__init__.py +++ b/src/modern_treasury/types/shared/__init__.py @@ -14,7 +14,6 @@ from .ledger_entry_create_request import LedgerEntryCreateRequest as LedgerEntryCreateRequest from .identification_create_request import IdentificationCreateRequest as IdentificationCreateRequest from .ledger_account_create_request import LedgerAccountCreateRequest as LedgerAccountCreateRequest -from .legal_entity_compliance_detail import LegalEntityComplianceDetail as LegalEntityComplianceDetail from .ledger_transaction_create_request import LedgerTransactionCreateRequest as LedgerTransactionCreateRequest from .legal_entity_address_create_request import LegalEntityAddressCreateRequest as LegalEntityAddressCreateRequest from .legal_entity_industry_classification import LegalEntityIndustryClassification as LegalEntityIndustryClassification diff --git a/src/modern_treasury/types/shared/child_legal_entity_create.py b/src/modern_treasury/types/shared/child_legal_entity_create.py index 6bd6017c..b201f605 100644 --- a/src/modern_treasury/types/shared/child_legal_entity_create.py +++ b/src/modern_treasury/types/shared/child_legal_entity_create.py @@ -8,11 +8,19 @@ from ..._models import BaseModel from .identification_create_request import IdentificationCreateRequest -from .legal_entity_compliance_detail import LegalEntityComplianceDetail from .legal_entity_address_create_request import LegalEntityAddressCreateRequest from .legal_entity_industry_classification import LegalEntityIndustryClassification -__all__ = ["ChildLegalEntityCreate", "BankSettings", "PhoneNumbers", "PhoneNumber", "WealthAndEmploymentDetails"] +__all__ = [ + "ChildLegalEntityCreate", + "BankSettings", + "PhoneNumbers", + "PhoneNumber", + "Regulators", + "Regulator", + "ThirdPartyVerification", + "WealthAndEmploymentDetails", +] class BankSettings(BaseModel): @@ -67,11 +75,42 @@ class PhoneNumber(BaseModel): """ +class Regulator(BaseModel): + jurisdiction: str + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: str + """Full name of the regulatory body.""" + + registration_number: str + """Registration or identification number with the regulator.""" + + +Regulators = Regulator +"""This type is deprecated and will be removed in a future release. + +Please use Regulator instead. +""" + + +class ThirdPartyVerification(BaseModel): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Literal["persona"] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: str + """The identification of the third party verification in `vendor`'s system.""" + + class WealthAndEmploymentDetails(BaseModel): id: str annual_income: Optional[int] = None - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: datetime @@ -231,7 +270,14 @@ class ChildLegalEntityCreate(BaseModel): citizenship_country: Optional[str] = None """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] = None + connection_id: Optional[str] = None + """The connection ID for the connection the legal entity is associated with. + + Defaults to the id of the connection designated with an is_default value of true + or the id of an existing operational connection if only one is available. Pass + in a value of null to prevent the connection from being associated with the + legal entity. + """ country_of_incorporation: Optional[str] = None """ @@ -251,7 +297,7 @@ class ChildLegalEntityCreate(BaseModel): """The entity's primary email.""" expected_activity_volume: Optional[int] = None - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] = None """An individual's first name.""" @@ -279,6 +325,9 @@ class ChildLegalEntityCreate(BaseModel): ] = None """The business's legal structure.""" + listed_exchange: Optional[str] = None + """ISO 10383 market identifier code.""" + metadata: Optional[Dict[str, str]] = None """Additional data represented as key-value pairs. @@ -308,12 +357,27 @@ class ChildLegalEntityCreate(BaseModel): primary_social_media_sites: Optional[List[str]] = None """A list of primary social media URLs for the business.""" + regulators: Optional[List[Regulator]] = None + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] = None """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] = None + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] = None """An individual's suffix.""" + third_party_verification: Optional[ThirdPartyVerification] = None + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] = None + """Stock ticker symbol for publicly traded companies.""" + wealth_and_employment_details: Optional[WealthAndEmploymentDetails] = None website: Optional[str] = None diff --git a/src/modern_treasury/types/shared/ledger_account_create_request.py b/src/modern_treasury/types/shared/ledger_account_create_request.py index aa9c560f..4143da49 100644 --- a/src/modern_treasury/types/shared/ledger_account_create_request.py +++ b/src/modern_treasury/types/shared/ledger_account_create_request.py @@ -28,6 +28,9 @@ class LedgerAccountCreateRequest(BaseModel): description: Optional[str] = None """The description of the ledger account.""" + external_id: Optional[str] = None + """An optional user-defined 180 character unique identifier.""" + ledger_account_category_ids: Optional[List[str]] = None """ The array of ledger account category ids that this ledger account should be a diff --git a/src/modern_treasury/types/shared/legal_entity_compliance_detail.py b/src/modern_treasury/types/shared/legal_entity_compliance_detail.py deleted file mode 100644 index dc74a910..00000000 --- a/src/modern_treasury/types/shared/legal_entity_compliance_detail.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["LegalEntityComplianceDetail"] - - -class LegalEntityComplianceDetail(BaseModel): - id: str - - created_at: datetime - - discarded_at: Optional[datetime] = None - - issuer: str - """The issuer of the compliance token.""" - - 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. - """ - - object: str - - token_expires_at: Optional[datetime] = None - """The timestamp when the compliance token expires.""" - - token_issued_at: Optional[datetime] = None - """The timestamp when the compliance token was issued.""" - - token_url: Optional[str] = None - """The URL to the compliance token. (ex. provider portal URL)""" - - updated_at: datetime - - validated: bool - """Whether entity corresponding to the compliance token has been validated.""" - - validated_at: Optional[datetime] = None - """The timestamp when the entity was validated.""" diff --git a/src/modern_treasury/types/shared_params/__init__.py b/src/modern_treasury/types/shared_params/__init__.py index 7b343174..871f8184 100644 --- a/src/modern_treasury/types/shared_params/__init__.py +++ b/src/modern_treasury/types/shared_params/__init__.py @@ -9,7 +9,6 @@ from .ledger_entry_create_request import LedgerEntryCreateRequest as LedgerEntryCreateRequest from .identification_create_request import IdentificationCreateRequest as IdentificationCreateRequest from .ledger_account_create_request import LedgerAccountCreateRequest as LedgerAccountCreateRequest -from .legal_entity_compliance_detail import LegalEntityComplianceDetail as LegalEntityComplianceDetail from .ledger_transaction_create_request import LedgerTransactionCreateRequest as LedgerTransactionCreateRequest from .legal_entity_address_create_request import LegalEntityAddressCreateRequest as LegalEntityAddressCreateRequest from .legal_entity_industry_classification import LegalEntityIndustryClassification as LegalEntityIndustryClassification diff --git a/src/modern_treasury/types/shared_params/child_legal_entity_create.py b/src/modern_treasury/types/shared_params/child_legal_entity_create.py index a477224e..e4fd9c1f 100644 --- a/src/modern_treasury/types/shared_params/child_legal_entity_create.py +++ b/src/modern_treasury/types/shared_params/child_legal_entity_create.py @@ -9,11 +9,19 @@ from ..._types import SequenceNotStr from ..._utils import PropertyInfo from .identification_create_request import IdentificationCreateRequest -from .legal_entity_compliance_detail import LegalEntityComplianceDetail from .legal_entity_address_create_request import LegalEntityAddressCreateRequest from .legal_entity_industry_classification import LegalEntityIndustryClassification -__all__ = ["ChildLegalEntityCreate", "BankSettings", "PhoneNumbers", "PhoneNumber", "WealthAndEmploymentDetails"] +__all__ = [ + "ChildLegalEntityCreate", + "BankSettings", + "PhoneNumbers", + "PhoneNumber", + "Regulators", + "Regulator", + "ThirdPartyVerification", + "WealthAndEmploymentDetails", +] class BankSettings(TypedDict, total=False): @@ -68,11 +76,42 @@ class PhoneNumber(TypedDict, total=False): """ +class Regulator(TypedDict, total=False): + jurisdiction: Required[str] + """ + The country code where the regulator operates in the ISO 3166-1 alpha-2 format + (e.g., "US", "CA", "GB"). + """ + + name: Required[str] + """Full name of the regulatory body.""" + + registration_number: Required[str] + """Registration or identification number with the regulator.""" + + +Regulators = Regulator +"""This type is deprecated and will be removed in a future release. + +Please use Regulator instead. +""" + + +class ThirdPartyVerification(TypedDict, total=False): + """Information describing a third-party verification run by an external vendor.""" + + vendor: Required[Literal["persona"]] + """The vendor that performed the verification, e.g. `persona`.""" + + vendor_verification_id: Required[str] + """The identification of the third party verification in `vendor`'s system.""" + + class WealthAndEmploymentDetails(TypedDict, total=False): id: Required[str] annual_income: Required[Optional[int]] - """The annual income of the individual.""" + """The annual income of the individual in USD.""" created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] @@ -242,7 +281,14 @@ class ChildLegalEntityCreate(TypedDict, total=False): citizenship_country: Optional[str] """The country of citizenship for an individual.""" - compliance_details: Optional[LegalEntityComplianceDetail] + connection_id: Optional[str] + """The connection ID for the connection the legal entity is associated with. + + Defaults to the id of the connection designated with an is_default value of true + or the id of an existing operational connection if only one is available. Pass + in a value of null to prevent the connection from being associated with the + legal entity. + """ country_of_incorporation: Optional[str] """ @@ -262,7 +308,7 @@ class ChildLegalEntityCreate(TypedDict, total=False): """The entity's primary email.""" expected_activity_volume: Optional[int] - """Monthly expected transaction volume in entity's local currency.""" + """Monthly expected transaction volume in USD.""" first_name: Optional[str] """An individual's first name.""" @@ -290,6 +336,9 @@ class ChildLegalEntityCreate(TypedDict, total=False): ] """The business's legal structure.""" + listed_exchange: Optional[str] + """ISO 10383 market identifier code.""" + metadata: Dict[str, str] """Additional data represented as key-value pairs. @@ -319,12 +368,27 @@ class ChildLegalEntityCreate(TypedDict, total=False): primary_social_media_sites: SequenceNotStr[str] """A list of primary social media URLs for the business.""" + regulators: Optional[Iterable[Regulator]] + """Array of regulatory bodies overseeing this institution.""" + risk_rating: Optional[Literal["low", "medium", "high"]] """The risk rating of the legal entity. One of low, medium, high.""" + status: Optional[Literal["active", "closed", "pending", "suspended"]] + """The activation status of the legal entity. + + One of pending, active, suspended, or closed. + """ + suffix: Optional[str] """An individual's suffix.""" + third_party_verification: Optional[ThirdPartyVerification] + """Information describing a third-party verification run by an external vendor.""" + + ticker_symbol: Optional[str] + """Stock ticker symbol for publicly traded companies.""" + wealth_and_employment_details: Optional[WealthAndEmploymentDetails] website: Optional[str] diff --git a/src/modern_treasury/types/shared_params/ledger_account_create_request.py b/src/modern_treasury/types/shared_params/ledger_account_create_request.py index f90ae769..cc87ceaf 100644 --- a/src/modern_treasury/types/shared_params/ledger_account_create_request.py +++ b/src/modern_treasury/types/shared_params/ledger_account_create_request.py @@ -30,6 +30,9 @@ class LedgerAccountCreateRequest(TypedDict, total=False): description: Optional[str] """The description of the ledger account.""" + external_id: Optional[str] + """An optional user-defined 180 character unique identifier.""" + ledger_account_category_ids: SequenceNotStr[str] """ The array of ledger account category ids that this ledger account should be a diff --git a/src/modern_treasury/types/shared_params/legal_entity_compliance_detail.py b/src/modern_treasury/types/shared_params/legal_entity_compliance_detail.py deleted file mode 100644 index edc1d1f3..00000000 --- a/src/modern_treasury/types/shared_params/legal_entity_compliance_detail.py +++ /dev/null @@ -1,47 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Optional -from datetime import datetime -from typing_extensions import Required, Annotated, TypedDict - -from ..._utils import PropertyInfo - -__all__ = ["LegalEntityComplianceDetail"] - - -class LegalEntityComplianceDetail(TypedDict, total=False): - id: Required[str] - - created_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] - - discarded_at: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] - - issuer: Required[str] - """The issuer of the compliance token.""" - - live_mode: Required[bool] - """ - This field will be true if this object exists in the live environment or false - if it exists in the test environment. - """ - - object: Required[str] - - token_expires_at: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] - """The timestamp when the compliance token expires.""" - - token_issued_at: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] - """The timestamp when the compliance token was issued.""" - - token_url: Required[Optional[str]] - """The URL to the compliance token. (ex. provider portal URL)""" - - updated_at: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]] - - validated: Required[bool] - """Whether entity corresponding to the compliance token has been validated.""" - - validated_at: Required[Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]] - """The timestamp when the entity was validated.""" diff --git a/src/modern_treasury/types/transaction.py b/src/modern_treasury/types/transaction.py index fd035459..5ff00e14 100644 --- a/src/modern_treasury/types/transaction.py +++ b/src/modern_treasury/types/transaction.py @@ -152,7 +152,7 @@ class Transaction(BaseModel): "hifi", "iso20022", "jpmc", - "mt_flow", + "modern_treasury", "mx", "paxos", "paypal", diff --git a/src/modern_treasury/types/virtual_account_create_params.py b/src/modern_treasury/types/virtual_account_create_params.py index fde40b3b..3c7eeae1 100644 --- a/src/modern_treasury/types/virtual_account_create_params.py +++ b/src/modern_treasury/types/virtual_account_create_params.py @@ -64,6 +64,7 @@ class AccountDetail(TypedDict, total=False): account_number_type: Literal[ "au_number", "base_address", + "card_token", "clabe", "ethereum_address", "hk_number", diff --git a/tests/api_resources/test_bulk_requests.py b/tests/api_resources/test_bulk_requests.py index c5ff0d73..ba49fd84 100644 --- a/tests/api_resources/test_bulk_requests.py +++ b/tests/api_resources/test_bulk_requests.py @@ -139,6 +139,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -440,6 +441,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", diff --git a/tests/api_resources/test_connection_legal_entities.py b/tests/api_resources/test_connection_legal_entities.py index 634e7fcc..f2247c1a 100644 --- a/tests/api_resources/test_connection_legal_entities.py +++ b/tests/api_resources/test_connection_legal_entities.py @@ -59,20 +59,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -133,20 +120,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -180,6 +154,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "legal_entity_associations": [], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -192,8 +167,21 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -223,6 +211,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: ], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -235,8 +224,21 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -451,20 +453,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -525,20 +514,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -572,6 +548,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "legal_entity_associations": [], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -584,8 +561,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -615,6 +605,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea ], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -627,8 +618,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, diff --git a/tests/api_resources/test_counterparties.py b/tests/api_resources/test_counterparties.py index 62abd915..944e8caa 100644 --- a/tests/api_resources/test_counterparties.py +++ b/tests/api_resources/test_counterparties.py @@ -57,6 +57,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -124,20 +125,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -198,20 +186,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -245,6 +220,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "legal_entity_associations": [], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -257,8 +233,21 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -287,6 +276,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: } ], "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -299,8 +289,21 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -620,6 +623,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -687,20 +691,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -761,20 +752,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -808,6 +786,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "legal_entity_associations": [], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -820,8 +799,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -850,6 +842,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea } ], "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -862,8 +855,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, diff --git a/tests/api_resources/test_external_accounts.py b/tests/api_resources/test_external_accounts.py index abea9189..64913012 100644 --- a/tests/api_resources/test_external_accounts.py +++ b/tests/api_resources/test_external_accounts.py @@ -53,6 +53,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -428,6 +429,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", diff --git a/tests/api_resources/test_ledger_account_categories.py b/tests/api_resources/test_ledger_account_categories.py index 4d92f6e6..05b16795 100644 --- a/tests/api_resources/test_ledger_account_categories.py +++ b/tests/api_resources/test_ledger_account_categories.py @@ -40,6 +40,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: normal_balance="credit", currency_exponent=0, description="description", + external_id="external_id", ledger_account_category_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={ "key": "value", @@ -196,7 +197,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: ledger_account_id="ledger_account_id", ledger_id="ledger_id", metadata={"foo": "string"}, - name=["string"], + name="name", parent_ledger_account_category_id="parent_ledger_account_category_id", per_page=0, ) @@ -477,6 +478,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea normal_balance="credit", currency_exponent=0, description="description", + external_id="external_id", ledger_account_category_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], metadata={ "key": "value", @@ -633,7 +635,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncModernTreasu ledger_account_id="ledger_account_id", ledger_id="ledger_id", metadata={"foo": "string"}, - name=["string"], + name="name", parent_ledger_account_category_id="parent_ledger_account_category_id", per_page=0, ) diff --git a/tests/api_resources/test_ledger_accounts.py b/tests/api_resources/test_ledger_accounts.py index 80845d0f..c24c08be 100644 --- a/tests/api_resources/test_ledger_accounts.py +++ b/tests/api_resources/test_ledger_accounts.py @@ -40,6 +40,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: normal_balance="credit", currency_exponent=0, description="description", + external_id="external_id", ledger_account_category_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ledgerable_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ledgerable_type="counterparty", @@ -321,6 +322,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea normal_balance="credit", currency_exponent=0, description="description", + external_id="external_id", ledger_account_category_ids=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], ledgerable_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ledgerable_type="counterparty", diff --git a/tests/api_resources/test_ledger_entries.py b/tests/api_resources/test_ledger_entries.py index 8b21dda2..cbbbe3ac 100644 --- a/tests/api_resources/test_ledger_entries.py +++ b/tests/api_resources/test_ledger_entries.py @@ -153,7 +153,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: per_page=0, show_balances=True, show_deleted=True, - status=["pending"], + status="pending", updated_at={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, ) assert_matches_type(SyncPage[LedgerEntry], ledger_entry, path=["response"]) @@ -316,7 +316,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncModernTreasu per_page=0, show_balances=True, show_deleted=True, - status=["pending"], + status="pending", updated_at={"foo": parse_datetime("2019-12-27T18:11:19.117Z")}, ) assert_matches_type(AsyncPage[LedgerEntry], ledger_entry, path=["response"]) diff --git a/tests/api_resources/test_legal_entities.py b/tests/api_resources/test_legal_entities.py index 8711cf3f..e8c93158 100644 --- a/tests/api_resources/test_legal_entities.py +++ b/tests/api_resources/test_legal_entities.py @@ -59,20 +59,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: business_description="business_description", business_name="business_name", citizenship_country="citizenship_country", - compliance_details={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + connection_id="connection_id", country_of_incorporation="country_of_incorporation", date_formed=parse_date("2019-12-27"), date_of_birth=parse_date("2019-12-27"), @@ -133,20 +120,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -180,6 +154,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "legal_entity_associations": [], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -192,8 +167,21 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -222,6 +210,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: } ], legal_structure="corporation", + listed_exchange="listed_exchange", metadata={ "key": "value", "foo": "bar", @@ -234,8 +223,21 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: preferred_name="preferred_name", prefix="prefix", primary_social_media_sites=["string"], + regulators=[ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], risk_rating="low", + status="active", suffix="suffix", + third_party_verification={ + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + ticker_symbol="ticker_symbol", wealth_and_employment_details={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -359,20 +361,6 @@ def test_method_update_with_all_params(self, client: ModernTreasury) -> None: business_description="business_description", business_name="business_name", citizenship_country="citizenship_country", - compliance_details={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, country_of_incorporation="country_of_incorporation", date_formed=parse_date("2019-12-27"), date_of_birth=parse_date("2019-12-27"), @@ -404,6 +392,7 @@ def test_method_update_with_all_params(self, client: ModernTreasury) -> None: intended_use="intended_use", last_name="last_name", legal_structure="corporation", + listed_exchange="listed_exchange", metadata={ "key": "value", "foo": "bar", @@ -416,8 +405,21 @@ def test_method_update_with_all_params(self, client: ModernTreasury) -> None: preferred_name="preferred_name", prefix="prefix", primary_social_media_sites=["string"], + regulators=[ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], risk_rating="low", + status="active", suffix="suffix", + third_party_verification={ + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + ticker_symbol="ticker_symbol", wealth_and_employment_details={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -486,6 +488,7 @@ def test_method_list_with_all_params(self, client: ModernTreasury) -> None: metadata={"foo": "string"}, per_page=0, show_deleted="show_deleted", + status="pending", ) assert_matches_type(SyncPage[LegalEntity], legal_entity, path=["response"]) @@ -554,20 +557,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea business_description="business_description", business_name="business_name", citizenship_country="citizenship_country", - compliance_details={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + connection_id="connection_id", country_of_incorporation="country_of_incorporation", date_formed=parse_date("2019-12-27"), date_of_birth=parse_date("2019-12-27"), @@ -628,20 +618,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -675,6 +652,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "legal_entity_associations": [], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -687,8 +665,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -717,6 +708,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea } ], legal_structure="corporation", + listed_exchange="listed_exchange", metadata={ "key": "value", "foo": "bar", @@ -729,8 +721,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea preferred_name="preferred_name", prefix="prefix", primary_social_media_sites=["string"], + regulators=[ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], risk_rating="low", + status="active", suffix="suffix", + third_party_verification={ + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + ticker_symbol="ticker_symbol", wealth_and_employment_details={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -861,20 +866,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncModernTrea business_description="business_description", business_name="business_name", citizenship_country="citizenship_country", - compliance_details={ - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, country_of_incorporation="country_of_incorporation", date_formed=parse_date("2019-12-27"), date_of_birth=parse_date("2019-12-27"), @@ -906,6 +897,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncModernTrea intended_use="intended_use", last_name="last_name", legal_structure="corporation", + listed_exchange="listed_exchange", metadata={ "key": "value", "foo": "bar", @@ -918,8 +910,21 @@ async def test_method_update_with_all_params(self, async_client: AsyncModernTrea preferred_name="preferred_name", prefix="prefix", primary_social_media_sites=["string"], + regulators=[ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], risk_rating="low", + status="active", suffix="suffix", + third_party_verification={ + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + ticker_symbol="ticker_symbol", wealth_and_employment_details={ "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -990,6 +995,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncModernTreasu metadata={"foo": "string"}, per_page=0, show_deleted="show_deleted", + status="pending", ) assert_matches_type(AsyncPage[LegalEntity], legal_entity, path=["response"]) diff --git a/tests/api_resources/test_legal_entity_associations.py b/tests/api_resources/test_legal_entity_associations.py index 47a400c2..2b9c099f 100644 --- a/tests/api_resources/test_legal_entity_associations.py +++ b/tests/api_resources/test_legal_entity_associations.py @@ -59,20 +59,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -113,6 +100,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: ], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -125,8 +113,21 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, @@ -229,20 +230,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "business_description": "business_description", "business_name": "business_name", "citizenship_country": "citizenship_country", - "compliance_details": { - "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", - "created_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "discarded_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "issuer": "issuer", - "live_mode": True, - "object": "object", - "token_expires_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_issued_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "token_url": "token_url", - "updated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - "validated": True, - "validated_at": parse_datetime("2019-12-27T18:11:19.117Z"), - }, + "connection_id": "connection_id", "country_of_incorporation": "country_of_incorporation", "date_formed": parse_date("2019-12-27"), "date_of_birth": parse_date("2019-12-27"), @@ -283,6 +271,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea ], "legal_entity_type": "business", "legal_structure": "corporation", + "listed_exchange": "listed_exchange", "metadata": { "key": "value", "foo": "bar", @@ -295,8 +284,21 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "preferred_name": "preferred_name", "prefix": "prefix", "primary_social_media_sites": ["string"], + "regulators": [ + { + "jurisdiction": "jurisdiction", + "name": "name", + "registration_number": "registration_number", + } + ], "risk_rating": "low", + "status": "active", "suffix": "suffix", + "third_party_verification": { + "vendor": "persona", + "vendor_verification_id": "vendor_verification_id", + }, + "ticker_symbol": "ticker_symbol", "wealth_and_employment_details": { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "annual_income": 0, diff --git a/tests/api_resources/test_payment_orders.py b/tests/api_resources/test_payment_orders.py index 751e4eb5..db077223 100644 --- a/tests/api_resources/test_payment_orders.py +++ b/tests/api_resources/test_payment_orders.py @@ -140,6 +140,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -332,6 +333,7 @@ def test_method_update_with_all_params(self, client: ModernTreasury) -> None: "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -570,6 +572,7 @@ def test_method_create_async_with_all_params(self, client: ModernTreasury) -> No "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -773,6 +776,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -965,6 +969,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncModernTrea "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -1203,6 +1208,7 @@ async def test_method_create_async_with_all_params(self, async_client: AsyncMode "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", diff --git a/tests/api_resources/test_virtual_accounts.py b/tests/api_resources/test_virtual_accounts.py index 9b8e440e..035cedd4 100644 --- a/tests/api_resources/test_virtual_accounts.py +++ b/tests/api_resources/test_virtual_accounts.py @@ -50,6 +50,7 @@ def test_method_create_with_all_params(self, client: ModernTreasury) -> None: "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", @@ -293,6 +294,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncModernTrea "normal_balance": "credit", "currency_exponent": 0, "description": "description", + "external_id": "external_id", "ledger_account_category_ids": ["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], "ledgerable_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "ledgerable_type": "counterparty", diff --git a/tests/test_utils/test_json.py b/tests/test_utils/test_json.py new file mode 100644 index 00000000..cd6da3df --- /dev/null +++ b/tests/test_utils/test_json.py @@ -0,0 +1,126 @@ +from __future__ import annotations + +import datetime +from typing import Union + +import pydantic + +from modern_treasury import _compat +from modern_treasury._utils._json import openapi_dumps + + +class TestOpenapiDumps: + def test_basic(self) -> None: + data = {"key": "value", "number": 42} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"key":"value","number":42}' + + def test_datetime_serialization(self) -> None: + dt = datetime.datetime(2023, 1, 1, 12, 0, 0) + data = {"datetime": dt} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"datetime":"2023-01-01T12:00:00"}' + + def test_pydantic_model_serialization(self) -> None: + class User(pydantic.BaseModel): + first_name: str + last_name: str + age: int + + model_instance = User(first_name="John", last_name="Kramer", age=83) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"first_name":"John","last_name":"Kramer","age":83}}' + + def test_pydantic_model_with_default_values(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + score: int = 0 + + model_instance = User(name="Alice") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Alice"}}' + + def test_pydantic_model_with_default_values_overridden(self) -> None: + class User(pydantic.BaseModel): + name: str + role: str = "user" + active: bool = True + + model_instance = User(name="Bob", role="admin", active=False) + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Bob","role":"admin","active":false}}' + + def test_pydantic_model_with_alias(self) -> None: + class User(pydantic.BaseModel): + first_name: str = pydantic.Field(alias="firstName") + last_name: str = pydantic.Field(alias="lastName") + + model_instance = User(firstName="John", lastName="Doe") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"firstName":"John","lastName":"Doe"}}' + + def test_pydantic_model_with_alias_and_default(self) -> None: + class User(pydantic.BaseModel): + user_name: str = pydantic.Field(alias="userName") + user_role: str = pydantic.Field(default="member", alias="userRole") + is_active: bool = pydantic.Field(default=True, alias="isActive") + + model_instance = User(userName="charlie") + data = {"model": model_instance} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"charlie"}}' + + model_with_overrides = User(userName="diana", userRole="admin", isActive=False) + data = {"model": model_with_overrides} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"userName":"diana","userRole":"admin","isActive":false}}' + + def test_pydantic_model_with_nested_models_and_defaults(self) -> None: + class Address(pydantic.BaseModel): + street: str + city: str = "Unknown" + + class User(pydantic.BaseModel): + name: str + address: Address + verified: bool = False + + if _compat.PYDANTIC_V1: + # to handle forward references in Pydantic v1 + User.update_forward_refs(**locals()) # type: ignore[reportDeprecated] + + address = Address(street="123 Main St") + user = User(name="Diana", address=address) + data = {"user": user} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"user":{"name":"Diana","address":{"street":"123 Main St"}}}' + + address_with_city = Address(street="456 Oak Ave", city="Boston") + user_verified = User(name="Eve", address=address_with_city, verified=True) + data = {"user": user_verified} + json_bytes = openapi_dumps(data) + assert ( + json_bytes == b'{"user":{"name":"Eve","address":{"street":"456 Oak Ave","city":"Boston"},"verified":true}}' + ) + + def test_pydantic_model_with_optional_fields(self) -> None: + class User(pydantic.BaseModel): + name: str + email: Union[str, None] + phone: Union[str, None] + + model_with_none = User(name="Eve", email=None, phone=None) + data = {"model": model_with_none} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Eve","email":null,"phone":null}}' + + model_with_values = User(name="Frank", email="frank@example.com", phone=None) + data = {"model": model_with_values} + json_bytes = openapi_dumps(data) + assert json_bytes == b'{"model":{"name":"Frank","email":"frank@example.com","phone":null}}'