diff --git a/.fernignore b/.fernignore
new file mode 100644
index 0000000..084a8eb
--- /dev/null
+++ b/.fernignore
@@ -0,0 +1 @@
+# Specify files that shouldn't be modified by Fern
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..49d3942
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,37 @@
+name: ci
+
+on: [push]
+jobs:
+ compile:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v3
+ - name: Set up python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.8
+ - name: Bootstrap poetry
+ run: |
+ curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
+ - name: Install dependencies
+ run: poetry install
+ - name: Compile
+ run: poetry run mypy .
+ test:
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v3
+ - name: Set up python
+ uses: actions/setup-python@v4
+ with:
+ python-version: 3.8
+ - name: Bootstrap poetry
+ run: |
+ curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
+ - name: Install dependencies
+ run: poetry install
+
+ - name: Test
+ run: poetry run pytest -rP .
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0da665f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+dist/
+.mypy_cache/
+__pycache__/
+poetry.toml
+.ruff_cache/
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 76d0774..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2024 Monite
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/README.md b/README.md
index ec1d4be..5696715 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,146 @@
-# monite-python-client
\ No newline at end of file
+# Monite Python Library
+
+[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fteam-monite%2Fmonite-python-client)
+[![pypi](https://img.shields.io/pypi/v/monite)](https://pypi.python.org/pypi/monite)
+
+The Monite Python library provides convenient access to the Monite API from Python.
+
+## Documentation
+
+API reference documentation is available [here](https://docs.monite.com/api).
+
+## Installation
+
+```sh
+pip install monite
+```
+
+## Reference
+
+A full reference for this library is available [here](./reference.md).
+
+## Usage
+
+Instantiate and use the client with the following:
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.products.create(
+ name="name",
+)
+```
+
+## Async Client
+
+The SDK also exports an `async` client so that you can make non-blocking calls to our API.
+
+```python
+import asyncio
+
+from monite import AsyncMonite
+
+client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+
+
+async def main() -> None:
+ await client.products.create(
+ name="name",
+ )
+
+
+asyncio.run(main())
+```
+
+## Exception Handling
+
+When the API returns a non-success status code (4xx or 5xx response), a subclass of the following error
+will be thrown.
+
+```python
+from monite.core.api_error import ApiError
+
+try:
+ client.products.create(...)
+except ApiError as e:
+ print(e.status_code)
+ print(e.body)
+```
+
+## Advanced
+
+### Retries
+
+The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
+as the request is deemed retriable and the number of retry attempts has not grown larger than the configured
+retry limit (default: 2).
+
+A request is deemed retriable when any of the following HTTP status codes is returned:
+
+- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
+- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
+- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
+
+Use the `max_retries` request option to configure this behavior.
+
+```python
+client.products.create(..., request_options={
+ "max_retries": 1
+})
+```
+
+### Timeouts
+
+The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
+
+```python
+
+from monite import Monite
+
+client = Monite(
+ ...,
+ timeout=20.0,
+)
+
+
+# Override timeout for a specific method
+client.products.create(..., request_options={
+ "timeout_in_seconds": 1
+})
+```
+
+### Custom Client
+
+You can override the `httpx` client to customize it for your use-case. Some common use-cases include support for proxies
+and transports.
+```python
+import httpx
+from monite import Monite
+
+client = Monite(
+ ...,
+ httpx_client=httpx.Client(
+ proxies="http://my.test.proxy.example.com",
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
+ ),
+)
+```
+
+## Contributing
+
+While we value open-source contributions to this SDK, this library is generated programmatically.
+Additions made directly to this library would have to be moved over to our generation code,
+otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
+a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
+an issue first to discuss with us!
+
+On the other hand, contributions to the README are always very welcome!
diff --git a/poetry.lock b/poetry.lock
new file mode 100644
index 0000000..d8769c1
--- /dev/null
+++ b/poetry.lock
@@ -0,0 +1,503 @@
+# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.
+
+[[package]]
+name = "annotated-types"
+version = "0.7.0"
+description = "Reusable constraint types to use with typing.Annotated"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"},
+ {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"},
+]
+
+[package.dependencies]
+typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""}
+
+[[package]]
+name = "anyio"
+version = "4.5.2"
+description = "High level compatibility layer for multiple asynchronous event loop implementations"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "anyio-4.5.2-py3-none-any.whl", hash = "sha256:c011ee36bc1e8ba40e5a81cb9df91925c218fe9b778554e0b56a21e1b5d4716f"},
+ {file = "anyio-4.5.2.tar.gz", hash = "sha256:23009af4ed04ce05991845451e11ef02fc7c5ed29179ac9a420e5ad0ac7ddc5b"},
+]
+
+[package.dependencies]
+exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""}
+idna = ">=2.8"
+sniffio = ">=1.1"
+typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""}
+
+[package.extras]
+doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"]
+test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21.0b1)"]
+trio = ["trio (>=0.26.1)"]
+
+[[package]]
+name = "certifi"
+version = "2024.8.30"
+description = "Python package for providing Mozilla's CA Bundle."
+optional = false
+python-versions = ">=3.6"
+files = [
+ {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"},
+ {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"},
+]
+
+[[package]]
+name = "colorama"
+version = "0.4.6"
+description = "Cross-platform colored terminal text."
+optional = false
+python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
+files = [
+ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
+ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
+]
+
+[[package]]
+name = "exceptiongroup"
+version = "1.2.2"
+description = "Backport of PEP 654 (exception groups)"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"},
+ {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"},
+]
+
+[package.extras]
+test = ["pytest (>=6)"]
+
+[[package]]
+name = "h11"
+version = "0.14.0"
+description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"},
+ {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"},
+]
+
+[[package]]
+name = "httpcore"
+version = "1.0.6"
+description = "A minimal low-level HTTP client."
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "httpcore-1.0.6-py3-none-any.whl", hash = "sha256:27b59625743b85577a8c0e10e55b50b5368a4f2cfe8cc7bcfa9cf00829c2682f"},
+ {file = "httpcore-1.0.6.tar.gz", hash = "sha256:73f6dbd6eb8c21bbf7ef8efad555481853f5f6acdeaff1edb0694289269ee17f"},
+]
+
+[package.dependencies]
+certifi = "*"
+h11 = ">=0.13,<0.15"
+
+[package.extras]
+asyncio = ["anyio (>=4.0,<5.0)"]
+http2 = ["h2 (>=3,<5)"]
+socks = ["socksio (==1.*)"]
+trio = ["trio (>=0.22.0,<1.0)"]
+
+[[package]]
+name = "httpx"
+version = "0.27.2"
+description = "The next generation HTTP client."
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"},
+ {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"},
+]
+
+[package.dependencies]
+anyio = "*"
+certifi = "*"
+httpcore = "==1.*"
+idna = "*"
+sniffio = "*"
+
+[package.extras]
+brotli = ["brotli", "brotlicffi"]
+cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]
+http2 = ["h2 (>=3,<5)"]
+socks = ["socksio (==1.*)"]
+zstd = ["zstandard (>=0.18.0)"]
+
+[[package]]
+name = "idna"
+version = "3.10"
+description = "Internationalized Domain Names in Applications (IDNA)"
+optional = false
+python-versions = ">=3.6"
+files = [
+ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"},
+ {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"},
+]
+
+[package.extras]
+all = ["flake8 (>=7.1.1)", "mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]
+
+[[package]]
+name = "iniconfig"
+version = "2.0.0"
+description = "brain-dead simple config-ini parsing"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
+ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
+]
+
+[[package]]
+name = "mypy"
+version = "1.0.1"
+description = "Optional static typing for Python"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "mypy-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:71a808334d3f41ef011faa5a5cd8153606df5fc0b56de5b2e89566c8093a0c9a"},
+ {file = "mypy-1.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:920169f0184215eef19294fa86ea49ffd4635dedfdea2b57e45cb4ee85d5ccaf"},
+ {file = "mypy-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27a0f74a298769d9fdc8498fcb4f2beb86f0564bcdb1a37b58cbbe78e55cf8c0"},
+ {file = "mypy-1.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:65b122a993d9c81ea0bfde7689b3365318a88bde952e4dfa1b3a8b4ac05d168b"},
+ {file = "mypy-1.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:5deb252fd42a77add936b463033a59b8e48eb2eaec2976d76b6878d031933fe4"},
+ {file = "mypy-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2013226d17f20468f34feddd6aae4635a55f79626549099354ce641bc7d40262"},
+ {file = "mypy-1.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:48525aec92b47baed9b3380371ab8ab6e63a5aab317347dfe9e55e02aaad22e8"},
+ {file = "mypy-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c96b8a0c019fe29040d520d9257d8c8f122a7343a8307bf8d6d4a43f5c5bfcc8"},
+ {file = "mypy-1.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:448de661536d270ce04f2d7dddaa49b2fdba6e3bd8a83212164d4174ff43aa65"},
+ {file = "mypy-1.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:d42a98e76070a365a1d1c220fcac8aa4ada12ae0db679cb4d910fabefc88b994"},
+ {file = "mypy-1.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e64f48c6176e243ad015e995de05af7f22bbe370dbb5b32bd6988438ec873919"},
+ {file = "mypy-1.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5fdd63e4f50e3538617887e9aee91855368d9fc1dea30da743837b0df7373bc4"},
+ {file = "mypy-1.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:dbeb24514c4acbc78d205f85dd0e800f34062efcc1f4a4857c57e4b4b8712bff"},
+ {file = "mypy-1.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a2948c40a7dd46c1c33765718936669dc1f628f134013b02ff5ac6c7ef6942bf"},
+ {file = "mypy-1.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5bc8d6bd3b274dd3846597855d96d38d947aedba18776aa998a8d46fabdaed76"},
+ {file = "mypy-1.0.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:17455cda53eeee0a4adb6371a21dd3dbf465897de82843751cf822605d152c8c"},
+ {file = "mypy-1.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e831662208055b006eef68392a768ff83596035ffd6d846786578ba1714ba8f6"},
+ {file = "mypy-1.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e60d0b09f62ae97a94605c3f73fd952395286cf3e3b9e7b97f60b01ddfbbda88"},
+ {file = "mypy-1.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:0af4f0e20706aadf4e6f8f8dc5ab739089146b83fd53cb4a7e0e850ef3de0bb6"},
+ {file = "mypy-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:24189f23dc66f83b839bd1cce2dfc356020dfc9a8bae03978477b15be61b062e"},
+ {file = "mypy-1.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:93a85495fb13dc484251b4c1fd7a5ac370cd0d812bbfc3b39c1bafefe95275d5"},
+ {file = "mypy-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5f546ac34093c6ce33f6278f7c88f0f147a4849386d3bf3ae193702f4fe31407"},
+ {file = "mypy-1.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c6c2ccb7af7154673c591189c3687b013122c5a891bb5651eca3db8e6c6c55bd"},
+ {file = "mypy-1.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:15b5a824b58c7c822c51bc66308e759243c32631896743f030daf449fe3677f3"},
+ {file = "mypy-1.0.1-py3-none-any.whl", hash = "sha256:eda5c8b9949ed411ff752b9a01adda31afe7eae1e53e946dbdf9db23865e66c4"},
+ {file = "mypy-1.0.1.tar.gz", hash = "sha256:28cea5a6392bb43d266782983b5a4216c25544cd7d80be681a155ddcdafd152d"},
+]
+
+[package.dependencies]
+mypy-extensions = ">=0.4.3"
+tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""}
+typing-extensions = ">=3.10"
+
+[package.extras]
+dmypy = ["psutil (>=4.0)"]
+install-types = ["pip"]
+python2 = ["typed-ast (>=1.4.0,<2)"]
+reports = ["lxml"]
+
+[[package]]
+name = "mypy-extensions"
+version = "1.0.0"
+description = "Type system extensions for programs checked with the mypy type checker."
+optional = false
+python-versions = ">=3.5"
+files = [
+ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"},
+ {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"},
+]
+
+[[package]]
+name = "packaging"
+version = "24.1"
+description = "Core utilities for Python packages"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"},
+ {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"},
+]
+
+[[package]]
+name = "pluggy"
+version = "1.5.0"
+description = "plugin and hook calling mechanisms for python"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"},
+ {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"},
+]
+
+[package.extras]
+dev = ["pre-commit", "tox"]
+testing = ["pytest", "pytest-benchmark"]
+
+[[package]]
+name = "pydantic"
+version = "2.9.2"
+description = "Data validation using Python type hints"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"},
+ {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"},
+]
+
+[package.dependencies]
+annotated-types = ">=0.6.0"
+pydantic-core = "2.23.4"
+typing-extensions = [
+ {version = ">=4.12.2", markers = "python_version >= \"3.13\""},
+ {version = ">=4.6.1", markers = "python_version < \"3.13\""},
+]
+
+[package.extras]
+email = ["email-validator (>=2.0.0)"]
+timezone = ["tzdata"]
+
+[[package]]
+name = "pydantic-core"
+version = "2.23.4"
+description = "Core functionality for Pydantic validation and serialization"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"},
+ {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"},
+ {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"},
+ {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"},
+ {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"},
+ {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"},
+ {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"},
+ {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"},
+ {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"},
+ {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"},
+ {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"},
+ {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"},
+ {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"},
+ {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"},
+ {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"},
+ {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"},
+ {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"},
+ {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"},
+ {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"},
+ {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"},
+ {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"},
+ {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"},
+]
+
+[package.dependencies]
+typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0"
+
+[[package]]
+name = "pytest"
+version = "7.4.4"
+description = "pytest: simple powerful testing with Python"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},
+ {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"},
+]
+
+[package.dependencies]
+colorama = {version = "*", markers = "sys_platform == \"win32\""}
+exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
+iniconfig = "*"
+packaging = "*"
+pluggy = ">=0.12,<2.0"
+tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
+
+[package.extras]
+testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
+
+[[package]]
+name = "pytest-asyncio"
+version = "0.23.8"
+description = "Pytest support for asyncio"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"},
+ {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"},
+]
+
+[package.dependencies]
+pytest = ">=7.0.0,<9"
+
+[package.extras]
+docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"]
+testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"]
+
+[[package]]
+name = "python-dateutil"
+version = "2.9.0.post0"
+description = "Extensions to the standard Python datetime module"
+optional = false
+python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7"
+files = [
+ {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"},
+ {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"},
+]
+
+[package.dependencies]
+six = ">=1.5"
+
+[[package]]
+name = "ruff"
+version = "0.5.7"
+description = "An extremely fast Python linter and code formatter, written in Rust."
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "ruff-0.5.7-py3-none-linux_armv6l.whl", hash = "sha256:548992d342fc404ee2e15a242cdbea4f8e39a52f2e7752d0e4cbe88d2d2f416a"},
+ {file = "ruff-0.5.7-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:00cc8872331055ee017c4f1071a8a31ca0809ccc0657da1d154a1d2abac5c0be"},
+ {file = "ruff-0.5.7-py3-none-macosx_11_0_arm64.whl", hash = "sha256:eaf3d86a1fdac1aec8a3417a63587d93f906c678bb9ed0b796da7b59c1114a1e"},
+ {file = "ruff-0.5.7-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a01c34400097b06cf8a6e61b35d6d456d5bd1ae6961542de18ec81eaf33b4cb8"},
+ {file = "ruff-0.5.7-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fcc8054f1a717e2213500edaddcf1dbb0abad40d98e1bd9d0ad364f75c763eea"},
+ {file = "ruff-0.5.7-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7f70284e73f36558ef51602254451e50dd6cc479f8b6f8413a95fcb5db4a55fc"},
+ {file = "ruff-0.5.7-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:a78ad870ae3c460394fc95437d43deb5c04b5c29297815a2a1de028903f19692"},
+ {file = "ruff-0.5.7-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9ccd078c66a8e419475174bfe60a69adb36ce04f8d4e91b006f1329d5cd44bcf"},
+ {file = "ruff-0.5.7-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7e31c9bad4ebf8fdb77b59cae75814440731060a09a0e0077d559a556453acbb"},
+ {file = "ruff-0.5.7-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d796327eed8e168164346b769dd9a27a70e0298d667b4ecee6877ce8095ec8e"},
+ {file = "ruff-0.5.7-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:4a09ea2c3f7778cc635e7f6edf57d566a8ee8f485f3c4454db7771efb692c499"},
+ {file = "ruff-0.5.7-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:a36d8dcf55b3a3bc353270d544fb170d75d2dff41eba5df57b4e0b67a95bb64e"},
+ {file = "ruff-0.5.7-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9369c218f789eefbd1b8d82a8cf25017b523ac47d96b2f531eba73770971c9e5"},
+ {file = "ruff-0.5.7-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b88ca3db7eb377eb24fb7c82840546fb7acef75af4a74bd36e9ceb37a890257e"},
+ {file = "ruff-0.5.7-py3-none-win32.whl", hash = "sha256:33d61fc0e902198a3e55719f4be6b375b28f860b09c281e4bdbf783c0566576a"},
+ {file = "ruff-0.5.7-py3-none-win_amd64.whl", hash = "sha256:083bbcbe6fadb93cd86709037acc510f86eed5a314203079df174c40bbbca6b3"},
+ {file = "ruff-0.5.7-py3-none-win_arm64.whl", hash = "sha256:2dca26154ff9571995107221d0aeaad0e75a77b5a682d6236cf89a58c70b76f4"},
+ {file = "ruff-0.5.7.tar.gz", hash = "sha256:8dfc0a458797f5d9fb622dd0efc52d796f23f0a1493a9527f4e49a550ae9a7e5"},
+]
+
+[[package]]
+name = "six"
+version = "1.16.0"
+description = "Python 2 and 3 compatibility utilities"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
+files = [
+ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
+ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
+]
+
+[[package]]
+name = "sniffio"
+version = "1.3.1"
+description = "Sniff out which async library your code is running under"
+optional = false
+python-versions = ">=3.7"
+files = [
+ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"},
+ {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},
+]
+
+[[package]]
+name = "tomli"
+version = "2.0.2"
+description = "A lil' TOML parser"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "tomli-2.0.2-py3-none-any.whl", hash = "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38"},
+ {file = "tomli-2.0.2.tar.gz", hash = "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed"},
+]
+
+[[package]]
+name = "types-python-dateutil"
+version = "2.9.0.20241003"
+description = "Typing stubs for python-dateutil"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "types-python-dateutil-2.9.0.20241003.tar.gz", hash = "sha256:58cb85449b2a56d6684e41aeefb4c4280631246a0da1a719bdbe6f3fb0317446"},
+ {file = "types_python_dateutil-2.9.0.20241003-py3-none-any.whl", hash = "sha256:250e1d8e80e7bbc3a6c99b907762711d1a1cdd00e978ad39cb5940f6f0a87f3d"},
+]
+
+[[package]]
+name = "typing-extensions"
+version = "4.12.2"
+description = "Backported and Experimental Type Hints for Python 3.8+"
+optional = false
+python-versions = ">=3.8"
+files = [
+ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"},
+ {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"},
+]
+
+[metadata]
+lock-version = "2.0"
+python-versions = "^3.8"
+content-hash = "6f6c191c1028d17a97fdfa84cedfd3cef94b5d63d98b8c1d333b3398eeea9055"
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..7e7e804
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,61 @@
+[tool.poetry]
+name = "monite"
+version = "0.0.0"
+description = ""
+readme = "README.md"
+authors = []
+keywords = []
+
+classifiers = [
+ "Intended Audience :: Developers",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Operating System :: OS Independent",
+ "Operating System :: POSIX",
+ "Operating System :: MacOS",
+ "Operating System :: POSIX :: Linux",
+ "Operating System :: Microsoft :: Windows",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Typing :: Typed"
+]
+packages = [
+ { include = "monite", from = "src"}
+]
+
+[project.urls]
+Repository = 'https://github.com/team-monite/monite-python-client'
+
+[tool.poetry.dependencies]
+python = "^3.8"
+httpx = ">=0.21.2"
+pydantic = ">= 1.9.2"
+pydantic-core = "^2.18.2"
+typing_extensions = ">= 4.0.0"
+
+[tool.poetry.dev-dependencies]
+mypy = "1.0.1"
+pytest = "^7.4.0"
+pytest-asyncio = "^0.23.5"
+python-dateutil = "^2.9.0"
+types-python-dateutil = "^2.9.0.20240316"
+ruff = "^0.5.6"
+
+[tool.pytest.ini_options]
+testpaths = [ "tests" ]
+asyncio_mode = "auto"
+
+[tool.mypy]
+plugins = ["pydantic.mypy"]
+
+[tool.ruff]
+line-length = 120
+
+
+[build-system]
+requires = ["poetry-core"]
+build-backend = "poetry.core.masonry.api"
diff --git a/reference.md b/reference.md
new file mode 100644
index 0000000..a1d168c
--- /dev/null
+++ b/reference.md
@@ -0,0 +1,25858 @@
+# Reference
+## Approval policies
+client.approval_policies.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a list of all approval policies with pagination.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ApprovalPolicyCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**status:** `typing.Optional[ApprovalPoliciesGetRequestStatus]`
+
+
+
+
+
+-
+
+**status_in:** `typing.Optional[
+ typing.Union[
+ ApprovalPoliciesGetRequestStatusInItem,
+ typing.Sequence[ApprovalPoliciesGetRequestStatusInItem],
+ ]
+]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_ncontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_by:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_policies.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new approval policy.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.create(
+ name="name",
+ description="description",
+ script=[True],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str` — The name of the approval policy.
+
+
+
+
+
+-
+
+**description:** `str` — A brief description of the approval policy.
+
+
+
+
+
+-
+
+**script:** `typing.Sequence[ApprovalPolicyCreateScriptItem]` — A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
+
+
+
+
+
+-
+
+**trigger:** `typing.Optional[ApprovalPolicyCreateTrigger]` — A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_policies.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a specific approval policy.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.get_by_id(
+ approval_policy_id="approval_policy_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_policy_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_policies.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete an existing approval policy.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.delete_by_id(
+ approval_policy_id="approval_policy_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_policy_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_policies.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update an existing approval policy.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.update_by_id(
+ approval_policy_id="approval_policy_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_policy_id:** `str`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — The name of the approval policy.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — A brief description of the approval policy.
+
+
+
+
+
+-
+
+**script:** `typing.Optional[typing.Sequence[ApprovalPolicyUpdateScriptItem]]` — A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
+
+
+
+
+
+-
+
+**trigger:** `typing.Optional[ApprovalPolicyUpdateTrigger]` — A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
+
+
+
+
+
+-
+
+**status:** `typing.Optional[ApprovalPolicyStatus]` — A string that represents the current status of the approval policy.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Approval requests
+client.approval_requests.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_requests.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ApprovalRequestCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**object_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**object_id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**status:** `typing.Optional[ApprovalRequestStatus]`
+
+
+
+
+
+-
+
+**status_in:** `typing.Optional[
+ typing.Union[ApprovalRequestStatus, typing.Sequence[ApprovalRequestStatus]]
+]`
+
+
+
+
+
+-
+
+**user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**role_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**object_type:** `typing.Optional[ObjectType]`
+
+
+
+
+
+-
+
+**object_type_in:** `typing.Optional[typing.Union[ObjectType, typing.Sequence[ObjectType]]]`
+
+
+
+
+
+-
+
+**created_by:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_requests.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import ApprovalRequestCreateByRoleRequest, Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_requests.create(
+ request=ApprovalRequestCreateByRoleRequest(
+ object_id="object_id",
+ object_type="account",
+ required_approval_count=1,
+ role_ids=["role_ids"],
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `ApprovalRequestCreateRequest`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_requests.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_requests.get_by_id(
+ approval_request_id="approval_request_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_request_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_requests.approve_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_requests.approve_by_id(
+ approval_request_id="approval_request_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_request_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_requests.cancel_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_requests.cancel_by_id(
+ approval_request_id="approval_request_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_request_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_requests.reject_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_requests.reject_by_id(
+ approval_request_id="approval_request_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_request_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Audit logs
+client.audit_logs.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.audit_logs.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**pagination_token:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**path_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**type:** `typing.Optional[LogTypeEnum]`
+
+
+
+
+
+-
+
+**method:** `typing.Optional[LogMethodEnum]`
+
+
+
+
+
+-
+
+**status_code:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**timestamp_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**timestamp_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**timestamp_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**timestamp_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**page_size:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**page_num:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.audit_logs.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.audit_logs.get_by_id(
+ log_id="log_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**log_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Access tokens
+client.access_tokens.revoke(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Revoke an existing token immediately.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.access_tokens.revoke(
+ client_id="client_id",
+ client_secret="client_secret",
+ token="token",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**client_id:** `str`
+
+
+
+
+
+-
+
+**client_secret:** `str`
+
+
+
+
+
+-
+
+**token:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.access_tokens.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new access token based on client ID and client secret.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.access_tokens.create(
+ client_id="client_id",
+ client_secret="client_secret",
+ grant_type="client_credentials",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**client_id:** `str`
+
+
+
+
+
+-
+
+**client_secret:** `str`
+
+
+
+
+
+-
+
+**grant_type:** `GrantType`
+
+
+
+
+
+-
+
+**entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Batch payments
+client.batch_payments.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import (
+ Monite,
+ PaymentIntentsRecipient,
+ PaymentObjectPayable,
+ SinglePaymentIntent,
+)
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.batch_payments.create(
+ payer_bank_account_id="payer_bank_account_id",
+ payment_intents=[
+ SinglePaymentIntent(
+ object=PaymentObjectPayable(
+ id="id",
+ ),
+ recipient=PaymentIntentsRecipient(
+ id="id",
+ ),
+ )
+ ],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payer_bank_account_id:** `str`
+
+
+
+
+
+-
+
+**payment_intents:** `typing.Sequence[SinglePaymentIntent]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.batch_payments.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.batch_payments.get_by_id(
+ batch_payment_id="batch_payment_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**batch_payment_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Comments
+client.comments.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get comments
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.comments.get(
+ object_id="object_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**object_id:** `str`
+
+
+
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[CommentCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.comments.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create new comment
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.comments.create(
+ object_id="object_id",
+ object_type="object_type",
+ text="text",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**object_id:** `str`
+
+
+
+
+
+-
+
+**object_type:** `str`
+
+
+
+
+
+-
+
+**text:** `str`
+
+
+
+
+
+-
+
+**reply_to_entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.comments.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get comment
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.comments.get_by_id(
+ comment_id="comment_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**comment_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.comments.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete comment
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.comments.delete_by_id(
+ comment_id="comment_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**comment_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.comments.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update comment
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.comments.update_by_id(
+ comment_id="comment_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**comment_id:** `str`
+
+
+
+
+
+-
+
+**reply_to_entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**text:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Counterparts
+client.counterparts.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.get(
+ sort_code="123456",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**iban:** `typing.Optional[str]` — The IBAN of the counterpart's bank account.
+
+
+
+
+
+-
+
+**sort_code:** `typing.Optional[str]` — The bank's sort code.
+
+
+
+
+
+-
+
+**account_number:** `typing.Optional[str]` — The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+
+
+
+
+-
+
+**tax_id:** `typing.Optional[str]` — The tax ID of the counterpart.
+
+
+
+
+
+-
+
+**vat_id:** `typing.Optional[str]` — The VAT ID of the counterpart.
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — A list of counterpart IDs to search through.
+
+
+
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[CounterpartCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**type:** `typing.Optional[CounterpartType]`
+
+
+
+
+
+-
+
+**counterpart_name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_iexact:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**is_vendor:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
+**is_customer:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**email_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**email_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**address_country:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**address_city:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**address_postal_code:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**address_state:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**address_line1:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**address_line2:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**tag_ids_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import (
+ CounterpartAddress,
+ CounterpartCreatePayload_Individual,
+ CounterpartIndividualCreatePayload,
+ Monite,
+)
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.create(
+ request=CounterpartCreatePayload_Individual(
+ individual=CounterpartIndividualCreatePayload(
+ address=CounterpartAddress(
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ ),
+ first_name="Adnan",
+ is_customer=True,
+ is_vendor=True,
+ last_name="Singh",
+ ),
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `CounterpartCreatePayload`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.get_by_id(
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.delete_by_id(
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import (
+ CounterpartIndividualRootUpdatePayload,
+ CounterpartIndividualUpdatePayload,
+ Monite,
+)
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.update_by_id(
+ counterpart_id="counterpart_id",
+ request=CounterpartIndividualRootUpdatePayload(
+ individual=CounterpartIndividualUpdatePayload(),
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request:** `CounterpartUpdatePayload`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.get_partner_metadata_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.get_partner_metadata_by_id(
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.update_partner_metadata_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.update_partner_metadata_by_id(
+ counterpart_id="counterpart_id",
+ metadata={"key": "value"},
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**metadata:** `typing.Dict[str, typing.Optional[typing.Any]]` — Metadata for partner needs
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## DataExports
+client.data_exports.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[DataExportCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_by_entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.data_exports.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import ExportObjectSchema_Receivable, Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.create(
+ date_from="date_from",
+ date_to="date_to",
+ format="csv",
+ objects=[
+ ExportObjectSchema_Receivable(
+ statuses=["draft"],
+ )
+ ],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**date_from:** `str`
+
+
+
+
+
+-
+
+**date_to:** `str`
+
+
+
+
+
+-
+
+**format:** `ExportFormat`
+
+
+
+
+
+-
+
+**objects:** `typing.Sequence[ExportObjectSchema]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.data_exports.get_supported_formats()
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.get_supported_formats()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.data_exports.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.get_by_id(
+ document_export_id="document_export_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**document_export_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## PDF templates
+client.pdf_templates.get()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+This API call returns all supported templates with language codes.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.pdf_templates.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.pdf_templates.get_system()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+This API call returns all supported system templates with language codes.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.pdf_templates.get_system()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.pdf_templates.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.pdf_templates.get_by_id(
+ document_template_id="document_template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**document_template_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.pdf_templates.make_default_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.pdf_templates.make_default_by_id(
+ document_template_id="document_template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**document_template_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.pdf_templates.preview_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns a sample PDF invoice generated using the specified template.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.pdf_templates.preview_by_id(
+ document_template_id="string",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**document_template_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Entities
+client.entities.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a list of all entities.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[EntityCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**type:** `typing.Optional[EntityTypeEnum]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**id_not_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**email_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**email_not_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new entity from the specified values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import EntityAddressSchema, Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.create(
+ address=EntityAddressSchema(
+ city="city",
+ country="AF",
+ line1="line1",
+ postal_code="postal_code",
+ ),
+ email="email",
+ type="individual",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**address:** `EntityAddressSchema` — An address description of the entity
+
+
+
+
+
+-
+
+**email:** `str` — An official email address of the entity
+
+
+
+
+
+-
+
+**type:** `EntityTypeEnum` — A type for an entity
+
+
+
+
+
+-
+
+**individual:** `typing.Optional[IndividualSchema]` — A set of meta data describing the individual
+
+
+
+
+
+-
+
+**organization:** `typing.Optional[OrganizationSchema]` — A set of meta data describing the organization
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — A phone number of the entity
+
+
+
+
+
+-
+
+**tax_id:** `typing.Optional[str]` — The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+
+
+
+
+-
+
+**website:** `typing.Optional[str]` — A website of the entity
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.get_entities_me()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deprecated. Use `GET /entity_users/my_entity` instead.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.get_entities_me()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.patch_entities_me(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deprecated. Use `PATCH /entity_users/my_entity` instead.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.patch_entities_me()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**address:** `typing.Optional[UpdateEntityAddressSchema]` — An address description of the entity
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — An official email address of the entity
+
+
+
+
+
+-
+
+**individual:** `typing.Optional[OptionalIndividualSchema]` — A set of meta data describing the individual
+
+
+
+
+
+-
+
+**organization:** `typing.Optional[OptionalOrganizationSchema]` — A set of meta data describing the organization
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — A phone number of the entity
+
+
+
+
+
+-
+
+**tax_id:** `typing.Optional[str]` — The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+
+
+
+
+-
+
+**website:** `typing.Optional[str]` — A website of the entity
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve an entity by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.get_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str` — A unique ID to specify the entity.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the specified fields with the provided values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.update_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str` — A unique ID to specify the entity.
+
+
+
+
+
+-
+
+**address:** `typing.Optional[UpdateEntityAddressSchema]` — An address description of the entity
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — An official email address of the entity
+
+
+
+
+
+-
+
+**individual:** `typing.Optional[OptionalIndividualSchema]` — A set of meta data describing the individual
+
+
+
+
+
+-
+
+**organization:** `typing.Optional[OptionalOrganizationSchema]` — A set of meta data describing the organization
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — A phone number of the entity
+
+
+
+
+
+-
+
+**tax_id:** `typing.Optional[str]` — The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+
+
+
+
+-
+
+**website:** `typing.Optional[str]` — A website of the entity
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.upload_logo_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Entity logo can be PNG, JPG, or GIF, up to 10 MB in size. The logo is used, for example, in PDF documents created by this entity.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.upload_logo_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str` — A unique ID to specify the entity.
+
+
+
+
+
+-
+
+**file:** `from __future__ import annotations
+
+core.File` — See core.File for more documentation
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.delete_logo_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.delete_logo_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str` — A unique ID to specify the entity.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.get_partner_metadata_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a metadata object associated with this entity, usually in a JSON format.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.get_partner_metadata_by_id(
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.update_partner_metadata_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Fully replace the current metadata object with the specified instance.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.update_partner_metadata_by_id(
+ entity_id="entity_id",
+ metadata={"key": "value"},
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**metadata:** `typing.Dict[str, typing.Optional[typing.Any]]` — Metadata for partner needs
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.get_settings_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve all settings for this entity.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.get_settings_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str` — A unique ID to specify the entity.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.update_settings_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the specified fields with the provided values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.update_settings_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str` — A unique ID to specify the entity.
+
+
+
+
+
+-
+
+**language:** `typing.Optional[LanguageCodeEnum]`
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencySettings]`
+
+
+
+
+
+-
+
+**reminder:** `typing.Optional[RemindersSettings]`
+
+
+
+
+
+-
+
+**vat_mode:** `typing.Optional[VatModeEnum]` — Defines whether the prices of products in receivables will already include VAT or not.
+
+
+
+
+
+-
+
+**payment_priority:** `typing.Optional[PaymentPriorityEnum]` — Payment preferences for entity to automate calculating suggested payment date basing on payment terms and entity preferences
+
+
+
+
+
+-
+
+**allow_purchase_order_autolinking:** `typing.Optional[bool]` — Automatically attempt to find a corresponding purchase order for all incoming payables.
+
+
+
+
+
+-
+
+**receivable_edit_flow:** `typing.Optional[ReceivableEditFlow]`
+
+
+
+
+
+-
+
+**document_ids:** `typing.Optional[DocumentIDsSettingsRequest]`
+
+
+
+
+
+-
+
+**payables_ocr_auto_tagging:** `typing.Optional[typing.Sequence[OcrAutoTaggingSettingsRequest]]` — Auto tagging settings for all incoming OCR payable documents.
+
+
+
+
+
+-
+
+**quote_signature_required:** `typing.Optional[bool]` — Sets the default behavior of whether a signature is required to accept quotes
+
+
+
+
+
+-
+
+**generate_paid_invoice_pdf:** `typing.Optional[bool]` — If enabled, the paid invoice's PDF will be in a new layout set by the user
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.upload_onboarding_documents(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Provide files for entity onboarding verification
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.upload_onboarding_documents()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**additional_verification_document_back:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**additional_verification_document_front:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**bank_account_ownership_verification:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**company_license:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**company_memorandum_of_association:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**company_ministerial_decree:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**company_registration_verification:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**company_tax_id_verification:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**proof_of_registration:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**verification_document_back:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**verification_document_front:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.get_onboarding_requirements()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get onboarding requirements for the entity
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.get_onboarding_requirements()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Entity users
+client.entity_users.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a list of all entity users.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[EntityUserCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**id_not_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**role_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**role_id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**login:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**status:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**first_name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new entity user from the specified values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.create(
+ first_name="Andrey",
+ login="login",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**first_name:** `str` — First name
+
+
+
+
+
+-
+
+**login:** `str`
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — An entity user business email
+
+
+
+
+
+-
+
+**last_name:** `typing.Optional[str]` — Last name
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — An entity user phone number in the international format
+
+
+
+
+
+-
+
+**role_id:** `typing.Optional[str]` — UUID of the role assigned to this entity user
+
+
+
+
+
+-
+
+**title:** `typing.Optional[str]` — Title
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.get_current()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve an entity user by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.get_current()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.update_current(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the specified fields with provided values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.update_current()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**email:** `typing.Optional[str]` — An entity user business email
+
+
+
+
+
+-
+
+**first_name:** `typing.Optional[str]` — First name
+
+
+
+
+
+-
+
+**last_name:** `typing.Optional[str]` — Last name
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — An entity user phone number in the international format
+
+
+
+
+
+-
+
+**title:** `typing.Optional[str]` — Title
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.get_current_entity()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieves information of an entity, which this entity user belongs to.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.get_current_entity()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.update_current_entity(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update information of an entity, which this entity user belongs to.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.update_current_entity()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**address:** `typing.Optional[UpdateEntityAddressSchema]` — An address description of the entity
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — An official email address of the entity
+
+
+
+
+
+-
+
+**individual:** `typing.Optional[OptionalIndividualSchema]` — A set of meta data describing the individual
+
+
+
+
+
+-
+
+**organization:** `typing.Optional[OptionalOrganizationSchema]` — A set of meta data describing the organization
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — A phone number of the entity
+
+
+
+
+
+-
+
+**tax_id:** `typing.Optional[str]` — The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+
+
+
+
+-
+
+**website:** `typing.Optional[str]` — A website of the entity
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.get_current_role()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieves information of a role assigned to this entity user.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.get_current_role()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve an entity user by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.get_by_id(
+ entity_user_id="entity_user_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_user_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.delete_by_id(
+ entity_user_id="entity_user_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_user_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entity_users.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the specified fields with provided values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entity_users.update_by_id(
+ entity_user_id="entity_user_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_user_id:** `str`
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — An entity user business email
+
+
+
+
+
+-
+
+**first_name:** `typing.Optional[str]` — First name
+
+
+
+
+
+-
+
+**last_name:** `typing.Optional[str]` — Last name
+
+
+
+
+
+-
+
+**login:** `typing.Optional[str]` — Login
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — An entity user phone number in the international format
+
+
+
+
+
+-
+
+**role_id:** `typing.Optional[str]` — UUID of the role assigned to this entity user
+
+
+
+
+
+-
+
+**title:** `typing.Optional[str]` — Title
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Events
+client.events.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get events for a given entity.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.events.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[EventCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**object_type:** `typing.Optional[WebhookObjectType]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.events.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get event by ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.events.get_by_id(
+ event_id="event_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**event_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Files
+client.files.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.files.get(
+ id_in="string",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.files.upload(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.files.upload(
+ file_type="ocr_results",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**file:** `from __future__ import annotations
+
+core.File` — See core.File for more documentation
+
+
+
+
+
+-
+
+**file_type:** `AllowedFileTypes`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.files.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.files.get_by_id(
+ file_id="file_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**file_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.files.delete(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.files.delete(
+ file_id="file_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**file_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Mail templates
+client.mail_templates.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all custom templates
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[CustomTemplatesCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**type:** `typing.Optional[DocumentObjectTypeRequestEnum]`
+
+
+
+
+
+-
+
+**type_in:** `typing.Optional[
+ typing.Union[
+ DocumentObjectTypeRequestEnum,
+ typing.Sequence[DocumentObjectTypeRequestEnum],
+ ]
+]`
+
+
+
+
+
+-
+
+**type_not_in:** `typing.Optional[
+ typing.Union[
+ DocumentObjectTypeRequestEnum,
+ typing.Sequence[DocumentObjectTypeRequestEnum],
+ ]
+]`
+
+
+
+
+
+-
+
+**is_default:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_iexact:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mail_templates.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create custom template
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.create(
+ body_template="body_template",
+ name="name",
+ subject_template="subject_template",
+ type="receivables_quote",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**body_template:** `str` — Jinja2 compatible string with email body
+
+
+
+
+
+-
+
+**name:** `str` — Custom template name
+
+
+
+
+
+-
+
+**subject_template:** `str` — Jinja2 compatible string with email subject
+
+
+
+
+
+-
+
+**type:** `DocumentObjectTypeRequestEnum` — Document type of content
+
+
+
+
+
+-
+
+**is_default:** `typing.Optional[bool]` — Is default template
+
+
+
+
+
+-
+
+**language:** `typing.Optional[LanguageCodeEnum]` — Lowercase ISO code of language
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mail_templates.preview(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Preview rendered template
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.preview(
+ body="body",
+ document_type="receivables_quote",
+ language_code="ab",
+ subject="subject",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**body:** `str` — Body text of the template
+
+
+
+
+
+-
+
+**document_type:** `DocumentObjectTypeRequestEnum` — Document type of content
+
+
+
+
+
+-
+
+**language_code:** `LanguageCodeEnum` — Lowercase ISO code of language
+
+
+
+
+
+-
+
+**subject:** `str` — Subject text of the template
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mail_templates.get_system()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all system templates
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.get_system()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mail_templates.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get custom template by ID
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.get_by_id(
+ template_id="template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**template_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mail_templates.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete custom template bt ID
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.delete_by_id(
+ template_id="template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**template_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mail_templates.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update custom template by ID
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.update_by_id(
+ template_id="template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**template_id:** `str`
+
+
+
+
+
+-
+
+**body_template:** `typing.Optional[str]` — Jinja2 compatible string with email body
+
+
+
+
+
+-
+
+**language:** `typing.Optional[LanguageCodeEnum]` — Lowercase ISO code of language
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — Custom template name
+
+
+
+
+
+-
+
+**subject_template:** `typing.Optional[str]` — Jinja2 compatible string with email subject
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mail_templates.make_default_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Make template default
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mail_templates.make_default_by_id(
+ template_id="template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**template_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Mailbox domains
+client.mailbox_domains.get()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all domains owned by partner_id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailbox_domains.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mailbox_domains.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create domain for the partner_id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailbox_domains.create(
+ domain="domain",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**domain:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mailbox_domains.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete domain for the partner_id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailbox_domains.delete_by_id(
+ domain_id="domain_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**domain_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mailbox_domains.verify_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Verify domain for the partner_id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailbox_domains.verify_by_id(
+ domain_id="domain_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**domain_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Mailboxes
+client.mailboxes.get()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all mailboxes owned by Entity
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailboxes.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mailboxes.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new mailbox
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailboxes.create(
+ mailbox_domain_id="mailbox_domain_id",
+ mailbox_name="mailbox_name",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**mailbox_domain_id:** `str`
+
+
+
+
+
+-
+
+**mailbox_name:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mailboxes.search(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all mailboxes owned by Entity
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailboxes.search(
+ entity_ids=["entity_ids"],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_ids:** `typing.Sequence[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.mailboxes.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete mailbox
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.mailboxes.delete_by_id(
+ mailbox_id="mailbox_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**mailbox_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Measure units
+client.measure_units.get()
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.measure_units.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.measure_units.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.measure_units.create(
+ name="name",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str`
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.measure_units.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.measure_units.get_by_id(
+ unit_id="unit_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**unit_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.measure_units.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.measure_units.delete_by_id(
+ unit_id="unit_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**unit_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.measure_units.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.measure_units.update_by_id(
+ unit_id="unit_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**unit_id:** `str`
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Onboarding links
+client.onboarding_links.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+import datetime
+
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.onboarding_links.create(
+ expires_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ refresh_url="refresh_url",
+ return_url="return_url",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**expires_at:** `dt.datetime`
+
+
+
+
+
+-
+
+**refresh_url:** `str`
+
+
+
+
+
+-
+
+**return_url:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Overdue reminders
+client.overdue_reminders.get()
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.overdue_reminders.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.overdue_reminders.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.overdue_reminders.create(
+ name="name",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str`
+
+
+
+
+
+-
+
+**recipients:** `typing.Optional[Recipients]`
+
+
+
+
+
+-
+
+**terms:** `typing.Optional[typing.Sequence[OverdueReminderTerm]]` — Overdue reminder terms to send for payment
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.overdue_reminders.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.overdue_reminders.get_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**overdue_reminder_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.overdue_reminders.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.overdue_reminders.delete_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**overdue_reminder_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.overdue_reminders.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.overdue_reminders.update_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**overdue_reminder_id:** `str`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**recipients:** `typing.Optional[Recipients]`
+
+
+
+
+
+-
+
+**terms:** `typing.Optional[typing.Sequence[OverdueReminderTerm]]` — Overdue reminder terms to send for payment
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Purchase orders
+client.purchase_orders.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[PurchaseOrderCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**issued_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**issued_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**issued_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**issued_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**status:** `typing.Optional[PurchaseOrderStatusEnum]`
+
+
+
+
+
+-
+
+**document_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**created_by:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**counterpart_name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]`
+
+
+
+
+
+-
+
+**currency_in:** `typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.purchase_orders.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite, PurchaseOrderItem
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.create(
+ counterpart_id="counterpart_id",
+ currency="AED",
+ items=[
+ PurchaseOrderItem(
+ currency="AED",
+ name="name",
+ price=1,
+ quantity=1,
+ unit="unit",
+ vat_rate=1,
+ )
+ ],
+ message="message",
+ valid_for_days=1,
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str` — Counterpart unique ID.
+
+
+
+
+
+-
+
+**currency:** `CurrencyEnum` — The currency in which the price of the product is set. (all items need to have the same currency)
+
+
+
+
+
+-
+
+**items:** `typing.Sequence[PurchaseOrderItem]` — List of item to purchase
+
+
+
+
+
+-
+
+**message:** `str` — Msg which will be send to counterpart for who the purchase order is issued.
+
+
+
+
+
+-
+
+**valid_for_days:** `int` — Number of days for which purchase order is valid
+
+
+
+
+
+-
+
+**counterpart_address_id:** `typing.Optional[str]` — The ID of counterpart address object stored in counterparts service. If not provided, counterpart's default address is used.
+
+
+
+
+
+-
+
+**entity_vat_id_id:** `typing.Optional[str]` — Entity VAT ID identifier that applied to purchase order
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.purchase_orders.get_variables()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get a list of placeholders allowed to insert into an email template for customization
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.get_variables()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.purchase_orders.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.get_by_id(
+ purchase_order_id="purchase_order_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**purchase_order_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.purchase_orders.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.delete_by_id(
+ purchase_order_id="purchase_order_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**purchase_order_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.purchase_orders.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.update_by_id(
+ purchase_order_id="purchase_order_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**purchase_order_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_address_id:** `typing.Optional[str]` — The ID of counterpart address object stored in counterparts service. If not provided, counterpart's default address is used.
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]` — Counterpart unique ID.
+
+
+
+
+
+-
+
+**entity_vat_id_id:** `typing.Optional[str]` — Entity VAT ID identifier that applied to purchase order
+
+
+
+
+
+-
+
+**items:** `typing.Optional[typing.Sequence[PurchaseOrderItem]]` — List of item to purchase
+
+
+
+
+
+-
+
+**message:** `typing.Optional[str]` — Msg which will be send to counterpart for who the purchase order is issued.
+
+
+
+
+
+-
+
+**valid_for_days:** `typing.Optional[int]` — Number of days for which purchase order is valid
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.purchase_orders.preview_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.preview_by_id(
+ purchase_order_id="purchase_order_id",
+ body_text="body_text",
+ subject_text="subject_text",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**purchase_order_id:** `str`
+
+
+
+
+
+-
+
+**body_text:** `str`
+
+
+
+
+
+-
+
+**subject_text:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.purchase_orders.send_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.purchase_orders.send_by_id(
+ purchase_order_id="purchase_order_id",
+ body_text="body_text",
+ subject_text="subject_text",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**purchase_order_id:** `str`
+
+
+
+
+
+-
+
+**body_text:** `str`
+
+
+
+
+
+-
+
+**subject_text:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Payables
+client.payables.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Lists all payables from the connected entity.
+
+If you already have the data of the payable (amount in [minor units](https://docs.monite.com/docs/currencies#minor-units), currency, vendor information, and other details)
+stored somewhere as individual attributes, you can create a payable with these attributes by calling [POST
+/payables](https://docs.monite.com/reference/post_payables) and providing the [base64-encoded](https://en.wikipedia.org/wiki/Base64) contents of the original invoice file in the field `base64_encoded_file`.
+
+A payable is a financial document given by an entity`s supplier itemizing the purchase of a good or a service and
+demanding payment.
+
+The `file_name` field is optional. If omitted, it defaults to “default_file_name”. If the settings are configured
+to automatically set `suggested_payment_term`, this object can be omitted from the request body.
+
+The `id` generated for this payable can be used in other API calls to update the data of this payable or trigger [
+status transitions](https://docs.monite.com/docs/payable-status-transitions), for example. essential data
+fields to move from `draft` to `new`
+
+Related guide: [Create a payable from data](https://docs.monite.com/docs/collect-payables#create-a-payable-from-data)
+
+See also:
+
+[Automatic calculation of due date](https://docs.monite.com/docs/collect-payables#automatic-calculation-of-due-date)
+
+[Suggested payment date](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+[Attach file](https://docs.monite.com/docs/collect-payables#attach-file)
+
+[Collect payables by email](https://docs.monite.com/docs/collect-payables#send-payables-by-email)
+
+[Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[PayableCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**status:** `typing.Optional[PayableStateEnum]`
+
+
+
+
+
+-
+
+**status_in:** `typing.Optional[
+ typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]
+]`
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**total_amount:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_gt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_lt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_gte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_lte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_gt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_lt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_gte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_lte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]`
+
+
+
+
+
+-
+
+**counterpart_name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**search_text:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_gt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_lt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_gte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_lte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**was_created_by_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**source_of_payable_data:** `typing.Optional[SourceOfPayableDataEnum]`
+
+
+
+
+
+-
+
+**ocr_status:** `typing.Optional[OcrStatusEnum]`
+
+
+
+
+
+-
+
+**line_item_id:** `typing.Optional[str]` — Search for a payable by the identifier of the line item associated with it.
+
+
+
+
+
+-
+
+**purchase_order_id:** `typing.Optional[str]` — Search for a payable by the identifier of the purchase order associated with it.
+
+
+
+
+
+-
+
+**project_id:** `typing.Optional[str]` — Search for a payable by the identifier of the project associated with it.
+
+
+
+
+
+-
+
+**tag_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Search for a payable by the identifiers of the tags associated with it.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Add a new payable by providing the amount, currency, vendor name, and other details.
+You can provide the base64_encoded contents of the original invoice file in the field `base64_encoded_file`.
+
+You can use this endpoint to bypass the Monite OCR service and provide the data directly
+(for example, if you already have the data in place).
+
+A newly created payable has the the `draft` [status](https://docs.monite.com/docs/payables-lifecycle).
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.create()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**base64encoded_file:** `typing.Optional[str]`
+
+Base64-encoded contents of the original issued payable. The file is provided for reference purposes as the original source of the data.
+
+ Any file formats are allowed. The most common formats are PDF, PNG, JPEG, TIFF.
+
+
+
+
+
+-
+
+**counterpart_address_id:** `typing.Optional[str]` — The ID of counterpart address object stored in counterparts service
+
+
+
+
+
+-
+
+**counterpart_bank_account_id:** `typing.Optional[str]` — The ID of counterpart bank account object stored in counterparts service
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]` — The ID of the counterpart object that represents the vendor or supplier.
+
+
+
+
+
+-
+
+**counterpart_vat_id_id:** `typing.Optional[str]` — The ID of counterpart VAT ID object stored in counterparts service
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]` — The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — An arbitrary description of this payable.
+
+
+
+
+
+-
+
+**document_id:** `typing.Optional[str]` — A unique invoice number assigned by the invoice issuer for payment tracking purposes.
+
+
+
+
+
+-
+
+**due_date:** `typing.Optional[str]` — The date by which the payable must be paid, in the YYYY-MM-DD format. If the payable specifies payment terms with early payment discounts, this is the final payment date.
+
+
+
+
+
+-
+
+**file_name:** `typing.Optional[str]` — The original file name.
+
+
+
+
+
+-
+
+**issued_at:** `typing.Optional[str]` — The date when the payable was issued, in the YYYY-MM-DD format.
+
+
+
+
+
+-
+
+**partner_metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Metadata for partner needs
+
+
+
+
+
+-
+
+**payment_terms:** `typing.Optional[PayablePaymentTermsCreatePayload]` — The number of days to pay with potential discount for options shorter than due_date
+
+
+
+
+
+-
+
+**project_id:** `typing.Optional[str]` — The ID of a project
+
+
+
+
+
+-
+
+**purchase_order_id:** `typing.Optional[str]` — The identifier of the purchase order to which this payable belongs.
+
+
+
+
+
+-
+
+**sender:** `typing.Optional[str]` — The email address from which the invoice was sent to the entity.
+
+
+
+
+
+-
+
+**subtotal:** `typing.Optional[int]` — The subtotal amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**suggested_payment_term:** `typing.Optional[SuggestedPaymentTerm]` — The suggested date and corresponding discount in which payable could be paid. The date is in the YYYY-MM-DD format. The discount is calculated as X * (10^-4) - for example, 100 is 1%, 25 is 0,25%, 10000 is 100 %. Date varies depending on the payment terms and may even be equal to the due date with discount 0.
+
+
+
+
+
+-
+
+**tag_ids:** `typing.Optional[typing.Sequence[str]]` — A list of IDs of user-defined tags (labels) assigned to this payable. Tags can be used to trigger a specific approval policy for this payable.
+
+
+
+
+
+-
+
+**tax:** `typing.Optional[int]` — Registered tax percentage applied for a service price in minor units, e.g. 200 means 2%. 1050 means 10.5%.
+
+
+
+
+
+-
+
+**tax_amount:** `typing.Optional[int]` — Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**total_amount:** `typing.Optional[int]` — The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.get_analytics(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve aggregated statistics for payables, including total amount and count, both overall and by status.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.get_analytics()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**status:** `typing.Optional[PayableStateEnum]`
+
+
+
+
+
+-
+
+**status_in:** `typing.Optional[
+ typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]
+]`
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**total_amount:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_gt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_lt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_gte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_lte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_gt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_lt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_gte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**amount_lte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]`
+
+
+
+
+
+-
+
+**counterpart_name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**search_text:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_gt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_lt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_gte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_lte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**was_created_by_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**source_of_payable_data:** `typing.Optional[SourceOfPayableDataEnum]`
+
+
+
+
+
+-
+
+**ocr_status:** `typing.Optional[OcrStatusEnum]`
+
+
+
+
+
+-
+
+**line_item_id:** `typing.Optional[str]` — Search for a payable by the identifier of the line item associated with it.
+
+
+
+
+
+-
+
+**purchase_order_id:** `typing.Optional[str]` — Search for a payable by the identifier of the purchase order associated with it.
+
+
+
+
+
+-
+
+**project_id:** `typing.Optional[str]` — Search for a payable by the identifier of the project associated with it.
+
+
+
+
+
+-
+
+**tag_ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Search for a payable by the identifiers of the tags associated with it.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.upload_from_file(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Upload an incoming invoice (payable) in PDF, PNG, JPEG, or TIFF format and scan its contents. The maximum file size is 10MB.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.upload_from_file()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**file:** `from __future__ import annotations
+
+core.File` — See core.File for more documentation
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.get_validations()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get payable validations.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.get_validations()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.update_validations(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update payable validations.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.update_validations(
+ required_fields=["currency"],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**required_fields:** `typing.Sequence[PayablesFieldsAllowedForValidate]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.reset_validations()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Reset payable validations to default ones.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.reset_validations()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.get_variables()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get a list of placeholders allowed to insert into an email template for customization
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.get_variables()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieves information about a specific payable with the given ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.get_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deletes a specific payable.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.delete_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Updates the information about a specific payable.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.update_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_address_id:** `typing.Optional[str]` — The ID of counterpart address object stored in counterparts service
+
+
+
+
+
+-
+
+**counterpart_bank_account_id:** `typing.Optional[str]` — The ID of counterpart bank account object stored in counterparts service
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]` — The ID of the counterpart object that represents the vendor or supplier.
+
+
+
+
+
+-
+
+**counterpart_raw_data:** `typing.Optional[CounterpartRawDataUpdateRequest]` — Allows to fix some data in counterpart recognised fields to correct them in order to make autolinking happen.
+
+
+
+
+
+-
+
+**counterpart_vat_id_id:** `typing.Optional[str]` — The ID of counterpart VAT ID object stored in counterparts service
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]` — The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — An arbitrary description of this payable.
+
+
+
+
+
+-
+
+**document_id:** `typing.Optional[str]` — A unique invoice number assigned by the invoice issuer for payment tracking purposes.
+
+
+
+
+
+-
+
+**due_date:** `typing.Optional[str]` — The date by which the payable must be paid, in the YYYY-MM-DD format. If the payable specifies payment terms with early payment discounts, this is the final payment date.
+
+
+
+
+
+-
+
+**issued_at:** `typing.Optional[str]` — The date when the payable was issued, in the YYYY-MM-DD format.
+
+
+
+
+
+-
+
+**partner_metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Metadata for partner needs
+
+
+
+
+
+-
+
+**payment_terms:** `typing.Optional[PayablePaymentTermsCreatePayload]` — The number of days to pay with potential discount for options shorter than due_date
+
+
+
+
+
+-
+
+**project_id:** `typing.Optional[str]` — The project ID of the payable.
+
+
+
+
+
+-
+
+**purchase_order_id:** `typing.Optional[str]` — The identifier of the purchase order to which this payable belongs.
+
+
+
+
+
+-
+
+**sender:** `typing.Optional[str]` — The email address from which the invoice was sent to the entity.
+
+
+
+
+
+-
+
+**subtotal:** `typing.Optional[int]` — The subtotal amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**suggested_payment_term:** `typing.Optional[SuggestedPaymentTerm]` — The suggested date and corresponding discount in which payable could be paid. The date is in the YYYY-MM-DD format. The discount is calculated as X * (10^-4) - for example, 100 is 1%, 25 is 0,25%, 10000 is 100 %. Date varies depending on the payment terms and may even be equal to the due date with discount 0.
+
+
+
+
+
+-
+
+**tag_ids:** `typing.Optional[typing.Sequence[str]]` — A list of IDs of user-defined tags (labels) assigned to this payable. Tags can be used to trigger a specific approval policy for this payable.
+
+
+
+
+
+-
+
+**tax:** `typing.Optional[int]` — Registered tax percentage applied for a service price in minor units, e.g. 200 means 2%, 1050 means 10.5%.
+
+
+
+
+
+-
+
+**tax_amount:** `typing.Optional[int]` — Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**total_amount:** `typing.Optional[int]` — The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.approve_payment_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Confirms that the payable is ready to be paid.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.approve_payment_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.attach_file_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Attach file to payable without existing attachment.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.attach_file_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**file:** `from __future__ import annotations
+
+core.File` — See core.File for more documentation
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.cancel_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Cancels the payable that was not confirmed during the review.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.cancel_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.mark_as_paid_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Mark a payable as paid.
+
+Payables can be paid using the payment channels offered by Monite or through external payment channels. In the latter
+case, the invoice is not automatically marked as paid in the system and needs to be converted to the paid status
+manually.
+
+Optionally, it is possible to pass the `comment` field in the request body, to describe how and when the invoice was
+paid.
+
+Notes:
+
+- To use this endpoint with an entity user token, this entity user must have a role that includes the `pay` permission
+ for payables.
+- The `amount_to_pay` field is automatically calculated based on the `amount_due` less the percentage described
+ in the `payment_terms.discount` value.
+
+Related guide: [Mark a payable as paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-paid)
+
+See also:
+
+[Payables lifecycle](https://docs.monite.com/docs/payables-lifecycle)
+
+[Payables status transitions](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.mark_as_paid_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**comment:** `typing.Optional[str]` — An arbitrary comment that describes how and when this payable was paid.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.mark_as_partially_paid_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Mark a payable as partially paid.
+
+If the payable is partially paid, its status is moved to `partially_paid`. The value of the `amount_paid` field must be
+the sum of all payments made, not only the last one.
+
+Notes:
+
+- This endpoint can be used for payables in the `waiting_to_be_paid` status.
+- The `amount_paid` must be greater than 0 and less than the total payable amount specified by the `amount` field.
+- You can use this endpoint multiple times for the same payable to reflect multiple partial payments, always setting the
+ sum of all payments made.
+- To use this endpoint with an entity user token, this entity user must have a role that includes the `pay`
+ permission for payables.
+- The `amount_to_pay` field is automatically calculated based on the `amount_due` less the percentage described
+ in the `payment_terms.discount` value.
+
+Related guide: [Mark a payable as partially paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-partially-paid)
+
+See also:
+
+[Payables lifecycle](https://docs.monite.com/docs/payables-lifecycle)
+
+[Payables status transitions](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+[Mark a payable as paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-paid)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.mark_as_partially_paid_by_id(
+ payable_id="payable_id",
+ amount_paid=1,
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**amount_paid:** `int` — How much was paid on the invoice (in minor units).
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.reject_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Declines the payable when an approver finds any mismatch or discrepancies.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.reject_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.reopen_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Reset payable state from rejected to new.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.reopen_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.submit_for_approval_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Starts the approval process once the uploaded payable is validated.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.submit_for_approval_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.validate_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Check the invoice for compliance with the requirements for movement from draft to new status.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.validate_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Payment intents
+client.payment_intents.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_intents.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[PaymentIntentCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**object_id:** `typing.Optional[str]` — ID of a payable or receivable invoice. If provided, returns only payment intents associated with the specified invoice.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_intents.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_intents.get_by_id(
+ payment_intent_id="payment_intent_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_intent_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_intents.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_intents.update_by_id(
+ payment_intent_id="payment_intent_id",
+ amount=1,
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_intent_id:** `str`
+
+
+
+
+
+-
+
+**amount:** `int`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_intents.get_history_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_intents.get_history_by_id(
+ payment_intent_id="payment_intent_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_intent_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Payment links
+client.payment_links.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite, PaymentAccountObject
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_links.create(
+ payment_methods=["sepa_credit"],
+ recipient=PaymentAccountObject(
+ id="id",
+ type="entity",
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_methods:** `typing.Sequence[MoniteAllPaymentMethodsTypes]`
+
+
+
+
+
+-
+
+**recipient:** `PaymentAccountObject`
+
+
+
+
+
+-
+
+**amount:** `typing.Optional[int]` — The payment amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). Required if `object` is not specified.
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]` — The payment currency. Required if `object` is not specified.
+
+
+
+
+
+-
+
+**expires_at:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**invoice:** `typing.Optional[Invoice]` — An object containing information about the invoice being paid. Used only if `object` is not specified.
+
+
+
+
+
+-
+
+**object:** `typing.Optional[PaymentObject]` — If the invoice being paid is a payable or receivable stored in Monite, provide the `object` object containing the invoice type and ID. Otherwise, use the `amount`, `currency`, `payment_reference`, and (optionally) `invoice` fields to specify the invoice-related data.
+
+
+
+
+
+-
+
+**payment_reference:** `typing.Optional[str]` — A payment reference number that the recipient can use to identify the payer or purpose of the transaction. Required if `object` is not specified.
+
+
+
+
+
+-
+
+**return_url:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_links.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_links.get_by_id(
+ payment_link_id="payment_link_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_link_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_links.expire_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_links.expire_by_id(
+ payment_link_id="payment_link_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_link_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Payment records
+client.payment_records.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_records.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[PaymentRecordCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**is_external:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
+**object_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_records.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+import datetime
+
+from monite import Monite, PaymentRecordObjectRequest
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_records.create(
+ amount=1,
+ currency="AED",
+ object=PaymentRecordObjectRequest(
+ id="id",
+ type="receivable",
+ ),
+ paid_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ payment_intent_id="payment_intent_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**amount:** `int`
+
+
+
+
+
+-
+
+**currency:** `CurrencyEnum`
+
+
+
+
+
+-
+
+**object:** `PaymentRecordObjectRequest`
+
+
+
+
+
+-
+
+**paid_at:** `dt.datetime`
+
+
+
+
+
+-
+
+**payment_intent_id:** `str`
+
+
+
+
+
+-
+
+**entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_records.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_records.get_by_id(
+ payment_record_id="payment_record_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_record_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Payment reminders
+client.payment_reminders.get()
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_reminders.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_reminders.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_reminders.create(
+ name="name",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str`
+
+
+
+
+
+-
+
+**recipients:** `typing.Optional[Recipients]`
+
+
+
+
+
+-
+
+**term1reminder:** `typing.Optional[Reminder]` — Reminder to send for first payment term
+
+
+
+
+
+-
+
+**term2reminder:** `typing.Optional[Reminder]` — Reminder to send for second payment term
+
+
+
+
+
+-
+
+**term_final_reminder:** `typing.Optional[Reminder]` — Reminder to send for final payment term
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_reminders.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_reminders.get_by_id(
+ payment_reminder_id="payment_reminder_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_reminder_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_reminders.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_reminders.delete_by_id(
+ payment_reminder_id="payment_reminder_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_reminder_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_reminders.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_reminders.update_by_id(
+ payment_reminder_id="payment_reminder_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_reminder_id:** `str`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**recipients:** `typing.Optional[Recipients]`
+
+
+
+
+
+-
+
+**term1reminder:** `typing.Optional[Reminder]` — Reminder to send for first payment term
+
+
+
+
+
+-
+
+**term2reminder:** `typing.Optional[Reminder]` — Reminder to send for second payment term
+
+
+
+
+
+-
+
+**term_final_reminder:** `typing.Optional[Reminder]` — Reminder to send for final payment term
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Payment terms
+client.payment_terms.get()
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_terms.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_terms.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite, PaymentTerm
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_terms.create(
+ name="name",
+ term_final=PaymentTerm(
+ number_of_days=1,
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str`
+
+
+
+
+
+-
+
+**term_final:** `PaymentTerm` — The final tier of the payment term. Defines the invoice due date.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**term1:** `typing.Optional[PaymentTermDiscount]` — The first tier of the payment term. Represents the terms of the first early discount.
+
+
+
+
+
+-
+
+**term2:** `typing.Optional[PaymentTermDiscount]` — The second tier of the payment term. Defines the terms of the second early discount.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_terms.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_terms.get_by_id(
+ payment_terms_id="payment_terms_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_terms_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_terms.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_terms.delete_by_id(
+ payment_terms_id="payment_terms_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_terms_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payment_terms.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payment_terms.update_by_id(
+ payment_terms_id="payment_terms_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payment_terms_id:** `str`
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**term1:** `typing.Optional[PaymentTermDiscount]` — The first tier of the payment term. Represents the terms of the first early discount.
+
+
+
+
+
+-
+
+**term2:** `typing.Optional[PaymentTermDiscount]` — The second tier of the payment term. Defines the terms of the second early discount.
+
+
+
+
+
+-
+
+**term_final:** `typing.Optional[PaymentTerm]` — The final tier of the payment term. Defines the invoice due date.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Products
+client.products.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.products.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum3]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ProductCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**type:** `typing.Optional[ProductServiceTypeEnum]`
+
+
+
+
+
+-
+
+**price:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**price_gt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**price_lt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**price_gte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**price_lte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]`
+
+
+
+
+
+-
+
+**currency_in:** `typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]]`
+
+
+
+
+
+-
+
+**measure_unit_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.products.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.products.create(
+ name="name",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str` — Name of the product.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — Description of the product.
+
+
+
+
+
+-
+
+**ledger_account_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**measure_unit_id:** `typing.Optional[str]` — The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+
+
+
+
+
+-
+
+**price:** `typing.Optional[Price]`
+
+
+
+
+
+-
+
+**smallest_amount:** `typing.Optional[float]` — The smallest amount allowed for this product.
+
+
+
+
+
+-
+
+**type:** `typing.Optional[ProductServiceTypeEnum]` — Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.products.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.products.get_by_id(
+ product_id="product_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**product_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.products.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.products.delete_by_id(
+ product_id="product_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**product_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.products.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.products.update_by_id(
+ product_id="product_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**product_id:** `str`
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — Description of the product.
+
+
+
+
+
+-
+
+**ledger_account_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**measure_unit_id:** `typing.Optional[str]` — The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — Name of the product.
+
+
+
+
+
+-
+
+**price:** `typing.Optional[Price]`
+
+
+
+
+
+-
+
+**smallest_amount:** `typing.Optional[float]` — The smallest amount allowed for this product.
+
+
+
+
+
+-
+
+**type:** `typing.Optional[ProductServiceTypeEnum]` — Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Projects
+client.projects.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all projects for an entity
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.projects.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ProjectCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**start_date:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**start_date_gt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**start_date_lt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**start_date_gte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**start_date_lte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**end_date:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**end_date_gt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**end_date_lt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**end_date_gte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**end_date_lte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_iexact:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**code:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_by_entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.projects.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new project.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.projects.create(
+ name="Marketing",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str` — The project name.
+
+
+
+
+
+-
+
+**code:** `typing.Optional[str]` — Project code
+
+
+
+
+
+-
+
+**color:** `typing.Optional[str]` — Project color
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — Description of project
+
+
+
+
+
+-
+
+**end_date:** `typing.Optional[str]` — Project end date
+
+
+
+
+
+-
+
+**parent_id:** `typing.Optional[str]` — Parent project ID
+
+
+
+
+
+-
+
+**partner_metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Project metadata
+
+
+
+
+
+-
+
+**start_date:** `typing.Optional[str]` — Project start date
+
+
+
+
+
+-
+
+**tag_ids:** `typing.Optional[typing.Sequence[str]]` — A list of IDs of user-defined tags (labels) assigned to this project.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.projects.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get a project with the given ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.projects.get_by_id(
+ project_id="project_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**project_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.projects.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete a project.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.projects.delete_by_id(
+ project_id="project_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**project_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.projects.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update a project.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.projects.update_by_id(
+ project_id="project_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**project_id:** `str`
+
+
+
+
+
+-
+
+**code:** `typing.Optional[str]` — Project code
+
+
+
+
+
+-
+
+**color:** `typing.Optional[str]` — Project color
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — Description of project
+
+
+
+
+
+-
+
+**end_date:** `typing.Optional[str]` — Project end date
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — The project name.
+
+
+
+
+
+-
+
+**parent_id:** `typing.Optional[str]` — Parent project ID
+
+
+
+
+
+-
+
+**partner_metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Project metadata
+
+
+
+
+
+-
+
+**start_date:** `typing.Optional[str]` — Project start date
+
+
+
+
+
+-
+
+**tag_ids:** `typing.Optional[typing.Sequence[str]]` — A list of IDs of user-defined tags (labels) assigned to this project.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Receivables
+client.receivables.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns a list of [accounts receivable](https://docs.monite.com/accounts-receivable/index) documents - invoices, quotes, and credit notes - of the specified entity.
+
+Results can be filtered by amount, counterpart, due date, and other criteria. Multiple filters are combined using logical AND unless specified otherwise. If no documents matching the search criteria are found, the endpoint returns a successful response with an empty `data` array.
+
+This endpoint supports [pagination](https://docs.monite.com/api/concepts/pagination-sorting-filtering) and sorting. By default, results are sorted by the creation date in ascending order (from oldest to newest).
+
+#### Examples
+
+##### Invoices
+
+- Get all overdue invoices:
+
+ ```
+ GET /receivables?type=invoice&status=overdue
+ ```
+
+- Get all invoices created for the counterpart named "Solarwind" (case-insensitive):
+
+ ```
+ GET /receivables?type=invoice?counterpart_name__icontains=Solarwind
+ ```
+
+- Get invoices whose total amount starts from 500 EUR:
+
+ ```
+ GET /receivables?type=invoice&total_amount__gte=50000
+ ```
+
+- Get invoices that are due for payment in September 2024:
+
+ ```
+ GET /receivables?type=invoice&due_date__gte=2024-09-01T00:00:00Z&due_date__lt=2024-10-01T00:00:00Z
+ ```
+
+- Get invoices created on or after September 1, 2024:
+
+ ```
+ GET /receivables?type=invoice&created_at__gte=2024-09-01T00:00:00Z
+ ```
+
+- Find an invoice created from a specific quote:
+
+ ```
+ GET /receivables?type=invoice?based_on=QUOTE_ID
+ ```
+
+##### Quotes
+
+- Get the latest created quote:
+
+ ```
+ GET /receivables?type=quote&sort=created_at&order=desc&limit=1
+ ```
+
+- Get the latest issued quote:
+
+ ```
+ GET /receivables?type=quote&sort=issue_date&order=desc&limit=1
+ ```
+
+##### Credit notes
+
+- Find all credit notes created for a specific invoice:
+
+ ```
+ GET /receivables?type=credit_note?based_on=INVOICE_ID
+ ```
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum2]` — Sort order (ascending by default). Typically used together with the `sort` parameter.
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]`
+
+The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.
+
+When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`.
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]`
+
+A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query.
+
+If not specified, the first page of results will be returned.
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+Return only receivables with the specified IDs. Valid but nonexistent IDs do not raise errors but produce no results.
+
+To specify multiple IDs, repeat this parameter for each value:
+`id__in=&id__in=`
+
+
+
+
+
+-
+
+**status_in:** `typing.Optional[
+ typing.Union[
+ ReceivablesGetRequestStatusInItem,
+ typing.Sequence[ReceivablesGetRequestStatusInItem],
+ ]
+]`
+
+Return only receivables that have the specified statuses. See the applicable [invoice statuses](https://docs.monite.com/accounts-receivable/invoices/index), [quote statuses](https://docs.monite.com/accounts-receivable/quotes/index), and [credit note statuses](https://docs.monite.com/accounts-receivable/credit-notes#credit-note-lifecycle).
+
+To specify multiple statuses, repeat this parameter for each value:
+`status__in=draft&status__in=issued`
+
+
+
+
+
+-
+
+**entity_user_id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+Return only receivables created by the entity users with the specified IDs.To specify multiple user IDs, repeat this parameter for each ID:
+`entity_user_id__in=&entity_user_id__in=`
+
+If the request is authenticated using an entity user token, this user must have the `receivable.read.allowed` (rather than `allowed_for_own`) permission to be able to query receivables created by other users.
+
+IDs of deleted users will still produce results here if those users had associated receivables. Valid but nonexistent user IDs do not raise errors but produce no results.
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ReceivableCursorFields]` — The field to sort the results by. Typically used together with the `order` parameter.
+
+
+
+
+
+-
+
+**tag_ids_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+Return only receivables whose [tags](https://docs.monite.com/common/tags) include at least one of the tags with the specified IDs.
+
+For example, given receivables with the following tags:
+
+1. tagA
+2. tagB
+3. tagA, tagB
+4. tagC
+5. tagB, tagC
+
+`tag_ids__in=&tag_ids__in=` will return receivables 1, 2, 3, and 5.
+
+Valid but nonexistent tag IDs do not raise errors but produce no results.
+
+
+
+
+
+-
+
+**type:** `typing.Optional[ReceivableType]`
+
+
+
+
+
+-
+
+**document_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**document_id_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**issue_date_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**issue_date_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**issue_date_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**issue_date_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_contains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_name_icontains:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**total_amount:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_gt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_lt:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_gte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**total_amount_lte:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**status:** `typing.Optional[ReceivablesGetRequestStatus]`
+
+
+
+
+
+-
+
+**entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**based_on:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_gt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_lt:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_gte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**due_date_lte:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**project_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import LineItem, Monite, ReceivableFacadeCreateQuotePayload
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.create(
+ request=ReceivableFacadeCreateQuotePayload(
+ counterpart_billing_address_id="counterpart_billing_address_id",
+ counterpart_id="counterpart_id",
+ currency="AED",
+ line_items=[
+ LineItem(
+ quantity=1.1,
+ )
+ ],
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request:** `ReceivableFacadeCreatePayload`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.get_variables()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get a list of placeholders that can be used in email templates for customization.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get_variables()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.delete_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite, UpdateQuote, UpdateQuotePayload
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.update_by_id(
+ receivable_id="receivable_id",
+ request=UpdateQuotePayload(
+ quote=UpdateQuote(),
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request:** `ReceivableUpdatePayload`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.accept_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.accept_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**signature:** `typing.Optional[Signature]` — A digital signature, if required for quote acceptance
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.cancel_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.cancel_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.clone_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.clone_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.decline_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.decline_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**comment:** `typing.Optional[str]` — Field with a comment on why the client declined this Quote
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.get_history(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get_history(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**order:** `typing.Optional[OrderEnum3]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ReceivableHistoryCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**event_type_in:** `typing.Optional[
+ typing.Union[
+ ReceivableHistoryEventTypeEnum,
+ typing.Sequence[ReceivableHistoryEventTypeEnum],
+ ]
+]`
+
+
+
+
+
+-
+
+**entity_user_id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**timestamp_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**timestamp_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**timestamp_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**timestamp_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.get_history_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get_history_by_id(
+ receivable_history_id="receivable_history_id",
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_history_id:** `str`
+
+
+
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.issue_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.issue_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.update_line_items_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Replace all line items of an existing invoice or quote with a new list of line items.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import LineItem, Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.update_line_items_by_id(
+ receivable_id="receivable_id",
+ data=[
+ LineItem(
+ quantity=1.1,
+ )
+ ],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**data:** `typing.Sequence[LineItem]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.get_mails(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get_mails(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**order:** `typing.Optional[OrderEnum3]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ReceivableMailCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**status:** `typing.Optional[ReceivableMailStatusEnum]`
+
+
+
+
+
+-
+
+**status_in:** `typing.Optional[
+ typing.Union[
+ ReceivableMailStatusEnum, typing.Sequence[ReceivableMailStatusEnum]
+ ]
+]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.get_mail_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get_mail_by_id(
+ receivable_id="receivable_id",
+ mail_id="mail_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**mail_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.mark_as_paid_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.mark_as_paid_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**comment:** `typing.Optional[str]` — Optional comment explaining how the payment was made.
+
+
+
+
+
+-
+
+**paid_at:** `typing.Optional[dt.datetime]` — Date and time when the invoice was paid.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.mark_as_partially_paid_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Deprecated. Use `POST /payment_records` to record an invoice payment.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.mark_as_partially_paid_by_id(
+ receivable_id="receivable_id",
+ amount_paid=1,
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**amount_paid:** `int` — How much has been paid on the invoice (in minor units).
+
+
+
+
+
+-
+
+**comment:** `typing.Optional[str]` — Optional comment explaining how the payment was made.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.mark_as_uncollectible_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.mark_as_uncollectible_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**comment:** `typing.Optional[str]` — Optional comment explains why the Invoice goes uncollectible.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.get_pdf_link_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.get_pdf_link_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.preview_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.preview_by_id(
+ receivable_id="receivable_id",
+ body_text="body_text",
+ subject_text="subject_text",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**body_text:** `str` — Body text of the content
+
+
+
+
+
+-
+
+**subject_text:** `str` — Subject text of the content
+
+
+
+
+
+-
+
+**language:** `typing.Optional[LanguageCodeEnum]` — Language code for localization purposes
+
+
+
+
+
+-
+
+**type:** `typing.Optional[ReceivablesPreviewTypeEnum]` — The type of the preview document.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.send_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.send_by_id(
+ receivable_id="receivable_id",
+ body_text="body_text",
+ subject_text="subject_text",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**body_text:** `str` — Body text of the content
+
+
+
+
+
+-
+
+**subject_text:** `str` — Subject text of the content
+
+
+
+
+
+-
+
+**language:** `typing.Optional[str]` — Lowercase ISO code of language
+
+
+
+
+
+-
+
+**recipients:** `typing.Optional[Recipients]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.send_test_reminder_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.send_test_reminder_by_id(
+ receivable_id="receivable_id",
+ reminder_type="term_1",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**reminder_type:** `ReminderTypeEnum` — The type of the reminder to be sent.
+
+
+
+
+
+-
+
+**recipients:** `typing.Optional[Recipients]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.receivables.verify_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.receivables.verify_by_id(
+ receivable_id="receivable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**receivable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Recurrences
+client.recurrences.get()
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.recurrences.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.recurrences.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.recurrences.create(
+ day_of_month="first_day",
+ end_month=1,
+ end_year=1,
+ invoice_id="invoice_id",
+ start_month=1,
+ start_year=1,
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**day_of_month:** `DayOfMonth`
+
+
+
+
+
+-
+
+**end_month:** `int`
+
+
+
+
+
+-
+
+**end_year:** `int`
+
+
+
+
+
+-
+
+**invoice_id:** `str`
+
+
+
+
+
+-
+
+**start_month:** `int`
+
+
+
+
+
+-
+
+**start_year:** `int`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.recurrences.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.recurrences.get_by_id(
+ recurrence_id="recurrence_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**recurrence_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.recurrences.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.recurrences.update_by_id(
+ recurrence_id="recurrence_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**recurrence_id:** `str`
+
+
+
+
+
+-
+
+**day_of_month:** `typing.Optional[DayOfMonth]`
+
+
+
+
+
+-
+
+**end_month:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**end_year:** `typing.Optional[int]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.recurrences.cancel_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.recurrences.cancel_by_id(
+ recurrence_id="recurrence_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**recurrence_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Roles
+client.roles.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Find all roles that match the search criteria.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.roles.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[RoleCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_at:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.roles.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new role from the specified values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import BizObjectsSchema, Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.roles.create(
+ name="name",
+ permissions=BizObjectsSchema(),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str` — Role name
+
+
+
+
+
+-
+
+**permissions:** `BizObjectsSchema` — Access permissions
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.roles.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.roles.get_by_id(
+ role_id="role_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**role_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.roles.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the specified fields with the provided values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.roles.update_by_id(
+ role_id="role_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**role_id:** `str`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — Role name
+
+
+
+
+
+-
+
+**permissions:** `typing.Optional[BizObjectsSchema]` — Access permissions
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Partner settings
+client.partner_settings.get()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve all settings for this partner.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.partner_settings.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.partner_settings.update(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the specified fields with the provided values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.partner_settings.update()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**accounting:** `typing.Optional[AccountingSettingsPayload]` — Settings for the accounting module.
+
+
+
+
+
+-
+
+**api_version:** `typing.Optional[ApiVersion]` — Default API version for partner.
+
+
+
+
+
+-
+
+**commercial_conditions:** `typing.Optional[typing.Sequence[str]]` — Commercial conditions for receivables.
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencySettings]` — Custom currency exchange rates.
+
+
+
+
+
+-
+
+**default_role:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A default role to provision upon new entity creation.
+
+
+
+
+
+-
+
+**einvoicing:** `typing.Optional[EInvoicingSettingsPayload]` — Settings for the e-invoicing module.
+
+
+
+
+
+-
+
+**mail:** `typing.Optional[MailSettingsPayload]` — Settings for email and mailboxes.
+
+
+
+
+
+-
+
+**payable:** `typing.Optional[PayableSettingsPayload]` — Settings for the payables module.
+
+
+
+
+
+-
+
+**payments:** `typing.Optional[PaymentsSettingsPayload]` — Settings for the payments module.
+
+
+
+
+
+-
+
+**receivable:** `typing.Optional[ReceivableSettingsPayload]` — Settings for the receivables module.
+
+
+
+
+
+-
+
+**units:** `typing.Optional[typing.Sequence[Unit]]` — Measurement units.
+
+
+
+
+
+-
+
+**website:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Tags
+client.tags.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get a list of all tags. Tags can be assigned to resources to assist with searching and filtering.
+Tags can also be used as trigger conditions in payable approval policies.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.tags.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[TagCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_by_entity_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**name_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.tags.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a new tag. The tag name must be unique.
+Tag names are case-sensitive, that is `Marketing` and `marketing` are two different tags.
+
+The response returns an auto-generated ID assigned to this tag.
+To assign this tag to a resource, send the tag ID in the `tag_ids` list when creating or updating a resource.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.tags.create(
+ name="Marketing",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**name:** `str` — The tag name. Must be unique.
+
+
+
+
+
+-
+
+**category:** `typing.Optional[TagCategory]` — The tag category.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — The tag description.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.tags.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get information about a tag with the given ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.tags.get_by_id(
+ tag_id="tag_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tag_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.tags.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete a tag with the given ID. This tag will be automatically deleted from all resources where it was used.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.tags.delete_by_id(
+ tag_id="tag_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tag_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.tags.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the tag name. The new name must be unique among existing tags.
+Tag names are case-sensitive, that is `Marketing` and `marketing` are two different tags.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.tags.update_by_id(
+ tag_id="tag_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tag_id:** `str`
+
+
+
+
+
+-
+
+**category:** `typing.Optional[TagCategory]` — The tag category.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — The tag description.
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — The tag name. Must be unique.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Text templates
+client.text_templates.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get text templates
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.text_templates.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**type:** `typing.Optional[TextTemplateType]`
+
+
+
+
+
+-
+
+**document_type:** `typing.Optional[DocumentTypeEnum]`
+
+
+
+
+
+-
+
+**is_default:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.text_templates.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create a text template
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.text_templates.create(
+ document_type="quote",
+ name="name",
+ template="template",
+ type="email_header",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**document_type:** `DocumentTypeEnum`
+
+
+
+
+
+-
+
+**name:** `str`
+
+
+
+
+
+-
+
+**template:** `str`
+
+
+
+
+
+-
+
+**type:** `TextTemplateType`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.text_templates.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all custom contents
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.text_templates.get_by_id(
+ text_template_id="text_template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**text_template_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.text_templates.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete custom content by ID
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.text_templates.delete_by_id(
+ text_template_id="text_template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**text_template_id:** `str` — UUID text_template ID
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.text_templates.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Update custom content by ID
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.text_templates.update_by_id(
+ text_template_id="text_template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**text_template_id:** `str` — UUID text_template ID
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**template:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.text_templates.make_default_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Make text template default
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.text_templates.make_default_by_id(
+ text_template_id="text_template_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**text_template_id:** `str` — UUID text_template ID
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## VAT rates
+client.vat_rates.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.vat_rates.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_address_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**counterpart_vat_id_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**entity_vat_id_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**product_type:** `typing.Optional[ProductServiceTypeEnum]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Webhook deliveries
+client.webhook_deliveries.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_deliveries.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[WebhookDeliveryCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**event_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**object_type:** `typing.Optional[WebhookObjectType]`
+
+
+
+
+
+-
+
+**event_action:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Webhook subscriptions
+client.webhook_subscriptions.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[WebhookSubscriptionCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**object_type:** `typing.Optional[WebhookObjectType]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.webhook_subscriptions.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.create(
+ object_type="account",
+ url="url",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**object_type:** `WebhookObjectType`
+
+
+
+
+
+-
+
+**url:** `str`
+
+
+
+
+
+-
+
+**event_types:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.webhook_subscriptions.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.get_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**webhook_subscription_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.webhook_subscriptions.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.delete_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**webhook_subscription_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.webhook_subscriptions.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.update_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**webhook_subscription_id:** `str`
+
+
+
+
+
+-
+
+**event_types:** `typing.Optional[typing.Sequence[str]]`
+
+
+
+
+
+-
+
+**object_type:** `typing.Optional[WebhookObjectType]`
+
+
+
+
+
+-
+
+**url:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.webhook_subscriptions.disable_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.disable_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**webhook_subscription_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.webhook_subscriptions.enable_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.enable_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**webhook_subscription_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.webhook_subscriptions.regenerate_secret_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.webhook_subscriptions.regenerate_secret_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**webhook_subscription_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Accounting Payables
+client.accounting.payables.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns a list of accounts payable invoices (bills) that exist in the entity's accounting system. This requires that an accounting connection has been previously established. Refer to the [Accounting integration guide](https://docs.monite.com/accounting/integration/index) for details.
+
+This endpoint only provides read-only access to the accounting system's data but does not pull those payables into Monite. You can use it to review the data in the accounting system and find out which of those payables already exist or do not exist in Monite.
+
+Data is actual as of the date and time of the last accounting synchronization, which is specified by the `last_pull` value in the response from `GET /accounting_connections/{connection_id}`. To make sure you are accessing the most up-to-date accounting data, you can use `POST /accounting_connections/{connection_id}/sync` to trigger on-demand synchronization before getting the list of payables.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.payables.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**limit:** `typing.Optional[int]` — Number of results per page.
+
+
+
+
+
+-
+
+**offset:** `typing.Optional[int]` — Number of results to skip before selecting items to return.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.payables.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns information about an individual payable invoice (bill) that exists in the entity's accounting system. This payable may or may not also exist in Monite.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.payables.get_by_id(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str` — An internal ID of the payable invoice (bill) in the accounting system. You can get these IDs from `GET /accounting/payables`.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Accounting Receivables
+client.accounting.receivables.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns a list of invoices that exist in the entity's accounting system. This requires that an accounting connection has been previously established. Refer to the [Accounting integration guide](https://docs.monite.com/accounting/integration/index) for details.
+
+This endpoint only provides read-only access to the accounting system's data but does not pull those invoices into Monite. You can use it to review the data in the accounting system and find out which of those invoices already exist or do not exist in Monite.
+
+Data is actual as of the date and time of the last accounting synchronization, which is specified by the `last_pull` value in the response from `GET /accounting_connections/{connection_id}`. To make sure you are accessing the most up-to-date accounting data, you can use `POST /accounting_connections/{connection_id}/sync` to trigger on-demand synchronization before getting the invoice list.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.receivables.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**limit:** `typing.Optional[int]` — Number of results per page.
+
+
+
+
+
+-
+
+**offset:** `typing.Optional[int]` — Number of results to skip before selecting items to return.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.receivables.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Returns information about an individual invoice that exists in the entity's accounting system. This invoice may or may not also exist in Monite.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.receivables.get_by_id(
+ invoice_id="invoice_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**invoice_id:** `str` — An internal ID of the invoice in the accounting system. You can get these IDs from `GET /accounting/receivables`.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Accounting Connections
+client.accounting.connections.get()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all connections
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.connections.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.connections.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create new connection
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.connections.create()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**platform:** `typing.Optional[Platform]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.connections.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get connection by id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.connections.get_by_id(
+ connection_id="connection_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**connection_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.connections.disconnect_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Disconnect
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.connections.disconnect_by_id(
+ connection_id="connection_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**connection_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.connections.sync_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.connections.sync_by_id(
+ connection_id="connection_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**connection_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Accounting SyncedRecords
+client.accounting.synced_records.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get synchronized records
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.synced_records.get(
+ object_type="product",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**object_type:** `ObjectMatchTypes`
+
+
+
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[SyncRecordCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**object_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**object_id_in:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]`
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.synced_records.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get synchronized record by id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.synced_records.get_by_id(
+ synced_record_id="synced_record_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**synced_record_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.synced_records.push_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Push object to the accounting system manually
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.synced_records.push_by_id(
+ synced_record_id="synced_record_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**synced_record_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Accounting TaxRates
+client.accounting.tax_rates.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all tax rate accounts
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.tax_rates.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[TaxRateAccountCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.tax_rates.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get tax rate account by id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.tax_rates.get_by_id(
+ tax_rate_id="tax_rate_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**tax_rate_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Accounting LedgerAccounts
+client.accounting.ledger_accounts.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all ledger accounts
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.ledger_accounts.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[LedgerAccountCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.accounting.ledger_accounts.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get ledger account by id
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.accounting.ledger_accounts.get_by_id(
+ ledger_account_id="ledger_account_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**ledger_account_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## ApprovalPolicies Processes
+client.approval_policies.processes.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a list of all approval policy processes.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.processes.get(
+ approval_policy_id="approval_policy_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_policy_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_policies.processes.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a specific approval policy process.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.processes.get_by_id(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_policy_id:** `str`
+
+
+
+
+
+-
+
+**process_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_policies.processes.cancel_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Cancel an ongoing approval process for a specific approval policy.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.processes.cancel_by_id(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_policy_id:** `str`
+
+
+
+
+
+-
+
+**process_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.approval_policies.processes.get_steps(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a list of approval policy process steps.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.approval_policies.processes.get_steps(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**approval_policy_id:** `str`
+
+
+
+
+
+-
+
+**process_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Counterparts Addresses
+client.counterparts.addresses.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.addresses.get(
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.addresses.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.addresses.create(
+ counterpart_id="counterpart_id",
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**city:** `str` — City name.
+
+
+
+
+
+-
+
+**country:** `AllowedCountries` — Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+
+
+
+
+-
+
+**line1:** `str` — Street address.
+
+
+
+
+
+-
+
+**postal_code:** `str` — ZIP or postal code.
+
+
+
+
+
+-
+
+**line2:** `typing.Optional[str]` — Additional address information (if any).
+
+
+
+
+
+-
+
+**state:** `typing.Optional[str]` — State, region, province, or county.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.addresses.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.addresses.get_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**address_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.addresses.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.addresses.delete_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**address_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.addresses.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.addresses.update_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**address_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**city:** `typing.Optional[str]` — City name.
+
+
+
+
+
+-
+
+**country:** `typing.Optional[AllowedCountries]` — Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+
+
+
+
+-
+
+**line1:** `typing.Optional[str]` — Street address.
+
+
+
+
+
+-
+
+**line2:** `typing.Optional[str]` — Additional address information (if any).
+
+
+
+
+
+-
+
+**postal_code:** `typing.Optional[str]` — ZIP or postal code.
+
+
+
+
+
+-
+
+**state:** `typing.Optional[str]` — State, region, province, or county.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Counterparts BankAccounts
+client.counterparts.bank_accounts.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.bank_accounts.get(
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.bank_accounts.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.bank_accounts.create(
+ counterpart_id="counterpart_id",
+ country="AF",
+ currency="AED",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**country:** `AllowedCountries`
+
+
+
+
+
+-
+
+**currency:** `CurrencyEnum`
+
+
+
+
+
+-
+
+**account_holder_name:** `typing.Optional[str]` — The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
+
+
+
+
+
+-
+
+**account_number:** `typing.Optional[str]` — The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+
+
+
+
+-
+
+**bic:** `typing.Optional[str]` — The BIC/SWIFT code of the bank.
+
+
+
+
+
+-
+
+**iban:** `typing.Optional[str]` — The IBAN of the bank account.
+
+
+
+
+
+-
+
+**is_default_for_currency:** `typing.Optional[bool]`
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**partner_metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Metadata for partner needs.
+
+
+
+
+
+-
+
+**routing_number:** `typing.Optional[str]` — The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
+
+
+
+
+
+-
+
+**sort_code:** `typing.Optional[str]` — The bank's sort code.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.bank_accounts.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.bank_accounts.get_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.bank_accounts.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.bank_accounts.delete_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.bank_accounts.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.bank_accounts.update_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**account_holder_name:** `typing.Optional[str]` — The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
+
+
+
+
+
+-
+
+**account_number:** `typing.Optional[str]` — The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+
+
+
+
+-
+
+**bic:** `typing.Optional[str]` — The BIC/SWIFT code of the bank.
+
+
+
+
+
+-
+
+**country:** `typing.Optional[AllowedCountries]`
+
+
+
+
+
+-
+
+**currency:** `typing.Optional[CurrencyEnum]`
+
+
+
+
+
+-
+
+**iban:** `typing.Optional[str]` — The IBAN of the bank account.
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**partner_metadata:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — Metadata for partner needs.
+
+
+
+
+
+-
+
+**routing_number:** `typing.Optional[str]` — The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
+
+
+
+
+
+-
+
+**sort_code:** `typing.Optional[str]` — The bank's sort code.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.bank_accounts.make_default_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.bank_accounts.make_default_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Counterparts Contacts
+client.counterparts.contacts.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.contacts.get(
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.contacts.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import CounterpartAddress, Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.contacts.create(
+ counterpart_id="counterpart_id",
+ address=CounterpartAddress(
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ ),
+ first_name="Mary",
+ last_name="O'Brien",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**address:** `CounterpartAddress` — The address of a contact person.
+
+
+
+
+
+-
+
+**first_name:** `str` — The first name of a contact person.
+
+
+
+
+
+-
+
+**last_name:** `str` — The last name of a contact person.
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — The email address of a contact person.
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — The phone number of a contact person
+
+
+
+
+
+-
+
+**title:** `typing.Optional[str]` — The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.contacts.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.contacts.get_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**contact_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.contacts.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.contacts.delete_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**contact_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.contacts.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.contacts.update_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**contact_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**address:** `typing.Optional[CounterpartAddress]` — The address of a contact person.
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — The email address of a contact person.
+
+
+
+
+
+-
+
+**first_name:** `typing.Optional[str]` — The first name of a contact person.
+
+
+
+
+
+-
+
+**last_name:** `typing.Optional[str]` — The last name of a contact person.
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — The phone number of a contact person
+
+
+
+
+
+-
+
+**title:** `typing.Optional[str]` — The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.contacts.make_default_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.contacts.make_default_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**contact_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Counterparts VatIds
+client.counterparts.vat_ids.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.vat_ids.get(
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.vat_ids.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.vat_ids.create(
+ counterpart_id="counterpart_id",
+ value="123456789",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**value:** `str`
+
+
+
+
+
+-
+
+**country:** `typing.Optional[AllowedCountries]`
+
+
+
+
+
+-
+
+**type:** `typing.Optional[VatIdTypeEnum]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.vat_ids.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.vat_ids.get_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**vat_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.vat_ids.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.vat_ids.delete_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**vat_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.counterparts.vat_ids.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.counterparts.vat_ids.update_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**vat_id:** `str`
+
+
+
+
+
+-
+
+**counterpart_id:** `str`
+
+
+
+
+
+-
+
+**country:** `typing.Optional[AllowedCountries]`
+
+
+
+
+
+-
+
+**type:** `typing.Optional[VatIdTypeEnum]`
+
+
+
+
+
+-
+
+**value:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## DataExports ExtraData
+client.data_exports.extra_data.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.extra_data.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[ExportSettingCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**created_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**created_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lt:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_gte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**updated_at_lte:** `typing.Optional[dt.datetime]`
+
+
+
+
+
+-
+
+**object_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**field_name:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**field_value:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.data_exports.extra_data.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.extra_data.create(
+ field_name="default_account_code",
+ field_value="field_value",
+ object_id="object_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**field_name:** `SupportedFieldNames`
+
+
+
+
+
+-
+
+**field_value:** `str`
+
+
+
+
+
+-
+
+**object_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.data_exports.extra_data.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.extra_data.get_by_id(
+ extra_data_id="extra_data_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**extra_data_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.data_exports.extra_data.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.extra_data.delete_by_id(
+ extra_data_id="extra_data_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**extra_data_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.data_exports.extra_data.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.data_exports.extra_data.update_by_id(
+ extra_data_id="extra_data_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**extra_data_id:** `str`
+
+
+
+
+
+-
+
+**field_name:** `typing.Optional[SupportedFieldNames]`
+
+
+
+
+
+-
+
+**field_value:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**object_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**object_type:** `typing.Optional[typing.Literal["counterpart"]]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Entities BankAccounts
+client.entities.bank_accounts.get()
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all bank accounts of this entity.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Add a new bank account for the specified entity.
+
+The minimum required fields are `currency` and `country`. Other required fields depend on the currency:
+
+- EUR accounts require `iban`.
+- GBP accounts require `account_holder_name`, `account_number`, and `sort_code`.
+- USD accounts require `account_holder_name`, `account_number`, and `routing_number`.
+- Accounts in other currencies require one of:
+ - `iban`
+ - `account_number` and `sort_code`
+ - `account_number` and `routing_number`
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.create(
+ country="AF",
+ currency="AED",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**country:** `AllowedCountries` — The country in which the bank account is registered, repsesented as a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+
+
+
+
+-
+
+**currency:** `CurrencyEnum` — The currency of the bank account, represented as a three-letter ISO [currency code](https://docs.monite.com/docs/currencies).
+
+
+
+
+
+-
+
+**account_holder_name:** `typing.Optional[str]` — The name of the person or business that owns this bank account. Required if the account currency is GBP or USD.
+
+
+
+
+
+-
+
+**account_number:** `typing.Optional[str]` — The bank account number. Required if the account currency is GBP or USD. UK account numbers typically contain 8 digits. US bank account numbers contain 9 to 12 digits.
+
+
+
+
+
+-
+
+**bank_name:** `typing.Optional[str]` — The bank name.
+
+
+
+
+
+-
+
+**bic:** `typing.Optional[str]` — The SWIFT/BIC code of the bank.
+
+
+
+
+
+-
+
+**display_name:** `typing.Optional[str]` — User-defined name of this bank account, such as 'Primary account' or 'Savings account'.
+
+
+
+
+
+-
+
+**iban:** `typing.Optional[str]` — The IBAN of the bank account. Required if the account currency is EUR.
+
+
+
+
+
+-
+
+**is_default_for_currency:** `typing.Optional[bool]` — If set to `true` or if this is the first bank account added for the given currency, this account becomes the default one for its currency.
+
+
+
+
+
+-
+
+**routing_number:** `typing.Optional[str]` — The bank's routing transit number (RTN). Required if the account currency is USD. US routing numbers consist of 9 digits.
+
+
+
+
+
+-
+
+**sort_code:** `typing.Optional[str]` — The bank's sort code. Required if the account currency is GBP.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.complete_verification(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import (
+ AirwallexMandate,
+ AirwallexPlaidAccount,
+ AirwallexPlaidInstitution,
+ CompleteVerificationAirwallexPlaidRequest,
+ Monite,
+)
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.complete_verification(
+ airwallex_plaid=CompleteVerificationAirwallexPlaidRequest(
+ account=AirwallexPlaidAccount(
+ id="id",
+ mask="mask",
+ name="name",
+ ),
+ institution=AirwallexPlaidInstitution(
+ id="id",
+ name="name",
+ ),
+ mandate=AirwallexMandate(
+ email="email",
+ signatory="signatory",
+ ),
+ public_token="public_token",
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**airwallex_plaid:** `CompleteVerificationAirwallexPlaidRequest`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.start_verification(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Start entity bank account verification. The flow depends on verification type.
+For airwallex_plaid it generates Plaid Link token to init the Plaid SDK.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite, VerificationAirwallexPlaidRequest
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.start_verification(
+ airwallex_plaid=VerificationAirwallexPlaidRequest(
+ client_name="client_name",
+ redirect_url="redirect_url",
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**airwallex_plaid:** `VerificationAirwallexPlaidRequest`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Retrieve a bank account by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.get_by_id(
+ bank_account_id="bank_account_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete the bank account specified by its ID.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.delete_by_id(
+ bank_account_id="bank_account_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Change the specified fields with the provided values.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.update_by_id(
+ bank_account_id="bank_account_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**account_holder_name:** `typing.Optional[str]` — The name of the person or business that owns this bank account. If the account currency is GBP or USD, the holder name cannot be changed to an empty string.
+
+
+
+
+
+-
+
+**display_name:** `typing.Optional[str]` — User-defined name of this bank account, such as 'Primary account' or 'Savings account'.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.complete_verification_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.complete_verification_by_id(
+ bank_account_id="bank_account_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.make_default_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Set a bank account as the default for this entity per currency.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.make_default_by_id(
+ bank_account_id="bank_account_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.refresh_verification_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite, VerificationAirwallexPlaidRequest
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.refresh_verification_by_id(
+ bank_account_id="bank_account_id",
+ airwallex_plaid=VerificationAirwallexPlaidRequest(
+ client_name="client_name",
+ redirect_url="redirect_url",
+ ),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**airwallex_plaid:** `VerificationAirwallexPlaidRequest`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.bank_accounts.get_verifications_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.bank_accounts.get_verifications_by_id(
+ bank_account_id="bank_account_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**bank_account_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Entities OnboardingData
+client.entities.onboarding_data.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.onboarding_data.get(
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.onboarding_data.update(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.onboarding_data.update(
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**business_profile:** `typing.Optional[BusinessProfile]` — Business information about the entity.
+
+
+
+
+
+-
+
+**ownership_declaration:** `typing.Optional[OwnershipDeclaration]` — Used to attest that the beneficial owner information provided is both current and correct.
+
+
+
+
+
+-
+
+**tos_acceptance:** `typing.Optional[TermsOfServiceAcceptance]` — Details on the entity's acceptance of the service agreement.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Entities PaymentMethods
+client.entities.payment_methods.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get all enabled payment methods.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.payment_methods.get(
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.payment_methods.set(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Set which payment methods should be enabled.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.payment_methods.set(
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**payment_methods:** `typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]` — Deprecated. Use payment_methods_receive instead.
+
+
+
+
+
+-
+
+**payment_methods_receive:** `typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]` — Enable payment methods to receive money.
+
+
+
+
+
+-
+
+**payment_methods_send:** `typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]` — Enable payment methods to send money.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Entities VatIds
+client.entities.vat_ids.get(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.vat_ids.get(
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.vat_ids.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.vat_ids.create(
+ entity_id="entity_id",
+ country="AF",
+ value="123456789",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**country:** `AllowedCountries`
+
+
+
+
+
+-
+
+**value:** `str`
+
+
+
+
+
+-
+
+**type:** `typing.Optional[VatIdTypeEnum]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.vat_ids.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.vat_ids.get_by_id(
+ id="id",
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `str`
+
+
+
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.vat_ids.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.vat_ids.delete_by_id(
+ id="id",
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `str`
+
+
+
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.vat_ids.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.vat_ids.update_by_id(
+ id="id",
+ entity_id="entity_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**id:** `str`
+
+
+
+
+
+-
+
+**entity_id:** `str`
+
+
+
+
+
+-
+
+**country:** `typing.Optional[AllowedCountries]`
+
+
+
+
+
+-
+
+**type:** `typing.Optional[VatIdTypeEnum]`
+
+
+
+
+
+-
+
+**value:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Entities Persons
+client.entities.persons.get()
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.persons.get()
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.persons.create(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite, PersonRelationshipRequest
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.persons.create(
+ first_name="first_name",
+ last_name="last_name",
+ email="email",
+ relationship=PersonRelationshipRequest(),
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**first_name:** `str` — The person's first name
+
+
+
+
+
+-
+
+**last_name:** `str` — The person's last name
+
+
+
+
+
+-
+
+**email:** `str` — The person's email address
+
+
+
+
+
+-
+
+**relationship:** `PersonRelationshipRequest` — Describes the person's relationship to the entity
+
+
+
+
+
+-
+
+**address:** `typing.Optional[PersonAddressRequest]` — The person's address
+
+
+
+
+
+-
+
+**date_of_birth:** `typing.Optional[str]` — The person's date of birth
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — The person's phone number
+
+
+
+
+
+-
+
+**id_number:** `typing.Optional[str]` — The person's ID number, as appropriate for their country
+
+
+
+
+
+-
+
+**ssn_last4:** `typing.Optional[str]` — The last four digits of the person's Social Security number
+
+
+
+
+
+-
+
+**citizenship:** `typing.Optional[AllowedCountries]` — Required for persons of US entities. The country of the person's citizenship, as a two-letter country code (ISO 3166-1 alpha-2). In case of dual or multiple citizenship, specify any.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.persons.get_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.persons.get_by_id(
+ person_id="person_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**person_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.persons.delete_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.persons.delete_by_id(
+ person_id="person_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**person_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.persons.update_by_id(...)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.persons.update_by_id(
+ person_id="person_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**person_id:** `str`
+
+
+
+
+
+-
+
+**address:** `typing.Optional[OptionalPersonAddressRequest]` — The person's address
+
+
+
+
+
+-
+
+**date_of_birth:** `typing.Optional[str]` — The person's date of birth
+
+
+
+
+
+-
+
+**first_name:** `typing.Optional[str]` — The person's first name
+
+
+
+
+
+-
+
+**last_name:** `typing.Optional[str]` — The person's last name
+
+
+
+
+
+-
+
+**email:** `typing.Optional[str]` — The person's email address
+
+
+
+
+
+-
+
+**phone:** `typing.Optional[str]` — The person's phone number
+
+
+
+
+
+-
+
+**relationship:** `typing.Optional[OptionalPersonRelationship]` — Describes the person's relationship to the entity
+
+
+
+
+
+-
+
+**id_number:** `typing.Optional[str]` — The person's ID number, as appropriate for their country
+
+
+
+
+
+-
+
+**ssn_last4:** `typing.Optional[str]` — The last four digits of the person's Social Security number
+
+
+
+
+
+-
+
+**citizenship:** `typing.Optional[AllowedCountries]` — Required for persons of US entities. The country of the person's citizenship, as a two-letter country code (ISO 3166-1 alpha-2). In case of dual or multiple citizenship, specify any.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.entities.persons.upload_onboarding_documents(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Provide files for person onboarding verification
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.entities.persons.upload_onboarding_documents(
+ person_id="person_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**person_id:** `str`
+
+
+
+
+
+-
+
+**additional_verification_document_back:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**additional_verification_document_front:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**verification_document_back:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**verification_document_front:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+## Payables LineItems
+client.payables.line_items.get(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get a list of all line items related to a specific payable.
+Related guide: [List all payable line items](https://docs.monite.com/docs/manage-line-items#list-all-line-items-of-a-payable)
+
+See also:
+
+[Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+[Collect payables](https://docs.monite.com/docs/collect-payables)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.line_items.get(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**order:** `typing.Optional[OrderEnum]` — Order by
+
+
+
+
+
+-
+
+**limit:** `typing.Optional[int]` — Max is 100
+
+
+
+
+
+-
+
+**pagination_token:** `typing.Optional[str]` — A token, obtained from previous page. Prior over other filters
+
+
+
+
+
+-
+
+**sort:** `typing.Optional[LineItemCursorFields]` — Allowed sort fields
+
+
+
+
+
+-
+
+**was_created_by_user_id:** `typing.Optional[str]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.line_items.create(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Add a new line item to a specific payable.
+
+The `subtotal` and `total` fields of line items are automatically calculated based on the `unit_price`,
+`quantity`, and `tax` fields, therefore, are read-only and appear only in the response schema. The field
+`ledger_account_id` is required **only** for account integration, otherwise, it is optional.
+
+Related guide: [Add line items to a payable](https://docs.monite.com/docs/manage-line-items#add-line-items-to-a-payable)
+
+See also:
+
+[Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+[Collect payables](https://docs.monite.com/docs/collect-payables)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.line_items.create(
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**accounting_tax_rate_id:** `typing.Optional[str]` — ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — Description of the product.
+
+
+
+
+
+-
+
+**ledger_account_id:** `typing.Optional[str]` — ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — Name of the product.
+
+
+
+
+
+-
+
+**quantity:** `typing.Optional[float]` — The quantity of each of the goods, materials, or services listed in the payable.
+
+
+
+
+
+-
+
+**tax:** `typing.Optional[int]` — VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+
+
+
+
+
+-
+
+**unit:** `typing.Optional[str]` — The unit of the product
+
+
+
+
+
+-
+
+**unit_price:** `typing.Optional[int]` — The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.line_items.replace(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Replaces the information of all line items of a specific payable.
+
+Related guide: [Replace all line items](https://docs.monite.com/docs/manage-line-items#replace-all-line-items)
+
+See also:
+
+[Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+[Collect payables](https://docs.monite.com/docs/collect-payables)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import LineItemInternalRequest, Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.line_items.replace(
+ payable_id="payable_id",
+ data=[LineItemInternalRequest()],
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**data:** `typing.Sequence[LineItemInternalRequest]`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.line_items.get_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Get information about a specific line item with a given ID.
+
+Related guide: [Retrieve a line item](https://docs.monite.com/docs/manage-line-items#retrieve-a-line-item)
+
+See also:
+
+[Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+[Collect payables](https://docs.monite.com/docs/collect-payables)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.line_items.get_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**line_item_id:** `str`
+
+
+
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.line_items.delete_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete the line item with the given ID.
+
+Related guide: [Remove a line item](https://docs.monite.com/docs/manage-line-items#remove-a-line-item)
+
+See also:
+
+[Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+[Collect payables](https://docs.monite.com/docs/collect-payables)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.line_items.delete_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**line_item_id:** `str`
+
+
+
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
+client.payables.line_items.update_by_id(...)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Edits the information of a specific line item.
+
+Related guide: [Update a line item](https://docs.monite.com/docs/manage-line-items#update-a-line-item)
+
+See also:
+
+[Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+[Collect payables](https://docs.monite.com/docs/collect-payables)
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```python
+from monite import Monite
+
+client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+)
+client.payables.line_items.update_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+)
+
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**line_item_id:** `str`
+
+
+
+
+
+-
+
+**payable_id:** `str`
+
+
+
+
+
+-
+
+**accounting_tax_rate_id:** `typing.Optional[str]` — ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+
+
+
+
+
+-
+
+**description:** `typing.Optional[str]` — Description of the product.
+
+
+
+
+
+-
+
+**ledger_account_id:** `typing.Optional[str]` — ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+
+
+
+
+
+-
+
+**name:** `typing.Optional[str]` — Name of the product.
+
+
+
+
+
+-
+
+**quantity:** `typing.Optional[float]` — The quantity of each of the goods, materials, or services listed in the payable.
+
+
+
+
+
+-
+
+**tax:** `typing.Optional[int]` — VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+
+
+
+
+
+-
+
+**unit:** `typing.Optional[str]` — The unit of the product
+
+
+
+
+
+-
+
+**unit_price:** `typing.Optional[int]` — The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+
+
+
+
+-
+
+**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/monite/__init__.py b/src/monite/__init__.py
new file mode 100644
index 0000000..1d6b583
--- /dev/null
+++ b/src/monite/__init__.py
@@ -0,0 +1,1263 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .types import (
+ AccessTokenResponse,
+ AccountDisabledReason,
+ AccountResponse,
+ AccountingConnectionList,
+ AccountingConnectionResponse,
+ AccountingCustomerRefObject,
+ AccountingLineItem,
+ AccountingMessageResponse,
+ AccountingPayable,
+ AccountingPayableDueDate,
+ AccountingPayableList,
+ AccountingPurchaseOrderRef,
+ AccountingReceivable,
+ AccountingReceivableDueDate,
+ AccountingReceivableList,
+ AccountingRefObject,
+ AccountingSettingsPayload,
+ AccountingSettingsResponse,
+ AccountingTaxRateListResponse,
+ AccountingTaxRateResponse,
+ AccountingVendorRefObject,
+ ActionEnum,
+ ActionSchema,
+ AirwallexMandate,
+ AirwallexMandateType,
+ AirwallexMandateVersion,
+ AirwallexPlaidAccount,
+ AirwallexPlaidBankAccountVerificationStatus,
+ AirwallexPlaidInstitution,
+ AirwallexPlaidVerification,
+ AllDocumentExportResponseSchema,
+ AllOverdueRemindersResponse,
+ AllowedCountries,
+ AllowedFileTypes,
+ ApiVersion,
+ ApprovalPolicyCursorFields,
+ ApprovalPolicyResource,
+ ApprovalPolicyResourceList,
+ ApprovalPolicyResourceScriptItem,
+ ApprovalPolicyResourceStatus,
+ ApprovalPolicyResourceTrigger,
+ ApprovalPolicyStatus,
+ ApprovalProcessResourceList,
+ ApprovalProcessStepResource,
+ ApprovalProcessStepResourceList,
+ ApprovalProcessStepStatus,
+ ApprovalRequestCreateByRoleRequest,
+ ApprovalRequestCreateByUserRequest,
+ ApprovalRequestCreateRequest,
+ ApprovalRequestCursorFields,
+ ApprovalRequestResourceList,
+ ApprovalRequestResourceWithMetadata,
+ ApprovalRequestStatus,
+ BankAccount,
+ BankAccountVerificationType,
+ BankAccountVerifications,
+ BasedOnReceivableCreatedEventData,
+ BasedOnTransitionType,
+ BizObjectsSchema,
+ BusinessProfile,
+ ButtonThemePayload,
+ ButtonThemeResponse,
+ CardThemePayload,
+ CardThemeResponse,
+ CommentCursorFields,
+ CommentResource,
+ CommentResourceList,
+ CommonSchema,
+ CompleteRefreshVerificationResponse,
+ CompleteVerificationAirwallexPlaidRequest,
+ CompleteVerificationResponse,
+ ConnectionStatus,
+ CounterpartAddress,
+ CounterpartAddressResourceList,
+ CounterpartAddressResponseWithCounterpartId,
+ CounterpartBankAccountResourceList,
+ CounterpartBankAccountResponse,
+ CounterpartContactResponse,
+ CounterpartContactsResourceList,
+ CounterpartCreatePayload,
+ CounterpartCreatePayload_Individual,
+ CounterpartCreatePayload_Organization,
+ CounterpartCursorFields,
+ CounterpartIndividualCreatePayload,
+ CounterpartIndividualResponse,
+ CounterpartIndividualRootCreatePayload,
+ CounterpartIndividualRootResponse,
+ CounterpartIndividualRootUpdatePayload,
+ CounterpartIndividualUpdatePayload,
+ CounterpartOrganizationCreatePayload,
+ CounterpartOrganizationResponse,
+ CounterpartOrganizationRootCreatePayload,
+ CounterpartOrganizationRootResponse,
+ CounterpartOrganizationRootUpdatePayload,
+ CounterpartOrganizationUpdatePayload,
+ CounterpartPaginationResponse,
+ CounterpartRawAddress,
+ CounterpartRawAddressUpdateRequest,
+ CounterpartRawBankAccount,
+ CounterpartRawBankAccountUpdateRequest,
+ CounterpartRawData,
+ CounterpartRawDataUpdateRequest,
+ CounterpartRawVatId,
+ CounterpartRawVatIdUpdateRequest,
+ CounterpartResponse,
+ CounterpartTagCategory,
+ CounterpartTagSchema,
+ CounterpartType,
+ CounterpartUpdatePayload,
+ CounterpartVatIdResourceList,
+ CounterpartVatIdResponse,
+ CreateExportTaskResponseSchema,
+ CreateOnboardingLinkRequest,
+ CreditNoteResponsePayload,
+ CreditNoteResponsePayloadEntity,
+ CreditNoteResponsePayloadEntity_Individual,
+ CreditNoteResponsePayloadEntity_Organization,
+ CreditNoteStateEnum,
+ CurrencyEnum,
+ CurrencyExchangeSchema,
+ CurrencySettings,
+ CustomTemplateDataSchema,
+ CustomTemplatesCursorFields,
+ CustomTemplatesPaginationResponse,
+ DataExportCursorFields,
+ DayOfMonth,
+ Discount,
+ DiscountType,
+ DnsRecord,
+ DnsRecordPurpose,
+ DnsRecordType,
+ DnsRecords,
+ DocumentExportResponseSchema,
+ DocumentIDsSettings,
+ DocumentIDsSettingsNextNumber,
+ DocumentIDsSettingsRequest,
+ DocumentIdSeparators,
+ DocumentObjectTypeRequestEnum,
+ DocumentTypeEnum,
+ DocumentTypePrefix,
+ DomainListResponse,
+ DomainResponse,
+ DomainResponseDnsRecords,
+ EInvoicingProviderEnum,
+ EInvoicingSettingsPayload,
+ EInvoicingSettingsResponse,
+ EntityAddressResponseSchema,
+ EntityAddressSchema,
+ EntityBankAccountPaginationResponse,
+ EntityBankAccountResponse,
+ EntityBusinessStructure,
+ EntityCursorFields,
+ EntityIndividualResponse,
+ EntityOnboardingDataResponse,
+ EntityOnboardingDocuments,
+ EntityOrganizationResponse,
+ EntityPaginationResponse,
+ EntityResponse,
+ EntityResponse_Individual,
+ EntityResponse_Organization,
+ EntityTypeEnum,
+ EntityUserCursorFields,
+ EntityUserPaginationResponse,
+ EntityUserResponse,
+ EntityVatIdResourceList,
+ EntityVatIdResponse,
+ ErrorSchema,
+ ErrorSchemaResponse,
+ EstimatedMonthlyRevenue,
+ EventCursorFields,
+ EventPaginationResource,
+ EventResource,
+ EventResourceForWebhookClient,
+ ExchangeRate,
+ ExportFormat,
+ ExportObjectSchema,
+ ExportObjectSchema_Payable,
+ ExportObjectSchema_Receivable,
+ ExportPayableSchema,
+ ExportReceivableSchema,
+ ExportSettingCursorFields,
+ ExtraDataResource,
+ ExtraDataResourceList,
+ FileResponse,
+ FileSchema,
+ FileSchema2,
+ FileSchema3,
+ FileSchema4,
+ FilesResponse,
+ GetAllPaymentReminders,
+ GetAllRecurrences,
+ GetOnboardingRequirementsResponse,
+ GrantType,
+ HttpValidationError,
+ IndividualResponseSchema,
+ IndividualSchema,
+ Invoice,
+ InvoiceFile,
+ InvoiceResponsePayload,
+ InvoiceResponsePayloadEntity,
+ InvoiceResponsePayloadEntity_Individual,
+ InvoiceResponsePayloadEntity_Organization,
+ Item,
+ IterationStatus,
+ LabelNValue,
+ LanguageCodeEnum,
+ LedgerAccountCursorFields,
+ LedgerAccountListResponse,
+ LedgerAccountResponse,
+ LineItem,
+ LineItemCursorFields,
+ LineItemInternalRequest,
+ LineItemPaginationResponse,
+ LineItemProduct,
+ LineItemProductCreate,
+ LineItemProductMeasureUnit,
+ LineItemProductVatRate,
+ LineItemRequest,
+ LineItemResponse,
+ LineItemUpdate,
+ LineItemsReplaceResponse,
+ LineItemsResponse,
+ LogMethodEnum,
+ LogResponse,
+ LogResponseBody,
+ LogTypeEnum,
+ LogsResponse,
+ MailSentEventData,
+ MailSettingsPayload,
+ MailSettingsResponse,
+ MailboxDataResponse,
+ MailboxObjectTypeEnum,
+ MailboxResponse,
+ MergedSettingsResponse,
+ MessageResponse,
+ MissingFields,
+ MissingLineItemFields,
+ MoniteAllPaymentMethods,
+ MoniteAllPaymentMethodsTypes,
+ ObjectMatchTypes,
+ ObjectType,
+ ObjectTypeAvailableComment,
+ ObjectTypeEnum,
+ OcrAddress,
+ OcrAutoTaggingSettingsRequest,
+ OcrRecognitionResponse,
+ OcrResponseInvoiceReceiptData,
+ OcrResponseInvoiceReceiptLineItem,
+ OcrResponseInvoiceReceiptLineItemRaw,
+ OcrStatusEnum,
+ OnboardingLinkPublicResponse,
+ OnboardingLinkResponse,
+ OnboardingPaymentMethodsResponse,
+ OnboardingRequirementsError,
+ OnboardingRequirementsResponse,
+ OnboardingVerificationError,
+ OnboardingVerificationStatusEnum,
+ OptionalIndividualSchema,
+ OptionalOrganizationSchema,
+ OptionalPersonAddressRequest,
+ OptionalPersonRelationship,
+ OrderEnum,
+ OrderEnum2,
+ OrderEnum3,
+ OrganizationResponseSchema,
+ OrganizationSchema,
+ OverdueReminderResponse,
+ OverdueReminderTerm,
+ OwnershipDeclaration,
+ PageSchema,
+ PageSchema2,
+ PageSchema3,
+ PageSchema4,
+ PartnerMetadata,
+ PartnerMetadataResponse,
+ PartnerProjectSettingsResponse,
+ PayableActionEnum,
+ PayableActionSchema,
+ PayableAggregatedDataResponse,
+ PayableAggregatedItem,
+ PayableCursorFields,
+ PayableEntityAddressSchema,
+ PayableEntityIndividualResponse,
+ PayableEntityOrganizationResponse,
+ PayableIndividualSchema,
+ PayableOrganizationSchema,
+ PayableOriginEnum,
+ PayablePaginationResponse,
+ PayablePaymentTermDiscount,
+ PayablePaymentTermFinal,
+ PayablePaymentTermsCreatePayload,
+ PayableResponseSchema,
+ PayableResponseSchemaOtherExtractedData,
+ PayableSchema,
+ PayableSettingsPayload,
+ PayableSettingsResponse,
+ PayableStateEnum,
+ PayableTemplatesVariable,
+ PayableTemplatesVariablesObject,
+ PayableTemplatesVariablesObjectList,
+ PayableValidationResponse,
+ PayableValidationsResource,
+ PayablesFieldsAllowedForValidate,
+ PayablesVariableType,
+ PaymentAccountObject,
+ PaymentAccountType,
+ PaymentIntent,
+ PaymentIntentCursorFields,
+ PaymentIntentHistory,
+ PaymentIntentHistoryResponse,
+ PaymentIntentPayoutMethod,
+ PaymentIntentResponse,
+ PaymentIntentsListResponse,
+ PaymentIntentsRecipient,
+ PaymentMethod,
+ PaymentMethodDirection,
+ PaymentMethodRequirements,
+ PaymentMethodStatus,
+ PaymentObject,
+ PaymentObjectPayable,
+ PaymentObjectType,
+ PaymentPageThemePayload,
+ PaymentPageThemeResponse,
+ PaymentPriorityEnum,
+ PaymentReceivedEventData,
+ PaymentRecordCursorFields,
+ PaymentRecordObjectRequest,
+ PaymentRecordObjectResponse,
+ PaymentRecordResponse,
+ PaymentRecordResponseList,
+ PaymentReminderResponse,
+ PaymentRequirements,
+ PaymentTerm,
+ PaymentTermDiscount,
+ PaymentTermDiscountWithDate,
+ PaymentTerms,
+ PaymentTermsListResponse,
+ PaymentTermsResponse,
+ PaymentsBatchPaymentResponse,
+ PaymentsBatchPaymentStatus,
+ PaymentsSettingsPayload,
+ PaymentsSettingsResponse,
+ PermissionEnum,
+ PersonAddressRequest,
+ PersonAddressResponse,
+ PersonOnboardingDocuments,
+ PersonRelationshipRequest,
+ PersonRelationshipResponse,
+ PersonResponse,
+ PersonsResponse,
+ Platform,
+ PreviewSchema,
+ PreviewSchema2,
+ PreviewSchema3,
+ PreviewSchema4,
+ PreviewTemplateResponse,
+ Price,
+ ProcessResource,
+ ProcessResourceScriptSnapshot,
+ ProcessStatusEnum,
+ ProductCursorFields,
+ ProductServicePaginationResponse,
+ ProductServiceResponse,
+ ProductServiceTypeEnum,
+ ProjectCursorFields,
+ ProjectPaginationResponse,
+ ProjectResource,
+ PublicPaymentLinkResponse,
+ PurchaseOrderCounterpartAddressSchema,
+ PurchaseOrderCounterpartIndividualResponse,
+ PurchaseOrderCounterpartIndividualRootResponse,
+ PurchaseOrderCounterpartOrganizationResponse,
+ PurchaseOrderCounterpartOrganizationRootResponse,
+ PurchaseOrderCounterpartSchema,
+ PurchaseOrderCursorFields,
+ PurchaseOrderEmailPreviewResponse,
+ PurchaseOrderEmailSentResponse,
+ PurchaseOrderItem,
+ PurchaseOrderPaginationResponse,
+ PurchaseOrderResponseSchema,
+ PurchaseOrderResponseSchemaEntity,
+ PurchaseOrderStatusEnum,
+ PurchaseOrderVatId,
+ QuoteResponsePayload,
+ QuoteResponsePayloadEntity,
+ QuoteResponsePayloadEntity_Individual,
+ QuoteResponsePayloadEntity_Organization,
+ QuoteStateEnum,
+ ReceivableCounterpartContact,
+ ReceivableCounterpartType,
+ ReceivableCounterpartVatIdResponse,
+ ReceivableCreateBasedOnPayload,
+ ReceivableCursorFields,
+ ReceivableEditFlow,
+ ReceivableEntityAddressSchema,
+ ReceivableEntityBase,
+ ReceivableEntityIndividual,
+ ReceivableEntityIndividualRequest,
+ ReceivableEntityOrganization,
+ ReceivableEntityOrganizationRequest,
+ ReceivableEntityVatIdResponse,
+ ReceivableFacadeCreateInvoicePayload,
+ ReceivableFacadeCreatePayload,
+ ReceivableFacadeCreateQuotePayload,
+ ReceivableFileSchema,
+ ReceivableFileUrl,
+ ReceivableHistoryCursorFields,
+ ReceivableHistoryEventTypeEnum,
+ ReceivableHistoryPaginationResponse,
+ ReceivableHistoryResponse,
+ ReceivableHistoryResponseEventData,
+ ReceivableMailCursorFields,
+ ReceivableMailPaginationResponse,
+ ReceivableMailRecipientState,
+ ReceivableMailRecipients,
+ ReceivableMailResponse,
+ ReceivableMailStatusEnum,
+ ReceivablePageSchema,
+ ReceivablePaginationResponse,
+ ReceivablePreviewResponse,
+ ReceivablePreviewSchema,
+ ReceivableResponse,
+ ReceivableResponse_CreditNote,
+ ReceivableResponse_Invoice,
+ ReceivableResponse_Quote,
+ ReceivableSendResponse,
+ ReceivableSettingsPayload,
+ ReceivableSettingsResponse,
+ ReceivableTemplatesVariable,
+ ReceivableTemplatesVariablesObject,
+ ReceivableTemplatesVariablesObjectList,
+ ReceivableType,
+ ReceivableUpdatePayload,
+ ReceivableUpdatedEventData,
+ ReceivablesPreviewTypeEnum,
+ ReceivablesRemindersWarningMessage,
+ ReceivablesRepresentationOfCounterpartAddress,
+ ReceivablesRepresentationOfEntityBankAccount,
+ ReceivablesSendResponse,
+ ReceivablesStatusEnum,
+ ReceivablesVerifyResponse,
+ Recipient,
+ RecipientAccountResponse,
+ RecipientType,
+ Recipients,
+ Recurrence,
+ RecurrenceIteration,
+ RecurrenceStatus,
+ RelatedDocuments,
+ Reminder,
+ ReminderTypeEnum,
+ RemindersSettings,
+ RequirementsError,
+ ResponseItem,
+ RoleCursorFields,
+ RolePaginationResponse,
+ RoleResponse,
+ RootSchema,
+ RootSchema_ApprovalPolicy,
+ RootSchema_ApprovalRequest,
+ RootSchema_Comment,
+ RootSchema_Counterpart,
+ RootSchema_CounterpartVatId,
+ RootSchema_Entity,
+ RootSchema_EntityBankAccount,
+ RootSchema_EntityUser,
+ RootSchema_EntityVatIds,
+ RootSchema_Export,
+ RootSchema_Onboarding,
+ RootSchema_OverdueReminder,
+ RootSchema_Payable,
+ RootSchema_PayablesPurchaseOrder,
+ RootSchema_PaymentRecord,
+ RootSchema_PaymentReminder,
+ RootSchema_Person,
+ RootSchema_Product,
+ RootSchema_Project,
+ RootSchema_Receivable,
+ RootSchema_Reconciliation,
+ RootSchema_Role,
+ RootSchema_Tag,
+ RootSchema_TodoTask,
+ RootSchema_TodoTaskMute,
+ RootSchema_Transaction,
+ RootSchema_Workflow,
+ ServiceProvidersEnum,
+ Signature,
+ SingleOnboardingRequirementsResponse,
+ SinglePaymentIntent,
+ SinglePaymentIntentResponse,
+ SourceOfPayableDataEnum,
+ StatusChangedEventData,
+ StatusEnum,
+ SuccessResult,
+ SuggestedPaymentTerm,
+ SupportedFieldNames,
+ SupportedFormatSchema,
+ SupportedFormatSchemaObjectType,
+ SyncRecordCursorFields,
+ SyncRecordResource,
+ SyncRecordResourceList,
+ SyncStatus,
+ SystemTemplateDataSchema,
+ SystemTemplates,
+ TagCategory,
+ TagCursorFields,
+ TagReadSchema,
+ TagsPaginationResponse,
+ TaxComponentResponse,
+ TaxRateAccountCursorFields,
+ TemplateDataSchema,
+ TemplateListResponse,
+ TemplateReceivableResponse,
+ TemplateTypeEnum,
+ TermFinalWithDate,
+ TermsOfServiceAcceptance,
+ TextTemplateResponse,
+ TextTemplateResponseList,
+ TextTemplateType,
+ TotalVatAmountItem,
+ Unit,
+ UnitListResponse,
+ UnitRequest,
+ UnitResponse,
+ UpdateCreditNote,
+ UpdateCreditNotePayload,
+ UpdateEntityAddressSchema,
+ UpdateEntityRequest,
+ UpdateInvoice,
+ UpdateInvoicePayload,
+ UpdateIssuedInvoice,
+ UpdateIssuedInvoiceEntity,
+ UpdateIssuedInvoiceEntity_Individual,
+ UpdateIssuedInvoiceEntity_Organization,
+ UpdateIssuedInvoicePayload,
+ UpdateLineItemForCreditNote,
+ UpdateProductForCreditNote,
+ UpdateQuote,
+ UpdateQuotePayload,
+ ValidationError,
+ ValidationErrorLocItem,
+ Variable,
+ VariablesObject,
+ VariablesObjectList,
+ VariablesType,
+ VatIdTypeEnum,
+ VatModeEnum,
+ VatRateCreator,
+ VatRateListResponse,
+ VatRateResponse,
+ VatRateStatusEnum,
+ VerificationAirwallexPlaidRequest,
+ VerificationAirwallexPlaidResponse,
+ VerificationError,
+ VerificationRequest,
+ VerificationResponse,
+ VerificationStatusEnum,
+ VerifyResponse,
+ WebhookDeliveryCursorFields,
+ WebhookDeliveryPaginationResource,
+ WebhookDeliveryResource,
+ WebhookObjectType,
+ WebhookSubscriptionCursorFields,
+ WebhookSubscriptionPaginationResource,
+ WebhookSubscriptionResource,
+ WebhookSubscriptionResourceWithSecret,
+ WebhookSubscriptionStatus,
+)
+from .errors import (
+ BadRequestError,
+ ConflictError,
+ ForbiddenError,
+ InternalServerError,
+ NotAcceptableError,
+ NotFoundError,
+ RangeNotSatisfiableError,
+ UnauthorizedError,
+ UnprocessableEntityError,
+)
+from . import (
+ access_tokens,
+ accounting,
+ approval_policies,
+ approval_requests,
+ audit_logs,
+ batch_payments,
+ comments,
+ counterparts,
+ data_exports,
+ entities,
+ entity_users,
+ events,
+ files,
+ mail_templates,
+ mailbox_domains,
+ mailboxes,
+ measure_units,
+ onboarding_links,
+ overdue_reminders,
+ partner_settings,
+ payables,
+ payment_intents,
+ payment_links,
+ payment_records,
+ payment_reminders,
+ payment_terms,
+ pdf_templates,
+ products,
+ projects,
+ purchase_orders,
+ receivables,
+ recurrences,
+ roles,
+ tags,
+ text_templates,
+ vat_rates,
+ webhook_deliveries,
+ webhook_subscriptions,
+)
+from .approval_policies import (
+ ApprovalPoliciesGetRequestStatus,
+ ApprovalPoliciesGetRequestStatusInItem,
+ ApprovalPolicyCreateScriptItem,
+ ApprovalPolicyCreateTrigger,
+ ApprovalPolicyUpdateScriptItem,
+ ApprovalPolicyUpdateTrigger,
+)
+from .client import AsyncMonite, Monite
+from .environment import MoniteEnvironment
+from .receivables import ReceivablesGetRequestStatus, ReceivablesGetRequestStatusInItem
+from .version import __version__
+
+__all__ = [
+ "AccessTokenResponse",
+ "AccountDisabledReason",
+ "AccountResponse",
+ "AccountingConnectionList",
+ "AccountingConnectionResponse",
+ "AccountingCustomerRefObject",
+ "AccountingLineItem",
+ "AccountingMessageResponse",
+ "AccountingPayable",
+ "AccountingPayableDueDate",
+ "AccountingPayableList",
+ "AccountingPurchaseOrderRef",
+ "AccountingReceivable",
+ "AccountingReceivableDueDate",
+ "AccountingReceivableList",
+ "AccountingRefObject",
+ "AccountingSettingsPayload",
+ "AccountingSettingsResponse",
+ "AccountingTaxRateListResponse",
+ "AccountingTaxRateResponse",
+ "AccountingVendorRefObject",
+ "ActionEnum",
+ "ActionSchema",
+ "AirwallexMandate",
+ "AirwallexMandateType",
+ "AirwallexMandateVersion",
+ "AirwallexPlaidAccount",
+ "AirwallexPlaidBankAccountVerificationStatus",
+ "AirwallexPlaidInstitution",
+ "AirwallexPlaidVerification",
+ "AllDocumentExportResponseSchema",
+ "AllOverdueRemindersResponse",
+ "AllowedCountries",
+ "AllowedFileTypes",
+ "ApiVersion",
+ "ApprovalPoliciesGetRequestStatus",
+ "ApprovalPoliciesGetRequestStatusInItem",
+ "ApprovalPolicyCreateScriptItem",
+ "ApprovalPolicyCreateTrigger",
+ "ApprovalPolicyCursorFields",
+ "ApprovalPolicyResource",
+ "ApprovalPolicyResourceList",
+ "ApprovalPolicyResourceScriptItem",
+ "ApprovalPolicyResourceStatus",
+ "ApprovalPolicyResourceTrigger",
+ "ApprovalPolicyStatus",
+ "ApprovalPolicyUpdateScriptItem",
+ "ApprovalPolicyUpdateTrigger",
+ "ApprovalProcessResourceList",
+ "ApprovalProcessStepResource",
+ "ApprovalProcessStepResourceList",
+ "ApprovalProcessStepStatus",
+ "ApprovalRequestCreateByRoleRequest",
+ "ApprovalRequestCreateByUserRequest",
+ "ApprovalRequestCreateRequest",
+ "ApprovalRequestCursorFields",
+ "ApprovalRequestResourceList",
+ "ApprovalRequestResourceWithMetadata",
+ "ApprovalRequestStatus",
+ "AsyncMonite",
+ "BadRequestError",
+ "BankAccount",
+ "BankAccountVerificationType",
+ "BankAccountVerifications",
+ "BasedOnReceivableCreatedEventData",
+ "BasedOnTransitionType",
+ "BizObjectsSchema",
+ "BusinessProfile",
+ "ButtonThemePayload",
+ "ButtonThemeResponse",
+ "CardThemePayload",
+ "CardThemeResponse",
+ "CommentCursorFields",
+ "CommentResource",
+ "CommentResourceList",
+ "CommonSchema",
+ "CompleteRefreshVerificationResponse",
+ "CompleteVerificationAirwallexPlaidRequest",
+ "CompleteVerificationResponse",
+ "ConflictError",
+ "ConnectionStatus",
+ "CounterpartAddress",
+ "CounterpartAddressResourceList",
+ "CounterpartAddressResponseWithCounterpartId",
+ "CounterpartBankAccountResourceList",
+ "CounterpartBankAccountResponse",
+ "CounterpartContactResponse",
+ "CounterpartContactsResourceList",
+ "CounterpartCreatePayload",
+ "CounterpartCreatePayload_Individual",
+ "CounterpartCreatePayload_Organization",
+ "CounterpartCursorFields",
+ "CounterpartIndividualCreatePayload",
+ "CounterpartIndividualResponse",
+ "CounterpartIndividualRootCreatePayload",
+ "CounterpartIndividualRootResponse",
+ "CounterpartIndividualRootUpdatePayload",
+ "CounterpartIndividualUpdatePayload",
+ "CounterpartOrganizationCreatePayload",
+ "CounterpartOrganizationResponse",
+ "CounterpartOrganizationRootCreatePayload",
+ "CounterpartOrganizationRootResponse",
+ "CounterpartOrganizationRootUpdatePayload",
+ "CounterpartOrganizationUpdatePayload",
+ "CounterpartPaginationResponse",
+ "CounterpartRawAddress",
+ "CounterpartRawAddressUpdateRequest",
+ "CounterpartRawBankAccount",
+ "CounterpartRawBankAccountUpdateRequest",
+ "CounterpartRawData",
+ "CounterpartRawDataUpdateRequest",
+ "CounterpartRawVatId",
+ "CounterpartRawVatIdUpdateRequest",
+ "CounterpartResponse",
+ "CounterpartTagCategory",
+ "CounterpartTagSchema",
+ "CounterpartType",
+ "CounterpartUpdatePayload",
+ "CounterpartVatIdResourceList",
+ "CounterpartVatIdResponse",
+ "CreateExportTaskResponseSchema",
+ "CreateOnboardingLinkRequest",
+ "CreditNoteResponsePayload",
+ "CreditNoteResponsePayloadEntity",
+ "CreditNoteResponsePayloadEntity_Individual",
+ "CreditNoteResponsePayloadEntity_Organization",
+ "CreditNoteStateEnum",
+ "CurrencyEnum",
+ "CurrencyExchangeSchema",
+ "CurrencySettings",
+ "CustomTemplateDataSchema",
+ "CustomTemplatesCursorFields",
+ "CustomTemplatesPaginationResponse",
+ "DataExportCursorFields",
+ "DayOfMonth",
+ "Discount",
+ "DiscountType",
+ "DnsRecord",
+ "DnsRecordPurpose",
+ "DnsRecordType",
+ "DnsRecords",
+ "DocumentExportResponseSchema",
+ "DocumentIDsSettings",
+ "DocumentIDsSettingsNextNumber",
+ "DocumentIDsSettingsRequest",
+ "DocumentIdSeparators",
+ "DocumentObjectTypeRequestEnum",
+ "DocumentTypeEnum",
+ "DocumentTypePrefix",
+ "DomainListResponse",
+ "DomainResponse",
+ "DomainResponseDnsRecords",
+ "EInvoicingProviderEnum",
+ "EInvoicingSettingsPayload",
+ "EInvoicingSettingsResponse",
+ "EntityAddressResponseSchema",
+ "EntityAddressSchema",
+ "EntityBankAccountPaginationResponse",
+ "EntityBankAccountResponse",
+ "EntityBusinessStructure",
+ "EntityCursorFields",
+ "EntityIndividualResponse",
+ "EntityOnboardingDataResponse",
+ "EntityOnboardingDocuments",
+ "EntityOrganizationResponse",
+ "EntityPaginationResponse",
+ "EntityResponse",
+ "EntityResponse_Individual",
+ "EntityResponse_Organization",
+ "EntityTypeEnum",
+ "EntityUserCursorFields",
+ "EntityUserPaginationResponse",
+ "EntityUserResponse",
+ "EntityVatIdResourceList",
+ "EntityVatIdResponse",
+ "ErrorSchema",
+ "ErrorSchemaResponse",
+ "EstimatedMonthlyRevenue",
+ "EventCursorFields",
+ "EventPaginationResource",
+ "EventResource",
+ "EventResourceForWebhookClient",
+ "ExchangeRate",
+ "ExportFormat",
+ "ExportObjectSchema",
+ "ExportObjectSchema_Payable",
+ "ExportObjectSchema_Receivable",
+ "ExportPayableSchema",
+ "ExportReceivableSchema",
+ "ExportSettingCursorFields",
+ "ExtraDataResource",
+ "ExtraDataResourceList",
+ "FileResponse",
+ "FileSchema",
+ "FileSchema2",
+ "FileSchema3",
+ "FileSchema4",
+ "FilesResponse",
+ "ForbiddenError",
+ "GetAllPaymentReminders",
+ "GetAllRecurrences",
+ "GetOnboardingRequirementsResponse",
+ "GrantType",
+ "HttpValidationError",
+ "IndividualResponseSchema",
+ "IndividualSchema",
+ "InternalServerError",
+ "Invoice",
+ "InvoiceFile",
+ "InvoiceResponsePayload",
+ "InvoiceResponsePayloadEntity",
+ "InvoiceResponsePayloadEntity_Individual",
+ "InvoiceResponsePayloadEntity_Organization",
+ "Item",
+ "IterationStatus",
+ "LabelNValue",
+ "LanguageCodeEnum",
+ "LedgerAccountCursorFields",
+ "LedgerAccountListResponse",
+ "LedgerAccountResponse",
+ "LineItem",
+ "LineItemCursorFields",
+ "LineItemInternalRequest",
+ "LineItemPaginationResponse",
+ "LineItemProduct",
+ "LineItemProductCreate",
+ "LineItemProductMeasureUnit",
+ "LineItemProductVatRate",
+ "LineItemRequest",
+ "LineItemResponse",
+ "LineItemUpdate",
+ "LineItemsReplaceResponse",
+ "LineItemsResponse",
+ "LogMethodEnum",
+ "LogResponse",
+ "LogResponseBody",
+ "LogTypeEnum",
+ "LogsResponse",
+ "MailSentEventData",
+ "MailSettingsPayload",
+ "MailSettingsResponse",
+ "MailboxDataResponse",
+ "MailboxObjectTypeEnum",
+ "MailboxResponse",
+ "MergedSettingsResponse",
+ "MessageResponse",
+ "MissingFields",
+ "MissingLineItemFields",
+ "Monite",
+ "MoniteAllPaymentMethods",
+ "MoniteAllPaymentMethodsTypes",
+ "MoniteEnvironment",
+ "NotAcceptableError",
+ "NotFoundError",
+ "ObjectMatchTypes",
+ "ObjectType",
+ "ObjectTypeAvailableComment",
+ "ObjectTypeEnum",
+ "OcrAddress",
+ "OcrAutoTaggingSettingsRequest",
+ "OcrRecognitionResponse",
+ "OcrResponseInvoiceReceiptData",
+ "OcrResponseInvoiceReceiptLineItem",
+ "OcrResponseInvoiceReceiptLineItemRaw",
+ "OcrStatusEnum",
+ "OnboardingLinkPublicResponse",
+ "OnboardingLinkResponse",
+ "OnboardingPaymentMethodsResponse",
+ "OnboardingRequirementsError",
+ "OnboardingRequirementsResponse",
+ "OnboardingVerificationError",
+ "OnboardingVerificationStatusEnum",
+ "OptionalIndividualSchema",
+ "OptionalOrganizationSchema",
+ "OptionalPersonAddressRequest",
+ "OptionalPersonRelationship",
+ "OrderEnum",
+ "OrderEnum2",
+ "OrderEnum3",
+ "OrganizationResponseSchema",
+ "OrganizationSchema",
+ "OverdueReminderResponse",
+ "OverdueReminderTerm",
+ "OwnershipDeclaration",
+ "PageSchema",
+ "PageSchema2",
+ "PageSchema3",
+ "PageSchema4",
+ "PartnerMetadata",
+ "PartnerMetadataResponse",
+ "PartnerProjectSettingsResponse",
+ "PayableActionEnum",
+ "PayableActionSchema",
+ "PayableAggregatedDataResponse",
+ "PayableAggregatedItem",
+ "PayableCursorFields",
+ "PayableEntityAddressSchema",
+ "PayableEntityIndividualResponse",
+ "PayableEntityOrganizationResponse",
+ "PayableIndividualSchema",
+ "PayableOrganizationSchema",
+ "PayableOriginEnum",
+ "PayablePaginationResponse",
+ "PayablePaymentTermDiscount",
+ "PayablePaymentTermFinal",
+ "PayablePaymentTermsCreatePayload",
+ "PayableResponseSchema",
+ "PayableResponseSchemaOtherExtractedData",
+ "PayableSchema",
+ "PayableSettingsPayload",
+ "PayableSettingsResponse",
+ "PayableStateEnum",
+ "PayableTemplatesVariable",
+ "PayableTemplatesVariablesObject",
+ "PayableTemplatesVariablesObjectList",
+ "PayableValidationResponse",
+ "PayableValidationsResource",
+ "PayablesFieldsAllowedForValidate",
+ "PayablesVariableType",
+ "PaymentAccountObject",
+ "PaymentAccountType",
+ "PaymentIntent",
+ "PaymentIntentCursorFields",
+ "PaymentIntentHistory",
+ "PaymentIntentHistoryResponse",
+ "PaymentIntentPayoutMethod",
+ "PaymentIntentResponse",
+ "PaymentIntentsListResponse",
+ "PaymentIntentsRecipient",
+ "PaymentMethod",
+ "PaymentMethodDirection",
+ "PaymentMethodRequirements",
+ "PaymentMethodStatus",
+ "PaymentObject",
+ "PaymentObjectPayable",
+ "PaymentObjectType",
+ "PaymentPageThemePayload",
+ "PaymentPageThemeResponse",
+ "PaymentPriorityEnum",
+ "PaymentReceivedEventData",
+ "PaymentRecordCursorFields",
+ "PaymentRecordObjectRequest",
+ "PaymentRecordObjectResponse",
+ "PaymentRecordResponse",
+ "PaymentRecordResponseList",
+ "PaymentReminderResponse",
+ "PaymentRequirements",
+ "PaymentTerm",
+ "PaymentTermDiscount",
+ "PaymentTermDiscountWithDate",
+ "PaymentTerms",
+ "PaymentTermsListResponse",
+ "PaymentTermsResponse",
+ "PaymentsBatchPaymentResponse",
+ "PaymentsBatchPaymentStatus",
+ "PaymentsSettingsPayload",
+ "PaymentsSettingsResponse",
+ "PermissionEnum",
+ "PersonAddressRequest",
+ "PersonAddressResponse",
+ "PersonOnboardingDocuments",
+ "PersonRelationshipRequest",
+ "PersonRelationshipResponse",
+ "PersonResponse",
+ "PersonsResponse",
+ "Platform",
+ "PreviewSchema",
+ "PreviewSchema2",
+ "PreviewSchema3",
+ "PreviewSchema4",
+ "PreviewTemplateResponse",
+ "Price",
+ "ProcessResource",
+ "ProcessResourceScriptSnapshot",
+ "ProcessStatusEnum",
+ "ProductCursorFields",
+ "ProductServicePaginationResponse",
+ "ProductServiceResponse",
+ "ProductServiceTypeEnum",
+ "ProjectCursorFields",
+ "ProjectPaginationResponse",
+ "ProjectResource",
+ "PublicPaymentLinkResponse",
+ "PurchaseOrderCounterpartAddressSchema",
+ "PurchaseOrderCounterpartIndividualResponse",
+ "PurchaseOrderCounterpartIndividualRootResponse",
+ "PurchaseOrderCounterpartOrganizationResponse",
+ "PurchaseOrderCounterpartOrganizationRootResponse",
+ "PurchaseOrderCounterpartSchema",
+ "PurchaseOrderCursorFields",
+ "PurchaseOrderEmailPreviewResponse",
+ "PurchaseOrderEmailSentResponse",
+ "PurchaseOrderItem",
+ "PurchaseOrderPaginationResponse",
+ "PurchaseOrderResponseSchema",
+ "PurchaseOrderResponseSchemaEntity",
+ "PurchaseOrderStatusEnum",
+ "PurchaseOrderVatId",
+ "QuoteResponsePayload",
+ "QuoteResponsePayloadEntity",
+ "QuoteResponsePayloadEntity_Individual",
+ "QuoteResponsePayloadEntity_Organization",
+ "QuoteStateEnum",
+ "RangeNotSatisfiableError",
+ "ReceivableCounterpartContact",
+ "ReceivableCounterpartType",
+ "ReceivableCounterpartVatIdResponse",
+ "ReceivableCreateBasedOnPayload",
+ "ReceivableCursorFields",
+ "ReceivableEditFlow",
+ "ReceivableEntityAddressSchema",
+ "ReceivableEntityBase",
+ "ReceivableEntityIndividual",
+ "ReceivableEntityIndividualRequest",
+ "ReceivableEntityOrganization",
+ "ReceivableEntityOrganizationRequest",
+ "ReceivableEntityVatIdResponse",
+ "ReceivableFacadeCreateInvoicePayload",
+ "ReceivableFacadeCreatePayload",
+ "ReceivableFacadeCreateQuotePayload",
+ "ReceivableFileSchema",
+ "ReceivableFileUrl",
+ "ReceivableHistoryCursorFields",
+ "ReceivableHistoryEventTypeEnum",
+ "ReceivableHistoryPaginationResponse",
+ "ReceivableHistoryResponse",
+ "ReceivableHistoryResponseEventData",
+ "ReceivableMailCursorFields",
+ "ReceivableMailPaginationResponse",
+ "ReceivableMailRecipientState",
+ "ReceivableMailRecipients",
+ "ReceivableMailResponse",
+ "ReceivableMailStatusEnum",
+ "ReceivablePageSchema",
+ "ReceivablePaginationResponse",
+ "ReceivablePreviewResponse",
+ "ReceivablePreviewSchema",
+ "ReceivableResponse",
+ "ReceivableResponse_CreditNote",
+ "ReceivableResponse_Invoice",
+ "ReceivableResponse_Quote",
+ "ReceivableSendResponse",
+ "ReceivableSettingsPayload",
+ "ReceivableSettingsResponse",
+ "ReceivableTemplatesVariable",
+ "ReceivableTemplatesVariablesObject",
+ "ReceivableTemplatesVariablesObjectList",
+ "ReceivableType",
+ "ReceivableUpdatePayload",
+ "ReceivableUpdatedEventData",
+ "ReceivablesGetRequestStatus",
+ "ReceivablesGetRequestStatusInItem",
+ "ReceivablesPreviewTypeEnum",
+ "ReceivablesRemindersWarningMessage",
+ "ReceivablesRepresentationOfCounterpartAddress",
+ "ReceivablesRepresentationOfEntityBankAccount",
+ "ReceivablesSendResponse",
+ "ReceivablesStatusEnum",
+ "ReceivablesVerifyResponse",
+ "Recipient",
+ "RecipientAccountResponse",
+ "RecipientType",
+ "Recipients",
+ "Recurrence",
+ "RecurrenceIteration",
+ "RecurrenceStatus",
+ "RelatedDocuments",
+ "Reminder",
+ "ReminderTypeEnum",
+ "RemindersSettings",
+ "RequirementsError",
+ "ResponseItem",
+ "RoleCursorFields",
+ "RolePaginationResponse",
+ "RoleResponse",
+ "RootSchema",
+ "RootSchema_ApprovalPolicy",
+ "RootSchema_ApprovalRequest",
+ "RootSchema_Comment",
+ "RootSchema_Counterpart",
+ "RootSchema_CounterpartVatId",
+ "RootSchema_Entity",
+ "RootSchema_EntityBankAccount",
+ "RootSchema_EntityUser",
+ "RootSchema_EntityVatIds",
+ "RootSchema_Export",
+ "RootSchema_Onboarding",
+ "RootSchema_OverdueReminder",
+ "RootSchema_Payable",
+ "RootSchema_PayablesPurchaseOrder",
+ "RootSchema_PaymentRecord",
+ "RootSchema_PaymentReminder",
+ "RootSchema_Person",
+ "RootSchema_Product",
+ "RootSchema_Project",
+ "RootSchema_Receivable",
+ "RootSchema_Reconciliation",
+ "RootSchema_Role",
+ "RootSchema_Tag",
+ "RootSchema_TodoTask",
+ "RootSchema_TodoTaskMute",
+ "RootSchema_Transaction",
+ "RootSchema_Workflow",
+ "ServiceProvidersEnum",
+ "Signature",
+ "SingleOnboardingRequirementsResponse",
+ "SinglePaymentIntent",
+ "SinglePaymentIntentResponse",
+ "SourceOfPayableDataEnum",
+ "StatusChangedEventData",
+ "StatusEnum",
+ "SuccessResult",
+ "SuggestedPaymentTerm",
+ "SupportedFieldNames",
+ "SupportedFormatSchema",
+ "SupportedFormatSchemaObjectType",
+ "SyncRecordCursorFields",
+ "SyncRecordResource",
+ "SyncRecordResourceList",
+ "SyncStatus",
+ "SystemTemplateDataSchema",
+ "SystemTemplates",
+ "TagCategory",
+ "TagCursorFields",
+ "TagReadSchema",
+ "TagsPaginationResponse",
+ "TaxComponentResponse",
+ "TaxRateAccountCursorFields",
+ "TemplateDataSchema",
+ "TemplateListResponse",
+ "TemplateReceivableResponse",
+ "TemplateTypeEnum",
+ "TermFinalWithDate",
+ "TermsOfServiceAcceptance",
+ "TextTemplateResponse",
+ "TextTemplateResponseList",
+ "TextTemplateType",
+ "TotalVatAmountItem",
+ "UnauthorizedError",
+ "Unit",
+ "UnitListResponse",
+ "UnitRequest",
+ "UnitResponse",
+ "UnprocessableEntityError",
+ "UpdateCreditNote",
+ "UpdateCreditNotePayload",
+ "UpdateEntityAddressSchema",
+ "UpdateEntityRequest",
+ "UpdateInvoice",
+ "UpdateInvoicePayload",
+ "UpdateIssuedInvoice",
+ "UpdateIssuedInvoiceEntity",
+ "UpdateIssuedInvoiceEntity_Individual",
+ "UpdateIssuedInvoiceEntity_Organization",
+ "UpdateIssuedInvoicePayload",
+ "UpdateLineItemForCreditNote",
+ "UpdateProductForCreditNote",
+ "UpdateQuote",
+ "UpdateQuotePayload",
+ "ValidationError",
+ "ValidationErrorLocItem",
+ "Variable",
+ "VariablesObject",
+ "VariablesObjectList",
+ "VariablesType",
+ "VatIdTypeEnum",
+ "VatModeEnum",
+ "VatRateCreator",
+ "VatRateListResponse",
+ "VatRateResponse",
+ "VatRateStatusEnum",
+ "VerificationAirwallexPlaidRequest",
+ "VerificationAirwallexPlaidResponse",
+ "VerificationError",
+ "VerificationRequest",
+ "VerificationResponse",
+ "VerificationStatusEnum",
+ "VerifyResponse",
+ "WebhookDeliveryCursorFields",
+ "WebhookDeliveryPaginationResource",
+ "WebhookDeliveryResource",
+ "WebhookObjectType",
+ "WebhookSubscriptionCursorFields",
+ "WebhookSubscriptionPaginationResource",
+ "WebhookSubscriptionResource",
+ "WebhookSubscriptionResourceWithSecret",
+ "WebhookSubscriptionStatus",
+ "__version__",
+ "access_tokens",
+ "accounting",
+ "approval_policies",
+ "approval_requests",
+ "audit_logs",
+ "batch_payments",
+ "comments",
+ "counterparts",
+ "data_exports",
+ "entities",
+ "entity_users",
+ "events",
+ "files",
+ "mail_templates",
+ "mailbox_domains",
+ "mailboxes",
+ "measure_units",
+ "onboarding_links",
+ "overdue_reminders",
+ "partner_settings",
+ "payables",
+ "payment_intents",
+ "payment_links",
+ "payment_records",
+ "payment_reminders",
+ "payment_terms",
+ "pdf_templates",
+ "products",
+ "projects",
+ "purchase_orders",
+ "receivables",
+ "recurrences",
+ "roles",
+ "tags",
+ "text_templates",
+ "vat_rates",
+ "webhook_deliveries",
+ "webhook_subscriptions",
+]
diff --git a/src/monite/access_tokens/__init__.py b/src/monite/access_tokens/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/access_tokens/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/access_tokens/client.py b/src/monite/access_tokens/client.py
new file mode 100644
index 0000000..090689f
--- /dev/null
+++ b/src/monite/access_tokens/client.py
@@ -0,0 +1,412 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.message_response import MessageResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.grant_type import GrantType
+from ..types.access_token_response import AccessTokenResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class AccessTokensClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def revoke(
+ self, *, client_id: str, client_secret: str, token: str, request_options: typing.Optional[RequestOptions] = None
+ ) -> MessageResponse:
+ """
+ Revoke an existing token immediately.
+
+ Parameters
+ ----------
+ client_id : str
+
+ client_secret : str
+
+ token : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MessageResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.access_tokens.revoke(
+ client_id="client_id",
+ client_secret="client_secret",
+ token="token",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "auth/revoke",
+ method="POST",
+ json={
+ "client_id": client_id,
+ "client_secret": client_secret,
+ "token": token,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MessageResponse,
+ parse_obj_as(
+ type_=MessageResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ client_id: str,
+ client_secret: str,
+ grant_type: GrantType,
+ entity_user_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccessTokenResponse:
+ """
+ Create a new access token based on client ID and client secret.
+
+ Parameters
+ ----------
+ client_id : str
+
+ client_secret : str
+
+ grant_type : GrantType
+
+ entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccessTokenResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.access_tokens.create(
+ client_id="client_id",
+ client_secret="client_secret",
+ grant_type="client_credentials",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "auth/token",
+ method="POST",
+ json={
+ "client_id": client_id,
+ "client_secret": client_secret,
+ "entity_user_id": entity_user_id,
+ "grant_type": grant_type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccessTokenResponse,
+ parse_obj_as(
+ type_=AccessTokenResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncAccessTokensClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def revoke(
+ self, *, client_id: str, client_secret: str, token: str, request_options: typing.Optional[RequestOptions] = None
+ ) -> MessageResponse:
+ """
+ Revoke an existing token immediately.
+
+ Parameters
+ ----------
+ client_id : str
+
+ client_secret : str
+
+ token : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MessageResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.access_tokens.revoke(
+ client_id="client_id",
+ client_secret="client_secret",
+ token="token",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "auth/revoke",
+ method="POST",
+ json={
+ "client_id": client_id,
+ "client_secret": client_secret,
+ "token": token,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MessageResponse,
+ parse_obj_as(
+ type_=MessageResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ client_id: str,
+ client_secret: str,
+ grant_type: GrantType,
+ entity_user_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccessTokenResponse:
+ """
+ Create a new access token based on client ID and client secret.
+
+ Parameters
+ ----------
+ client_id : str
+
+ client_secret : str
+
+ grant_type : GrantType
+
+ entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccessTokenResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.access_tokens.create(
+ client_id="client_id",
+ client_secret="client_secret",
+ grant_type="client_credentials",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "auth/token",
+ method="POST",
+ json={
+ "client_id": client_id,
+ "client_secret": client_secret,
+ "entity_user_id": entity_user_id,
+ "grant_type": grant_type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccessTokenResponse,
+ parse_obj_as(
+ type_=AccessTokenResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/accounting/__init__.py b/src/monite/accounting/__init__.py
new file mode 100644
index 0000000..31cf012
--- /dev/null
+++ b/src/monite/accounting/__init__.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from . import connections, ledger_accounts, payables, receivables, synced_records, tax_rates
+
+__all__ = ["connections", "ledger_accounts", "payables", "receivables", "synced_records", "tax_rates"]
diff --git a/src/monite/accounting/client.py b/src/monite/accounting/client.py
new file mode 100644
index 0000000..d3f2398
--- /dev/null
+++ b/src/monite/accounting/client.py
@@ -0,0 +1,38 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.client_wrapper import SyncClientWrapper
+from .payables.client import PayablesClient
+from .receivables.client import ReceivablesClient
+from .connections.client import ConnectionsClient
+from .synced_records.client import SyncedRecordsClient
+from .tax_rates.client import TaxRatesClient
+from .ledger_accounts.client import LedgerAccountsClient
+from ..core.client_wrapper import AsyncClientWrapper
+from .payables.client import AsyncPayablesClient
+from .receivables.client import AsyncReceivablesClient
+from .connections.client import AsyncConnectionsClient
+from .synced_records.client import AsyncSyncedRecordsClient
+from .tax_rates.client import AsyncTaxRatesClient
+from .ledger_accounts.client import AsyncLedgerAccountsClient
+
+
+class AccountingClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.payables = PayablesClient(client_wrapper=self._client_wrapper)
+ self.receivables = ReceivablesClient(client_wrapper=self._client_wrapper)
+ self.connections = ConnectionsClient(client_wrapper=self._client_wrapper)
+ self.synced_records = SyncedRecordsClient(client_wrapper=self._client_wrapper)
+ self.tax_rates = TaxRatesClient(client_wrapper=self._client_wrapper)
+ self.ledger_accounts = LedgerAccountsClient(client_wrapper=self._client_wrapper)
+
+
+class AsyncAccountingClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.payables = AsyncPayablesClient(client_wrapper=self._client_wrapper)
+ self.receivables = AsyncReceivablesClient(client_wrapper=self._client_wrapper)
+ self.connections = AsyncConnectionsClient(client_wrapper=self._client_wrapper)
+ self.synced_records = AsyncSyncedRecordsClient(client_wrapper=self._client_wrapper)
+ self.tax_rates = AsyncTaxRatesClient(client_wrapper=self._client_wrapper)
+ self.ledger_accounts = AsyncLedgerAccountsClient(client_wrapper=self._client_wrapper)
diff --git a/src/monite/accounting/connections/__init__.py b/src/monite/accounting/connections/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/accounting/connections/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/accounting/connections/client.py b/src/monite/accounting/connections/client.py
new file mode 100644
index 0000000..116d657
--- /dev/null
+++ b/src/monite/accounting/connections/client.py
@@ -0,0 +1,759 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.accounting_connection_list import AccountingConnectionList
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.platform import Platform
+from ...types.accounting_connection_response import AccountingConnectionResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...types.accounting_message_response import AccountingMessageResponse
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ConnectionsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AccountingConnectionList:
+ """
+ Get all connections
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.connections.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "accounting_connections",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionList,
+ parse_obj_as(
+ type_=AccountingConnectionList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self, *, platform: typing.Optional[Platform] = OMIT, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingConnectionResponse:
+ """
+ Create new connection
+
+ Parameters
+ ----------
+ platform : typing.Optional[Platform]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.connections.create()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "accounting_connections",
+ method="POST",
+ json={
+ "platform": platform,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionResponse,
+ parse_obj_as(
+ type_=AccountingConnectionResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, connection_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingConnectionResponse:
+ """
+ Get connection by id
+
+ Parameters
+ ----------
+ connection_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.connections.get_by_id(
+ connection_id="connection_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting_connections/{jsonable_encoder(connection_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionResponse,
+ parse_obj_as(
+ type_=AccountingConnectionResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def disconnect_by_id(
+ self, connection_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingConnectionResponse:
+ """
+ Disconnect
+
+ Parameters
+ ----------
+ connection_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.connections.disconnect_by_id(
+ connection_id="connection_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting_connections/{jsonable_encoder(connection_id)}/disconnect",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionResponse,
+ parse_obj_as(
+ type_=AccountingConnectionResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def sync_by_id(
+ self, connection_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingMessageResponse:
+ """
+ Parameters
+ ----------
+ connection_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingMessageResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.connections.sync_by_id(
+ connection_id="connection_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting_connections/{jsonable_encoder(connection_id)}/sync",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingMessageResponse,
+ parse_obj_as(
+ type_=AccountingMessageResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncConnectionsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AccountingConnectionList:
+ """
+ Get all connections
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.connections.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "accounting_connections",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionList,
+ parse_obj_as(
+ type_=AccountingConnectionList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self, *, platform: typing.Optional[Platform] = OMIT, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingConnectionResponse:
+ """
+ Create new connection
+
+ Parameters
+ ----------
+ platform : typing.Optional[Platform]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.connections.create()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "accounting_connections",
+ method="POST",
+ json={
+ "platform": platform,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionResponse,
+ parse_obj_as(
+ type_=AccountingConnectionResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, connection_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingConnectionResponse:
+ """
+ Get connection by id
+
+ Parameters
+ ----------
+ connection_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.connections.get_by_id(
+ connection_id="connection_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting_connections/{jsonable_encoder(connection_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionResponse,
+ parse_obj_as(
+ type_=AccountingConnectionResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def disconnect_by_id(
+ self, connection_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingConnectionResponse:
+ """
+ Disconnect
+
+ Parameters
+ ----------
+ connection_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingConnectionResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.connections.disconnect_by_id(
+ connection_id="connection_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting_connections/{jsonable_encoder(connection_id)}/disconnect",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingConnectionResponse,
+ parse_obj_as(
+ type_=AccountingConnectionResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def sync_by_id(
+ self, connection_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingMessageResponse:
+ """
+ Parameters
+ ----------
+ connection_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingMessageResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.connections.sync_by_id(
+ connection_id="connection_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting_connections/{jsonable_encoder(connection_id)}/sync",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingMessageResponse,
+ parse_obj_as(
+ type_=AccountingMessageResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/accounting/ledger_accounts/__init__.py b/src/monite/accounting/ledger_accounts/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/accounting/ledger_accounts/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/accounting/ledger_accounts/client.py b/src/monite/accounting/ledger_accounts/client.py
new file mode 100644
index 0000000..4b10d87
--- /dev/null
+++ b/src/monite/accounting/ledger_accounts/client.py
@@ -0,0 +1,364 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ...core.client_wrapper import SyncClientWrapper
+import typing
+from ...types.order_enum import OrderEnum
+from ...types.ledger_account_cursor_fields import LedgerAccountCursorFields
+from ...core.request_options import RequestOptions
+from ...types.ledger_account_list_response import LedgerAccountListResponse
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.ledger_account_response import LedgerAccountResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.client_wrapper import AsyncClientWrapper
+
+
+class LedgerAccountsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[LedgerAccountCursorFields] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LedgerAccountListResponse:
+ """
+ Get all ledger accounts
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[LedgerAccountCursorFields]
+ Allowed sort fields
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LedgerAccountListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.ledger_accounts.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "ledger_accounts",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LedgerAccountListResponse,
+ parse_obj_as(
+ type_=LedgerAccountListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, ledger_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> LedgerAccountResponse:
+ """
+ Get ledger account by id
+
+ Parameters
+ ----------
+ ledger_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LedgerAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.ledger_accounts.get_by_id(
+ ledger_account_id="ledger_account_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"ledger_accounts/{jsonable_encoder(ledger_account_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LedgerAccountResponse,
+ parse_obj_as(
+ type_=LedgerAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncLedgerAccountsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[LedgerAccountCursorFields] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LedgerAccountListResponse:
+ """
+ Get all ledger accounts
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[LedgerAccountCursorFields]
+ Allowed sort fields
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LedgerAccountListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.ledger_accounts.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "ledger_accounts",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LedgerAccountListResponse,
+ parse_obj_as(
+ type_=LedgerAccountListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, ledger_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> LedgerAccountResponse:
+ """
+ Get ledger account by id
+
+ Parameters
+ ----------
+ ledger_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LedgerAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.ledger_accounts.get_by_id(
+ ledger_account_id="ledger_account_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"ledger_accounts/{jsonable_encoder(ledger_account_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LedgerAccountResponse,
+ parse_obj_as(
+ type_=LedgerAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/accounting/payables/__init__.py b/src/monite/accounting/payables/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/accounting/payables/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/accounting/payables/client.py b/src/monite/accounting/payables/client.py
new file mode 100644
index 0000000..525d279
--- /dev/null
+++ b/src/monite/accounting/payables/client.py
@@ -0,0 +1,352 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ...core.client_wrapper import SyncClientWrapper
+import typing
+from ...core.request_options import RequestOptions
+from ...types.accounting_payable_list import AccountingPayableList
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.accounting_payable import AccountingPayable
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.client_wrapper import AsyncClientWrapper
+
+
+class PayablesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccountingPayableList:
+ """
+ Returns a list of accounts payable invoices (bills) that exist in the entity's accounting system. This requires that an accounting connection has been previously established. Refer to the [Accounting integration guide](https://docs.monite.com/accounting/integration/index) for details.
+
+ This endpoint only provides read-only access to the accounting system's data but does not pull those payables into Monite. You can use it to review the data in the accounting system and find out which of those payables already exist or do not exist in Monite.
+
+ Data is actual as of the date and time of the last accounting synchronization, which is specified by the `last_pull` value in the response from `GET /accounting_connections/{connection_id}`. To make sure you are accessing the most up-to-date accounting data, you can use `POST /accounting_connections/{connection_id}/sync` to trigger on-demand synchronization before getting the list of payables.
+
+ Parameters
+ ----------
+ limit : typing.Optional[int]
+ Number of results per page.
+
+ offset : typing.Optional[int]
+ Number of results to skip before selecting items to return.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingPayableList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.payables.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "accounting/payables",
+ method="GET",
+ params={
+ "limit": limit,
+ "offset": offset,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingPayableList,
+ parse_obj_as(
+ type_=AccountingPayableList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingPayable:
+ """
+ Returns information about an individual payable invoice (bill) that exists in the entity's accounting system. This payable may or may not also exist in Monite.
+
+ Parameters
+ ----------
+ payable_id : str
+ An internal ID of the payable invoice (bill) in the accounting system. You can get these IDs from `GET /accounting/payables`.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingPayable
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.payables.get_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting/payables/{jsonable_encoder(payable_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingPayable,
+ parse_obj_as(
+ type_=AccountingPayable, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPayablesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccountingPayableList:
+ """
+ Returns a list of accounts payable invoices (bills) that exist in the entity's accounting system. This requires that an accounting connection has been previously established. Refer to the [Accounting integration guide](https://docs.monite.com/accounting/integration/index) for details.
+
+ This endpoint only provides read-only access to the accounting system's data but does not pull those payables into Monite. You can use it to review the data in the accounting system and find out which of those payables already exist or do not exist in Monite.
+
+ Data is actual as of the date and time of the last accounting synchronization, which is specified by the `last_pull` value in the response from `GET /accounting_connections/{connection_id}`. To make sure you are accessing the most up-to-date accounting data, you can use `POST /accounting_connections/{connection_id}/sync` to trigger on-demand synchronization before getting the list of payables.
+
+ Parameters
+ ----------
+ limit : typing.Optional[int]
+ Number of results per page.
+
+ offset : typing.Optional[int]
+ Number of results to skip before selecting items to return.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingPayableList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.payables.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "accounting/payables",
+ method="GET",
+ params={
+ "limit": limit,
+ "offset": offset,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingPayableList,
+ parse_obj_as(
+ type_=AccountingPayableList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingPayable:
+ """
+ Returns information about an individual payable invoice (bill) that exists in the entity's accounting system. This payable may or may not also exist in Monite.
+
+ Parameters
+ ----------
+ payable_id : str
+ An internal ID of the payable invoice (bill) in the accounting system. You can get these IDs from `GET /accounting/payables`.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingPayable
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.payables.get_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting/payables/{jsonable_encoder(payable_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingPayable,
+ parse_obj_as(
+ type_=AccountingPayable, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/accounting/receivables/__init__.py b/src/monite/accounting/receivables/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/accounting/receivables/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/accounting/receivables/client.py b/src/monite/accounting/receivables/client.py
new file mode 100644
index 0000000..a103973
--- /dev/null
+++ b/src/monite/accounting/receivables/client.py
@@ -0,0 +1,352 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ...core.client_wrapper import SyncClientWrapper
+import typing
+from ...core.request_options import RequestOptions
+from ...types.accounting_receivable_list import AccountingReceivableList
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.accounting_receivable import AccountingReceivable
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.client_wrapper import AsyncClientWrapper
+
+
+class ReceivablesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccountingReceivableList:
+ """
+ Returns a list of invoices that exist in the entity's accounting system. This requires that an accounting connection has been previously established. Refer to the [Accounting integration guide](https://docs.monite.com/accounting/integration/index) for details.
+
+ This endpoint only provides read-only access to the accounting system's data but does not pull those invoices into Monite. You can use it to review the data in the accounting system and find out which of those invoices already exist or do not exist in Monite.
+
+ Data is actual as of the date and time of the last accounting synchronization, which is specified by the `last_pull` value in the response from `GET /accounting_connections/{connection_id}`. To make sure you are accessing the most up-to-date accounting data, you can use `POST /accounting_connections/{connection_id}/sync` to trigger on-demand synchronization before getting the invoice list.
+
+ Parameters
+ ----------
+ limit : typing.Optional[int]
+ Number of results per page.
+
+ offset : typing.Optional[int]
+ Number of results to skip before selecting items to return.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingReceivableList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.receivables.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "accounting/receivables",
+ method="GET",
+ params={
+ "limit": limit,
+ "offset": offset,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingReceivableList,
+ parse_obj_as(
+ type_=AccountingReceivableList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, invoice_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingReceivable:
+ """
+ Returns information about an individual invoice that exists in the entity's accounting system. This invoice may or may not also exist in Monite.
+
+ Parameters
+ ----------
+ invoice_id : str
+ An internal ID of the invoice in the accounting system. You can get these IDs from `GET /accounting/receivables`.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingReceivable
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.receivables.get_by_id(
+ invoice_id="invoice_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting/receivables/{jsonable_encoder(invoice_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingReceivable,
+ parse_obj_as(
+ type_=AccountingReceivable, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncReceivablesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ limit: typing.Optional[int] = None,
+ offset: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccountingReceivableList:
+ """
+ Returns a list of invoices that exist in the entity's accounting system. This requires that an accounting connection has been previously established. Refer to the [Accounting integration guide](https://docs.monite.com/accounting/integration/index) for details.
+
+ This endpoint only provides read-only access to the accounting system's data but does not pull those invoices into Monite. You can use it to review the data in the accounting system and find out which of those invoices already exist or do not exist in Monite.
+
+ Data is actual as of the date and time of the last accounting synchronization, which is specified by the `last_pull` value in the response from `GET /accounting_connections/{connection_id}`. To make sure you are accessing the most up-to-date accounting data, you can use `POST /accounting_connections/{connection_id}/sync` to trigger on-demand synchronization before getting the invoice list.
+
+ Parameters
+ ----------
+ limit : typing.Optional[int]
+ Number of results per page.
+
+ offset : typing.Optional[int]
+ Number of results to skip before selecting items to return.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingReceivableList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.receivables.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "accounting/receivables",
+ method="GET",
+ params={
+ "limit": limit,
+ "offset": offset,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingReceivableList,
+ parse_obj_as(
+ type_=AccountingReceivableList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, invoice_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingReceivable:
+ """
+ Returns information about an individual invoice that exists in the entity's accounting system. This invoice may or may not also exist in Monite.
+
+ Parameters
+ ----------
+ invoice_id : str
+ An internal ID of the invoice in the accounting system. You can get these IDs from `GET /accounting/receivables`.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingReceivable
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.receivables.get_by_id(
+ invoice_id="invoice_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting/receivables/{jsonable_encoder(invoice_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingReceivable,
+ parse_obj_as(
+ type_=AccountingReceivable, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/accounting/synced_records/__init__.py b/src/monite/accounting/synced_records/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/accounting/synced_records/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/accounting/synced_records/client.py b/src/monite/accounting/synced_records/client.py
new file mode 100644
index 0000000..c1ee082
--- /dev/null
+++ b/src/monite/accounting/synced_records/client.py
@@ -0,0 +1,607 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ...core.client_wrapper import SyncClientWrapper
+from ...types.object_match_types import ObjectMatchTypes
+import typing
+from ...types.order_enum import OrderEnum
+from ...types.sync_record_cursor_fields import SyncRecordCursorFields
+import datetime as dt
+from ...core.request_options import RequestOptions
+from ...types.sync_record_resource_list import SyncRecordResourceList
+from ...core.datetime_utils import serialize_datetime
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.sync_record_resource import SyncRecordResource
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.client_wrapper import AsyncClientWrapper
+
+
+class SyncedRecordsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ object_type: ObjectMatchTypes,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[SyncRecordCursorFields] = None,
+ object_id: typing.Optional[str] = None,
+ object_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> SyncRecordResourceList:
+ """
+ Get synchronized records
+
+ Parameters
+ ----------
+ object_type : ObjectMatchTypes
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[SyncRecordCursorFields]
+ Allowed sort fields
+
+ object_id : typing.Optional[str]
+
+ object_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SyncRecordResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.synced_records.get(
+ object_type="product",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "accounting_synced_records",
+ method="GET",
+ params={
+ "object_type": object_type,
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_id": object_id,
+ "object_id__in": object_id_in,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SyncRecordResourceList,
+ parse_obj_as(
+ type_=SyncRecordResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, synced_record_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> SyncRecordResource:
+ """
+ Get synchronized record by id
+
+ Parameters
+ ----------
+ synced_record_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SyncRecordResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.synced_records.get_by_id(
+ synced_record_id="synced_record_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting_synced_records/{jsonable_encoder(synced_record_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SyncRecordResource,
+ parse_obj_as(
+ type_=SyncRecordResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def push_by_id(
+ self, synced_record_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> SyncRecordResource:
+ """
+ Push object to the accounting system manually
+
+ Parameters
+ ----------
+ synced_record_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SyncRecordResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.synced_records.push_by_id(
+ synced_record_id="synced_record_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting_synced_records/{jsonable_encoder(synced_record_id)}/push",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SyncRecordResource,
+ parse_obj_as(
+ type_=SyncRecordResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncSyncedRecordsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ object_type: ObjectMatchTypes,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[SyncRecordCursorFields] = None,
+ object_id: typing.Optional[str] = None,
+ object_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> SyncRecordResourceList:
+ """
+ Get synchronized records
+
+ Parameters
+ ----------
+ object_type : ObjectMatchTypes
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[SyncRecordCursorFields]
+ Allowed sort fields
+
+ object_id : typing.Optional[str]
+
+ object_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SyncRecordResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.synced_records.get(
+ object_type="product",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "accounting_synced_records",
+ method="GET",
+ params={
+ "object_type": object_type,
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_id": object_id,
+ "object_id__in": object_id_in,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SyncRecordResourceList,
+ parse_obj_as(
+ type_=SyncRecordResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, synced_record_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> SyncRecordResource:
+ """
+ Get synchronized record by id
+
+ Parameters
+ ----------
+ synced_record_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SyncRecordResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.synced_records.get_by_id(
+ synced_record_id="synced_record_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting_synced_records/{jsonable_encoder(synced_record_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SyncRecordResource,
+ parse_obj_as(
+ type_=SyncRecordResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def push_by_id(
+ self, synced_record_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> SyncRecordResource:
+ """
+ Push object to the accounting system manually
+
+ Parameters
+ ----------
+ synced_record_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SyncRecordResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.synced_records.push_by_id(
+ synced_record_id="synced_record_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting_synced_records/{jsonable_encoder(synced_record_id)}/push",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SyncRecordResource,
+ parse_obj_as(
+ type_=SyncRecordResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/accounting/tax_rates/__init__.py b/src/monite/accounting/tax_rates/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/accounting/tax_rates/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/accounting/tax_rates/client.py b/src/monite/accounting/tax_rates/client.py
new file mode 100644
index 0000000..940b1fc
--- /dev/null
+++ b/src/monite/accounting/tax_rates/client.py
@@ -0,0 +1,364 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ...core.client_wrapper import SyncClientWrapper
+import typing
+from ...types.order_enum import OrderEnum
+from ...types.tax_rate_account_cursor_fields import TaxRateAccountCursorFields
+from ...core.request_options import RequestOptions
+from ...types.accounting_tax_rate_list_response import AccountingTaxRateListResponse
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.accounting_tax_rate_response import AccountingTaxRateResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.client_wrapper import AsyncClientWrapper
+
+
+class TaxRatesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[TaxRateAccountCursorFields] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccountingTaxRateListResponse:
+ """
+ Get all tax rate accounts
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[TaxRateAccountCursorFields]
+ Allowed sort fields
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingTaxRateListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.tax_rates.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "accounting_tax_rates",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingTaxRateListResponse,
+ parse_obj_as(
+ type_=AccountingTaxRateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, tax_rate_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingTaxRateResponse:
+ """
+ Get tax rate account by id
+
+ Parameters
+ ----------
+ tax_rate_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingTaxRateResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.accounting.tax_rates.get_by_id(
+ tax_rate_id="tax_rate_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"accounting_tax_rates/{jsonable_encoder(tax_rate_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingTaxRateResponse,
+ parse_obj_as(
+ type_=AccountingTaxRateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncTaxRatesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[TaxRateAccountCursorFields] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AccountingTaxRateListResponse:
+ """
+ Get all tax rate accounts
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[TaxRateAccountCursorFields]
+ Allowed sort fields
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingTaxRateListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.tax_rates.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "accounting_tax_rates",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingTaxRateListResponse,
+ parse_obj_as(
+ type_=AccountingTaxRateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, tax_rate_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> AccountingTaxRateResponse:
+ """
+ Get tax rate account by id
+
+ Parameters
+ ----------
+ tax_rate_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AccountingTaxRateResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.accounting.tax_rates.get_by_id(
+ tax_rate_id="tax_rate_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"accounting_tax_rates/{jsonable_encoder(tax_rate_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AccountingTaxRateResponse,
+ parse_obj_as(
+ type_=AccountingTaxRateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/approval_policies/__init__.py b/src/monite/approval_policies/__init__.py
new file mode 100644
index 0000000..235a5d5
--- /dev/null
+++ b/src/monite/approval_policies/__init__.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .types import (
+ ApprovalPoliciesGetRequestStatus,
+ ApprovalPoliciesGetRequestStatusInItem,
+ ApprovalPolicyCreateScriptItem,
+ ApprovalPolicyCreateTrigger,
+ ApprovalPolicyUpdateScriptItem,
+ ApprovalPolicyUpdateTrigger,
+)
+from . import processes
+
+__all__ = [
+ "ApprovalPoliciesGetRequestStatus",
+ "ApprovalPoliciesGetRequestStatusInItem",
+ "ApprovalPolicyCreateScriptItem",
+ "ApprovalPolicyCreateTrigger",
+ "ApprovalPolicyUpdateScriptItem",
+ "ApprovalPolicyUpdateTrigger",
+ "processes",
+]
diff --git a/src/monite/approval_policies/client.py b/src/monite/approval_policies/client.py
new file mode 100644
index 0000000..667a3ca
--- /dev/null
+++ b/src/monite/approval_policies/client.py
@@ -0,0 +1,1369 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from .processes.client import ProcessesClient
+from ..types.order_enum import OrderEnum
+from ..types.approval_policy_cursor_fields import ApprovalPolicyCursorFields
+from .types.approval_policies_get_request_status import ApprovalPoliciesGetRequestStatus
+from .types.approval_policies_get_request_status_in_item import ApprovalPoliciesGetRequestStatusInItem
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.approval_policy_resource_list import ApprovalPolicyResourceList
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unauthorized_error import UnauthorizedError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.conflict_error import ConflictError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from .types.approval_policy_create_script_item import ApprovalPolicyCreateScriptItem
+from .types.approval_policy_create_trigger import ApprovalPolicyCreateTrigger
+from ..types.approval_policy_resource import ApprovalPolicyResource
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..errors.bad_request_error import BadRequestError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.not_found_error import NotFoundError
+from .types.approval_policy_update_script_item import ApprovalPolicyUpdateScriptItem
+from .types.approval_policy_update_trigger import ApprovalPolicyUpdateTrigger
+from ..types.approval_policy_status import ApprovalPolicyStatus
+from ..core.client_wrapper import AsyncClientWrapper
+from .processes.client import AsyncProcessesClient
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ApprovalPoliciesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.processes = ProcessesClient(client_wrapper=self._client_wrapper)
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ApprovalPolicyCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ status: typing.Optional[ApprovalPoliciesGetRequestStatus] = None,
+ status_in: typing.Optional[
+ typing.Union[
+ ApprovalPoliciesGetRequestStatusInItem, typing.Sequence[ApprovalPoliciesGetRequestStatusInItem]
+ ]
+ ] = None,
+ name: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_ncontains: typing.Optional[str] = None,
+ created_by: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalPolicyResourceList:
+ """
+ Retrieve a list of all approval policies with pagination.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ApprovalPolicyCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ status : typing.Optional[ApprovalPoliciesGetRequestStatus]
+
+ status_in : typing.Optional[typing.Union[ApprovalPoliciesGetRequestStatusInItem, typing.Sequence[ApprovalPoliciesGetRequestStatusInItem]]]
+
+ name : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_ncontains : typing.Optional[str]
+
+ created_by : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "approval_policies",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "status": status,
+ "status__in": status_in,
+ "name": name,
+ "name__contains": name_contains,
+ "name__ncontains": name_ncontains,
+ "created_by": created_by,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResourceList,
+ parse_obj_as(
+ type_=ApprovalPolicyResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ description: str,
+ script: typing.Sequence[ApprovalPolicyCreateScriptItem],
+ trigger: typing.Optional[ApprovalPolicyCreateTrigger] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalPolicyResource:
+ """
+ Create a new approval policy.
+
+ Parameters
+ ----------
+ name : str
+ The name of the approval policy.
+
+ description : str
+ A brief description of the approval policy.
+
+ script : typing.Sequence[ApprovalPolicyCreateScriptItem]
+ A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
+
+ trigger : typing.Optional[ApprovalPolicyCreateTrigger]
+ A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.create(
+ name="name",
+ description="description",
+ script=[True],
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "approval_policies",
+ method="POST",
+ json={
+ "name": name,
+ "description": description,
+ "script": convert_and_respect_annotation_metadata(
+ object_=script, annotation=typing.Sequence[ApprovalPolicyCreateScriptItem], direction="write"
+ ),
+ "trigger": convert_and_respect_annotation_metadata(
+ object_=trigger, annotation=ApprovalPolicyCreateTrigger, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResource,
+ parse_obj_as(
+ type_=ApprovalPolicyResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, approval_policy_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalPolicyResource:
+ """
+ Retrieve a specific approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.get_by_id(
+ approval_policy_id="approval_policy_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResource,
+ parse_obj_as(
+ type_=ApprovalPolicyResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, approval_policy_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete an existing approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.delete_by_id(
+ approval_policy_id="approval_policy_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ approval_policy_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ script: typing.Optional[typing.Sequence[ApprovalPolicyUpdateScriptItem]] = OMIT,
+ trigger: typing.Optional[ApprovalPolicyUpdateTrigger] = OMIT,
+ status: typing.Optional[ApprovalPolicyStatus] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalPolicyResource:
+ """
+ Update an existing approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ name : typing.Optional[str]
+ The name of the approval policy.
+
+ description : typing.Optional[str]
+ A brief description of the approval policy.
+
+ script : typing.Optional[typing.Sequence[ApprovalPolicyUpdateScriptItem]]
+ A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
+
+ trigger : typing.Optional[ApprovalPolicyUpdateTrigger]
+ A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
+
+ status : typing.Optional[ApprovalPolicyStatus]
+ A string that represents the current status of the approval policy.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.update_by_id(
+ approval_policy_id="approval_policy_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "description": description,
+ "script": convert_and_respect_annotation_metadata(
+ object_=script, annotation=typing.Sequence[ApprovalPolicyUpdateScriptItem], direction="write"
+ ),
+ "trigger": convert_and_respect_annotation_metadata(
+ object_=trigger, annotation=ApprovalPolicyUpdateTrigger, direction="write"
+ ),
+ "status": status,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResource,
+ parse_obj_as(
+ type_=ApprovalPolicyResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncApprovalPoliciesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.processes = AsyncProcessesClient(client_wrapper=self._client_wrapper)
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ApprovalPolicyCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ status: typing.Optional[ApprovalPoliciesGetRequestStatus] = None,
+ status_in: typing.Optional[
+ typing.Union[
+ ApprovalPoliciesGetRequestStatusInItem, typing.Sequence[ApprovalPoliciesGetRequestStatusInItem]
+ ]
+ ] = None,
+ name: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_ncontains: typing.Optional[str] = None,
+ created_by: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalPolicyResourceList:
+ """
+ Retrieve a list of all approval policies with pagination.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ApprovalPolicyCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ status : typing.Optional[ApprovalPoliciesGetRequestStatus]
+
+ status_in : typing.Optional[typing.Union[ApprovalPoliciesGetRequestStatusInItem, typing.Sequence[ApprovalPoliciesGetRequestStatusInItem]]]
+
+ name : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_ncontains : typing.Optional[str]
+
+ created_by : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "approval_policies",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "status": status,
+ "status__in": status_in,
+ "name": name,
+ "name__contains": name_contains,
+ "name__ncontains": name_ncontains,
+ "created_by": created_by,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResourceList,
+ parse_obj_as(
+ type_=ApprovalPolicyResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ description: str,
+ script: typing.Sequence[ApprovalPolicyCreateScriptItem],
+ trigger: typing.Optional[ApprovalPolicyCreateTrigger] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalPolicyResource:
+ """
+ Create a new approval policy.
+
+ Parameters
+ ----------
+ name : str
+ The name of the approval policy.
+
+ description : str
+ A brief description of the approval policy.
+
+ script : typing.Sequence[ApprovalPolicyCreateScriptItem]
+ A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
+
+ trigger : typing.Optional[ApprovalPolicyCreateTrigger]
+ A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.create(
+ name="name",
+ description="description",
+ script=[True],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "approval_policies",
+ method="POST",
+ json={
+ "name": name,
+ "description": description,
+ "script": convert_and_respect_annotation_metadata(
+ object_=script, annotation=typing.Sequence[ApprovalPolicyCreateScriptItem], direction="write"
+ ),
+ "trigger": convert_and_respect_annotation_metadata(
+ object_=trigger, annotation=ApprovalPolicyCreateTrigger, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResource,
+ parse_obj_as(
+ type_=ApprovalPolicyResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, approval_policy_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalPolicyResource:
+ """
+ Retrieve a specific approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.get_by_id(
+ approval_policy_id="approval_policy_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResource,
+ parse_obj_as(
+ type_=ApprovalPolicyResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, approval_policy_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Delete an existing approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.delete_by_id(
+ approval_policy_id="approval_policy_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ approval_policy_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ script: typing.Optional[typing.Sequence[ApprovalPolicyUpdateScriptItem]] = OMIT,
+ trigger: typing.Optional[ApprovalPolicyUpdateTrigger] = OMIT,
+ status: typing.Optional[ApprovalPolicyStatus] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalPolicyResource:
+ """
+ Update an existing approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ name : typing.Optional[str]
+ The name of the approval policy.
+
+ description : typing.Optional[str]
+ A brief description of the approval policy.
+
+ script : typing.Optional[typing.Sequence[ApprovalPolicyUpdateScriptItem]]
+ A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
+
+ trigger : typing.Optional[ApprovalPolicyUpdateTrigger]
+ A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
+
+ status : typing.Optional[ApprovalPolicyStatus]
+ A string that represents the current status of the approval policy.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalPolicyResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.update_by_id(
+ approval_policy_id="approval_policy_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "description": description,
+ "script": convert_and_respect_annotation_metadata(
+ object_=script, annotation=typing.Sequence[ApprovalPolicyUpdateScriptItem], direction="write"
+ ),
+ "trigger": convert_and_respect_annotation_metadata(
+ object_=trigger, annotation=ApprovalPolicyUpdateTrigger, direction="write"
+ ),
+ "status": status,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalPolicyResource,
+ parse_obj_as(
+ type_=ApprovalPolicyResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/approval_policies/processes/__init__.py b/src/monite/approval_policies/processes/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/approval_policies/processes/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/approval_policies/processes/client.py b/src/monite/approval_policies/processes/client.py
new file mode 100644
index 0000000..5bc9785
--- /dev/null
+++ b/src/monite/approval_policies/processes/client.py
@@ -0,0 +1,880 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ...core.client_wrapper import SyncClientWrapper
+import typing
+from ...core.request_options import RequestOptions
+from ...types.approval_process_resource_list import ApprovalProcessResourceList
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unauthorized_error import UnauthorizedError
+from ...types.error_schema_response import ErrorSchemaResponse
+from ...errors.not_found_error import NotFoundError
+from ...errors.conflict_error import ConflictError
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.process_resource import ProcessResource
+from ...types.approval_process_step_resource_list import ApprovalProcessStepResourceList
+from ...core.client_wrapper import AsyncClientWrapper
+
+
+class ProcessesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, approval_policy_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalProcessResourceList:
+ """
+ Retrieve a list of all approval policy processes.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalProcessResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.processes.get(
+ approval_policy_id="approval_policy_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalProcessResourceList,
+ parse_obj_as(
+ type_=ApprovalProcessResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, approval_policy_id: str, process_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ProcessResource:
+ """
+ Retrieve a specific approval policy process.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ process_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProcessResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.processes.get_by_id(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes/{jsonable_encoder(process_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProcessResource,
+ parse_obj_as(
+ type_=ProcessResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def cancel_by_id(
+ self, approval_policy_id: str, process_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ProcessResource:
+ """
+ Cancel an ongoing approval process for a specific approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ process_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProcessResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.processes.cancel_by_id(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes/{jsonable_encoder(process_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProcessResource,
+ parse_obj_as(
+ type_=ProcessResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_steps(
+ self, approval_policy_id: str, process_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalProcessStepResourceList:
+ """
+ Retrieve a list of approval policy process steps.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ process_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalProcessStepResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_policies.processes.get_steps(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes/{jsonable_encoder(process_id)}/steps",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalProcessStepResourceList,
+ parse_obj_as(
+ type_=ApprovalProcessStepResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncProcessesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, approval_policy_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalProcessResourceList:
+ """
+ Retrieve a list of all approval policy processes.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalProcessResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.processes.get(
+ approval_policy_id="approval_policy_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalProcessResourceList,
+ parse_obj_as(
+ type_=ApprovalProcessResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, approval_policy_id: str, process_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ProcessResource:
+ """
+ Retrieve a specific approval policy process.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ process_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProcessResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.processes.get_by_id(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes/{jsonable_encoder(process_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProcessResource,
+ parse_obj_as(
+ type_=ProcessResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def cancel_by_id(
+ self, approval_policy_id: str, process_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ProcessResource:
+ """
+ Cancel an ongoing approval process for a specific approval policy.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ process_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProcessResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.processes.cancel_by_id(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes/{jsonable_encoder(process_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProcessResource,
+ parse_obj_as(
+ type_=ProcessResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_steps(
+ self, approval_policy_id: str, process_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalProcessStepResourceList:
+ """
+ Retrieve a list of approval policy process steps.
+
+ Parameters
+ ----------
+ approval_policy_id : str
+
+ process_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalProcessStepResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_policies.processes.get_steps(
+ approval_policy_id="approval_policy_id",
+ process_id="process_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_policies/{jsonable_encoder(approval_policy_id)}/processes/{jsonable_encoder(process_id)}/steps",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalProcessStepResourceList,
+ parse_obj_as(
+ type_=ApprovalProcessStepResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/approval_policies/types/__init__.py b/src/monite/approval_policies/types/__init__.py
new file mode 100644
index 0000000..98cab70
--- /dev/null
+++ b/src/monite/approval_policies/types/__init__.py
@@ -0,0 +1,17 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .approval_policies_get_request_status import ApprovalPoliciesGetRequestStatus
+from .approval_policies_get_request_status_in_item import ApprovalPoliciesGetRequestStatusInItem
+from .approval_policy_create_script_item import ApprovalPolicyCreateScriptItem
+from .approval_policy_create_trigger import ApprovalPolicyCreateTrigger
+from .approval_policy_update_script_item import ApprovalPolicyUpdateScriptItem
+from .approval_policy_update_trigger import ApprovalPolicyUpdateTrigger
+
+__all__ = [
+ "ApprovalPoliciesGetRequestStatus",
+ "ApprovalPoliciesGetRequestStatusInItem",
+ "ApprovalPolicyCreateScriptItem",
+ "ApprovalPolicyCreateTrigger",
+ "ApprovalPolicyUpdateScriptItem",
+ "ApprovalPolicyUpdateTrigger",
+]
diff --git a/src/monite/approval_policies/types/approval_policies_get_request_status.py b/src/monite/approval_policies/types/approval_policies_get_request_status.py
new file mode 100644
index 0000000..b374ad9
--- /dev/null
+++ b/src/monite/approval_policies/types/approval_policies_get_request_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPoliciesGetRequestStatus = typing.Union[typing.Literal["active", "pending"], typing.Any]
diff --git a/src/monite/approval_policies/types/approval_policies_get_request_status_in_item.py b/src/monite/approval_policies/types/approval_policies_get_request_status_in_item.py
new file mode 100644
index 0000000..d24e096
--- /dev/null
+++ b/src/monite/approval_policies/types/approval_policies_get_request_status_in_item.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPoliciesGetRequestStatusInItem = typing.Union[typing.Literal["active", "pending"], typing.Any]
diff --git a/src/monite/approval_policies/types/approval_policy_create_script_item.py b/src/monite/approval_policies/types/approval_policy_create_script_item.py
new file mode 100644
index 0000000..e4a438a
--- /dev/null
+++ b/src/monite/approval_policies/types/approval_policy_create_script_item.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyCreateScriptItem = typing.Union[
+ bool, float, str, typing.List[typing.Optional[typing.Any]], typing.Dict[str, typing.Optional[typing.Any]]
+]
diff --git a/src/monite/approval_policies/types/approval_policy_create_trigger.py b/src/monite/approval_policies/types/approval_policy_create_trigger.py
new file mode 100644
index 0000000..5440271
--- /dev/null
+++ b/src/monite/approval_policies/types/approval_policy_create_trigger.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyCreateTrigger = typing.Union[
+ bool, float, str, typing.List[typing.Optional[typing.Any]], typing.Dict[str, typing.Optional[typing.Any]]
+]
diff --git a/src/monite/approval_policies/types/approval_policy_update_script_item.py b/src/monite/approval_policies/types/approval_policy_update_script_item.py
new file mode 100644
index 0000000..284ccd2
--- /dev/null
+++ b/src/monite/approval_policies/types/approval_policy_update_script_item.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyUpdateScriptItem = typing.Union[
+ bool, float, str, typing.List[typing.Optional[typing.Any]], typing.Dict[str, typing.Optional[typing.Any]]
+]
diff --git a/src/monite/approval_policies/types/approval_policy_update_trigger.py b/src/monite/approval_policies/types/approval_policy_update_trigger.py
new file mode 100644
index 0000000..ef31eb0
--- /dev/null
+++ b/src/monite/approval_policies/types/approval_policy_update_trigger.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyUpdateTrigger = typing.Union[
+ bool, float, str, typing.List[typing.Optional[typing.Any]], typing.Dict[str, typing.Optional[typing.Any]]
+]
diff --git a/src/monite/approval_requests/__init__.py b/src/monite/approval_requests/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/approval_requests/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/approval_requests/client.py b/src/monite/approval_requests/client.py
new file mode 100644
index 0000000..dd1019b
--- /dev/null
+++ b/src/monite/approval_requests/client.py
@@ -0,0 +1,1681 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.approval_request_cursor_fields import ApprovalRequestCursorFields
+import datetime as dt
+from ..types.approval_request_status import ApprovalRequestStatus
+from ..types.object_type import ObjectType
+from ..core.request_options import RequestOptions
+from ..types.approval_request_resource_list import ApprovalRequestResourceList
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.approval_request_create_request import ApprovalRequestCreateRequest
+from ..types.approval_request_resource_with_metadata import ApprovalRequestResourceWithMetadata
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..errors.not_found_error import NotFoundError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.conflict_error import ConflictError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ApprovalRequestsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ApprovalRequestCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ object_id: typing.Optional[str] = None,
+ object_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ status: typing.Optional[ApprovalRequestStatus] = None,
+ status_in: typing.Optional[typing.Union[ApprovalRequestStatus, typing.Sequence[ApprovalRequestStatus]]] = None,
+ user_id: typing.Optional[str] = None,
+ role_id: typing.Optional[str] = None,
+ object_type: typing.Optional[ObjectType] = None,
+ object_type_in: typing.Optional[typing.Union[ObjectType, typing.Sequence[ObjectType]]] = None,
+ created_by: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalRequestResourceList:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ApprovalRequestCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ object_id : typing.Optional[str]
+
+ object_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ status : typing.Optional[ApprovalRequestStatus]
+
+ status_in : typing.Optional[typing.Union[ApprovalRequestStatus, typing.Sequence[ApprovalRequestStatus]]]
+
+ user_id : typing.Optional[str]
+
+ role_id : typing.Optional[str]
+
+ object_type : typing.Optional[ObjectType]
+
+ object_type_in : typing.Optional[typing.Union[ObjectType, typing.Sequence[ObjectType]]]
+
+ created_by : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_requests.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "approval_requests",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ "object_id": object_id,
+ "object_id__in": object_id_in,
+ "status": status,
+ "status__in": status_in,
+ "user_id": user_id,
+ "role_id": role_id,
+ "object_type": object_type,
+ "object_type__in": object_type_in,
+ "created_by": created_by,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceList,
+ parse_obj_as(
+ type_=ApprovalRequestResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self, *, request: ApprovalRequestCreateRequest, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ request : ApprovalRequestCreateRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ from monite import ApprovalRequestCreateByRoleRequest, Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_requests.create(
+ request=ApprovalRequestCreateByRoleRequest(
+ object_id="object_id",
+ object_type="account",
+ required_approval_count=1,
+ role_ids=["role_ids"],
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "approval_requests",
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ApprovalRequestCreateRequest, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_requests.get_by_id(
+ approval_request_id="approval_request_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def approve_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_requests.approve_by_id(
+ approval_request_id="approval_request_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}/approve",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def cancel_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_requests.cancel_by_id(
+ approval_request_id="approval_request_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def reject_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.approval_requests.reject_by_id(
+ approval_request_id="approval_request_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}/reject",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncApprovalRequestsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ApprovalRequestCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ object_id: typing.Optional[str] = None,
+ object_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ status: typing.Optional[ApprovalRequestStatus] = None,
+ status_in: typing.Optional[typing.Union[ApprovalRequestStatus, typing.Sequence[ApprovalRequestStatus]]] = None,
+ user_id: typing.Optional[str] = None,
+ role_id: typing.Optional[str] = None,
+ object_type: typing.Optional[ObjectType] = None,
+ object_type_in: typing.Optional[typing.Union[ObjectType, typing.Sequence[ObjectType]]] = None,
+ created_by: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ApprovalRequestResourceList:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ApprovalRequestCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ object_id : typing.Optional[str]
+
+ object_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ status : typing.Optional[ApprovalRequestStatus]
+
+ status_in : typing.Optional[typing.Union[ApprovalRequestStatus, typing.Sequence[ApprovalRequestStatus]]]
+
+ user_id : typing.Optional[str]
+
+ role_id : typing.Optional[str]
+
+ object_type : typing.Optional[ObjectType]
+
+ object_type_in : typing.Optional[typing.Union[ObjectType, typing.Sequence[ObjectType]]]
+
+ created_by : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_requests.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "approval_requests",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ "object_id": object_id,
+ "object_id__in": object_id_in,
+ "status": status,
+ "status__in": status_in,
+ "user_id": user_id,
+ "role_id": role_id,
+ "object_type": object_type,
+ "object_type__in": object_type_in,
+ "created_by": created_by,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceList,
+ parse_obj_as(
+ type_=ApprovalRequestResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self, *, request: ApprovalRequestCreateRequest, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ request : ApprovalRequestCreateRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import ApprovalRequestCreateByRoleRequest, AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_requests.create(
+ request=ApprovalRequestCreateByRoleRequest(
+ object_id="object_id",
+ object_type="account",
+ required_approval_count=1,
+ role_ids=["role_ids"],
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "approval_requests",
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ApprovalRequestCreateRequest, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_requests.get_by_id(
+ approval_request_id="approval_request_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def approve_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_requests.approve_by_id(
+ approval_request_id="approval_request_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}/approve",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def cancel_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_requests.cancel_by_id(
+ approval_request_id="approval_request_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def reject_by_id(
+ self, approval_request_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ApprovalRequestResourceWithMetadata:
+ """
+ Parameters
+ ----------
+ approval_request_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ApprovalRequestResourceWithMetadata
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.approval_requests.reject_by_id(
+ approval_request_id="approval_request_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"approval_requests/{jsonable_encoder(approval_request_id)}/reject",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ApprovalRequestResourceWithMetadata,
+ parse_obj_as(
+ type_=ApprovalRequestResourceWithMetadata, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/audit_logs/__init__.py b/src/monite/audit_logs/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/audit_logs/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/audit_logs/client.py b/src/monite/audit_logs/client.py
new file mode 100644
index 0000000..526ebfa
--- /dev/null
+++ b/src/monite/audit_logs/client.py
@@ -0,0 +1,410 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.client_wrapper import SyncClientWrapper
+import typing
+from ..types.log_type_enum import LogTypeEnum
+from ..types.log_method_enum import LogMethodEnum
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.logs_response import LogsResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.log_response import LogResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+
+class AuditLogsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ pagination_token: typing.Optional[str] = None,
+ entity_user_id: typing.Optional[str] = None,
+ path_contains: typing.Optional[str] = None,
+ type: typing.Optional[LogTypeEnum] = None,
+ method: typing.Optional[LogMethodEnum] = None,
+ status_code: typing.Optional[int] = None,
+ timestamp_gt: typing.Optional[dt.datetime] = None,
+ timestamp_lt: typing.Optional[dt.datetime] = None,
+ timestamp_gte: typing.Optional[dt.datetime] = None,
+ timestamp_lte: typing.Optional[dt.datetime] = None,
+ page_size: typing.Optional[int] = None,
+ page_num: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LogsResponse:
+ """
+ Parameters
+ ----------
+ pagination_token : typing.Optional[str]
+
+ entity_user_id : typing.Optional[str]
+
+ path_contains : typing.Optional[str]
+
+ type : typing.Optional[LogTypeEnum]
+
+ method : typing.Optional[LogMethodEnum]
+
+ status_code : typing.Optional[int]
+
+ timestamp_gt : typing.Optional[dt.datetime]
+
+ timestamp_lt : typing.Optional[dt.datetime]
+
+ timestamp_gte : typing.Optional[dt.datetime]
+
+ timestamp_lte : typing.Optional[dt.datetime]
+
+ page_size : typing.Optional[int]
+
+ page_num : typing.Optional[int]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LogsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.audit_logs.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "audit_logs",
+ method="GET",
+ params={
+ "pagination_token": pagination_token,
+ "entity_user_id": entity_user_id,
+ "path__contains": path_contains,
+ "type": type,
+ "method": method,
+ "status_code": status_code,
+ "timestamp__gt": serialize_datetime(timestamp_gt) if timestamp_gt is not None else None,
+ "timestamp__lt": serialize_datetime(timestamp_lt) if timestamp_lt is not None else None,
+ "timestamp__gte": serialize_datetime(timestamp_gte) if timestamp_gte is not None else None,
+ "timestamp__lte": serialize_datetime(timestamp_lte) if timestamp_lte is not None else None,
+ "page_size": page_size,
+ "page_num": page_num,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LogsResponse,
+ parse_obj_as(
+ type_=LogsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, log_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> LogResponse:
+ """
+ Parameters
+ ----------
+ log_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LogResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.audit_logs.get_by_id(
+ log_id="log_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"audit_logs/{jsonable_encoder(log_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LogResponse,
+ parse_obj_as(
+ type_=LogResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncAuditLogsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ pagination_token: typing.Optional[str] = None,
+ entity_user_id: typing.Optional[str] = None,
+ path_contains: typing.Optional[str] = None,
+ type: typing.Optional[LogTypeEnum] = None,
+ method: typing.Optional[LogMethodEnum] = None,
+ status_code: typing.Optional[int] = None,
+ timestamp_gt: typing.Optional[dt.datetime] = None,
+ timestamp_lt: typing.Optional[dt.datetime] = None,
+ timestamp_gte: typing.Optional[dt.datetime] = None,
+ timestamp_lte: typing.Optional[dt.datetime] = None,
+ page_size: typing.Optional[int] = None,
+ page_num: typing.Optional[int] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LogsResponse:
+ """
+ Parameters
+ ----------
+ pagination_token : typing.Optional[str]
+
+ entity_user_id : typing.Optional[str]
+
+ path_contains : typing.Optional[str]
+
+ type : typing.Optional[LogTypeEnum]
+
+ method : typing.Optional[LogMethodEnum]
+
+ status_code : typing.Optional[int]
+
+ timestamp_gt : typing.Optional[dt.datetime]
+
+ timestamp_lt : typing.Optional[dt.datetime]
+
+ timestamp_gte : typing.Optional[dt.datetime]
+
+ timestamp_lte : typing.Optional[dt.datetime]
+
+ page_size : typing.Optional[int]
+
+ page_num : typing.Optional[int]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LogsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.audit_logs.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "audit_logs",
+ method="GET",
+ params={
+ "pagination_token": pagination_token,
+ "entity_user_id": entity_user_id,
+ "path__contains": path_contains,
+ "type": type,
+ "method": method,
+ "status_code": status_code,
+ "timestamp__gt": serialize_datetime(timestamp_gt) if timestamp_gt is not None else None,
+ "timestamp__lt": serialize_datetime(timestamp_lt) if timestamp_lt is not None else None,
+ "timestamp__gte": serialize_datetime(timestamp_gte) if timestamp_gte is not None else None,
+ "timestamp__lte": serialize_datetime(timestamp_lte) if timestamp_lte is not None else None,
+ "page_size": page_size,
+ "page_num": page_num,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LogsResponse,
+ parse_obj_as(
+ type_=LogsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(self, log_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> LogResponse:
+ """
+ Parameters
+ ----------
+ log_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LogResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.audit_logs.get_by_id(
+ log_id="log_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"audit_logs/{jsonable_encoder(log_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LogResponse,
+ parse_obj_as(
+ type_=LogResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/batch_payments/__init__.py b/src/monite/batch_payments/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/batch_payments/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/batch_payments/client.py b/src/monite/batch_payments/client.py
new file mode 100644
index 0000000..e1861d1
--- /dev/null
+++ b/src/monite/batch_payments/client.py
@@ -0,0 +1,376 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.single_payment_intent import SinglePaymentIntent
+from ..core.request_options import RequestOptions
+from ..types.payments_batch_payment_response import PaymentsBatchPaymentResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class BatchPaymentsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def create(
+ self,
+ *,
+ payer_bank_account_id: str,
+ payment_intents: typing.Sequence[SinglePaymentIntent],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentsBatchPaymentResponse:
+ """
+ Parameters
+ ----------
+ payer_bank_account_id : str
+
+ payment_intents : typing.Sequence[SinglePaymentIntent]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentsBatchPaymentResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import (
+ Monite,
+ PaymentIntentsRecipient,
+ PaymentObjectPayable,
+ SinglePaymentIntent,
+ )
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.batch_payments.create(
+ payer_bank_account_id="payer_bank_account_id",
+ payment_intents=[
+ SinglePaymentIntent(
+ object=PaymentObjectPayable(
+ id="id",
+ ),
+ recipient=PaymentIntentsRecipient(
+ id="id",
+ ),
+ )
+ ],
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "batch_payments",
+ method="POST",
+ json={
+ "payer_bank_account_id": payer_bank_account_id,
+ "payment_intents": convert_and_respect_annotation_metadata(
+ object_=payment_intents, annotation=typing.Sequence[SinglePaymentIntent], direction="write"
+ ),
+ "payment_method": "us_ach",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentsBatchPaymentResponse,
+ parse_obj_as(
+ type_=PaymentsBatchPaymentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, batch_payment_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentsBatchPaymentResponse:
+ """
+ Parameters
+ ----------
+ batch_payment_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentsBatchPaymentResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.batch_payments.get_by_id(
+ batch_payment_id="batch_payment_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"batch_payments/{jsonable_encoder(batch_payment_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentsBatchPaymentResponse,
+ parse_obj_as(
+ type_=PaymentsBatchPaymentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncBatchPaymentsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def create(
+ self,
+ *,
+ payer_bank_account_id: str,
+ payment_intents: typing.Sequence[SinglePaymentIntent],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentsBatchPaymentResponse:
+ """
+ Parameters
+ ----------
+ payer_bank_account_id : str
+
+ payment_intents : typing.Sequence[SinglePaymentIntent]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentsBatchPaymentResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import (
+ AsyncMonite,
+ PaymentIntentsRecipient,
+ PaymentObjectPayable,
+ SinglePaymentIntent,
+ )
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.batch_payments.create(
+ payer_bank_account_id="payer_bank_account_id",
+ payment_intents=[
+ SinglePaymentIntent(
+ object=PaymentObjectPayable(
+ id="id",
+ ),
+ recipient=PaymentIntentsRecipient(
+ id="id",
+ ),
+ )
+ ],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "batch_payments",
+ method="POST",
+ json={
+ "payer_bank_account_id": payer_bank_account_id,
+ "payment_intents": convert_and_respect_annotation_metadata(
+ object_=payment_intents, annotation=typing.Sequence[SinglePaymentIntent], direction="write"
+ ),
+ "payment_method": "us_ach",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentsBatchPaymentResponse,
+ parse_obj_as(
+ type_=PaymentsBatchPaymentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, batch_payment_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentsBatchPaymentResponse:
+ """
+ Parameters
+ ----------
+ batch_payment_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentsBatchPaymentResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.batch_payments.get_by_id(
+ batch_payment_id="batch_payment_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"batch_payments/{jsonable_encoder(batch_payment_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentsBatchPaymentResponse,
+ parse_obj_as(
+ type_=PaymentsBatchPaymentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/client.py b/src/monite/client.py
new file mode 100644
index 0000000..078b9b5
--- /dev/null
+++ b/src/monite/client.py
@@ -0,0 +1,304 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .environment import MoniteEnvironment
+import httpx
+from .core.client_wrapper import SyncClientWrapper
+from .approval_policies.client import ApprovalPoliciesClient
+from .approval_requests.client import ApprovalRequestsClient
+from .audit_logs.client import AuditLogsClient
+from .access_tokens.client import AccessTokensClient
+from .batch_payments.client import BatchPaymentsClient
+from .comments.client import CommentsClient
+from .counterparts.client import CounterpartsClient
+from .data_exports.client import DataExportsClient
+from .pdf_templates.client import PdfTemplatesClient
+from .entities.client import EntitiesClient
+from .entity_users.client import EntityUsersClient
+from .events.client import EventsClient
+from .files.client import FilesClient
+from .mail_templates.client import MailTemplatesClient
+from .mailbox_domains.client import MailboxDomainsClient
+from .mailboxes.client import MailboxesClient
+from .measure_units.client import MeasureUnitsClient
+from .onboarding_links.client import OnboardingLinksClient
+from .overdue_reminders.client import OverdueRemindersClient
+from .purchase_orders.client import PurchaseOrdersClient
+from .payables.client import PayablesClient
+from .payment_intents.client import PaymentIntentsClient
+from .payment_links.client import PaymentLinksClient
+from .payment_records.client import PaymentRecordsClient
+from .payment_reminders.client import PaymentRemindersClient
+from .payment_terms.client import PaymentTermsClient
+from .products.client import ProductsClient
+from .projects.client import ProjectsClient
+from .receivables.client import ReceivablesClient
+from .recurrences.client import RecurrencesClient
+from .roles.client import RolesClient
+from .partner_settings.client import PartnerSettingsClient
+from .tags.client import TagsClient
+from .text_templates.client import TextTemplatesClient
+from .vat_rates.client import VatRatesClient
+from .webhook_deliveries.client import WebhookDeliveriesClient
+from .webhook_subscriptions.client import WebhookSubscriptionsClient
+from .accounting.client import AccountingClient
+from .core.client_wrapper import AsyncClientWrapper
+from .approval_policies.client import AsyncApprovalPoliciesClient
+from .approval_requests.client import AsyncApprovalRequestsClient
+from .audit_logs.client import AsyncAuditLogsClient
+from .access_tokens.client import AsyncAccessTokensClient
+from .batch_payments.client import AsyncBatchPaymentsClient
+from .comments.client import AsyncCommentsClient
+from .counterparts.client import AsyncCounterpartsClient
+from .data_exports.client import AsyncDataExportsClient
+from .pdf_templates.client import AsyncPdfTemplatesClient
+from .entities.client import AsyncEntitiesClient
+from .entity_users.client import AsyncEntityUsersClient
+from .events.client import AsyncEventsClient
+from .files.client import AsyncFilesClient
+from .mail_templates.client import AsyncMailTemplatesClient
+from .mailbox_domains.client import AsyncMailboxDomainsClient
+from .mailboxes.client import AsyncMailboxesClient
+from .measure_units.client import AsyncMeasureUnitsClient
+from .onboarding_links.client import AsyncOnboardingLinksClient
+from .overdue_reminders.client import AsyncOverdueRemindersClient
+from .purchase_orders.client import AsyncPurchaseOrdersClient
+from .payables.client import AsyncPayablesClient
+from .payment_intents.client import AsyncPaymentIntentsClient
+from .payment_links.client import AsyncPaymentLinksClient
+from .payment_records.client import AsyncPaymentRecordsClient
+from .payment_reminders.client import AsyncPaymentRemindersClient
+from .payment_terms.client import AsyncPaymentTermsClient
+from .products.client import AsyncProductsClient
+from .projects.client import AsyncProjectsClient
+from .receivables.client import AsyncReceivablesClient
+from .recurrences.client import AsyncRecurrencesClient
+from .roles.client import AsyncRolesClient
+from .partner_settings.client import AsyncPartnerSettingsClient
+from .tags.client import AsyncTagsClient
+from .text_templates.client import AsyncTextTemplatesClient
+from .vat_rates.client import AsyncVatRatesClient
+from .webhook_deliveries.client import AsyncWebhookDeliveriesClient
+from .webhook_subscriptions.client import AsyncWebhookSubscriptionsClient
+from .accounting.client import AsyncAccountingClient
+
+
+class Monite:
+ """
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
+
+ Parameters
+ ----------
+ base_url : typing.Optional[str]
+ The base url to use for requests from the client.
+
+ environment : MoniteEnvironment
+ The environment to use for requests from the client. from .environment import MoniteEnvironment
+
+
+
+ Defaults to MoniteEnvironment.SANDBOX
+
+
+
+ monite_version : str
+ monite_entity_id : typing.Optional[str]
+ token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
+ timeout : typing.Optional[float]
+ The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
+
+ follow_redirects : typing.Optional[bool]
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
+
+ httpx_client : typing.Optional[httpx.Client]
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ """
+
+ def __init__(
+ self,
+ *,
+ base_url: typing.Optional[str] = None,
+ environment: MoniteEnvironment = MoniteEnvironment.SANDBOX,
+ monite_version: str,
+ monite_entity_id: typing.Optional[str] = None,
+ token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
+ timeout: typing.Optional[float] = None,
+ follow_redirects: typing.Optional[bool] = True,
+ httpx_client: typing.Optional[httpx.Client] = None,
+ ):
+ _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
+ self._client_wrapper = SyncClientWrapper(
+ base_url=_get_base_url(base_url=base_url, environment=environment),
+ monite_version=monite_version,
+ monite_entity_id=monite_entity_id,
+ token=token,
+ httpx_client=httpx_client
+ if httpx_client is not None
+ else httpx.Client(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
+ if follow_redirects is not None
+ else httpx.Client(timeout=_defaulted_timeout),
+ timeout=_defaulted_timeout,
+ )
+ self.approval_policies = ApprovalPoliciesClient(client_wrapper=self._client_wrapper)
+ self.approval_requests = ApprovalRequestsClient(client_wrapper=self._client_wrapper)
+ self.audit_logs = AuditLogsClient(client_wrapper=self._client_wrapper)
+ self.access_tokens = AccessTokensClient(client_wrapper=self._client_wrapper)
+ self.batch_payments = BatchPaymentsClient(client_wrapper=self._client_wrapper)
+ self.comments = CommentsClient(client_wrapper=self._client_wrapper)
+ self.counterparts = CounterpartsClient(client_wrapper=self._client_wrapper)
+ self.data_exports = DataExportsClient(client_wrapper=self._client_wrapper)
+ self.pdf_templates = PdfTemplatesClient(client_wrapper=self._client_wrapper)
+ self.entities = EntitiesClient(client_wrapper=self._client_wrapper)
+ self.entity_users = EntityUsersClient(client_wrapper=self._client_wrapper)
+ self.events = EventsClient(client_wrapper=self._client_wrapper)
+ self.files = FilesClient(client_wrapper=self._client_wrapper)
+ self.mail_templates = MailTemplatesClient(client_wrapper=self._client_wrapper)
+ self.mailbox_domains = MailboxDomainsClient(client_wrapper=self._client_wrapper)
+ self.mailboxes = MailboxesClient(client_wrapper=self._client_wrapper)
+ self.measure_units = MeasureUnitsClient(client_wrapper=self._client_wrapper)
+ self.onboarding_links = OnboardingLinksClient(client_wrapper=self._client_wrapper)
+ self.overdue_reminders = OverdueRemindersClient(client_wrapper=self._client_wrapper)
+ self.purchase_orders = PurchaseOrdersClient(client_wrapper=self._client_wrapper)
+ self.payables = PayablesClient(client_wrapper=self._client_wrapper)
+ self.payment_intents = PaymentIntentsClient(client_wrapper=self._client_wrapper)
+ self.payment_links = PaymentLinksClient(client_wrapper=self._client_wrapper)
+ self.payment_records = PaymentRecordsClient(client_wrapper=self._client_wrapper)
+ self.payment_reminders = PaymentRemindersClient(client_wrapper=self._client_wrapper)
+ self.payment_terms = PaymentTermsClient(client_wrapper=self._client_wrapper)
+ self.products = ProductsClient(client_wrapper=self._client_wrapper)
+ self.projects = ProjectsClient(client_wrapper=self._client_wrapper)
+ self.receivables = ReceivablesClient(client_wrapper=self._client_wrapper)
+ self.recurrences = RecurrencesClient(client_wrapper=self._client_wrapper)
+ self.roles = RolesClient(client_wrapper=self._client_wrapper)
+ self.partner_settings = PartnerSettingsClient(client_wrapper=self._client_wrapper)
+ self.tags = TagsClient(client_wrapper=self._client_wrapper)
+ self.text_templates = TextTemplatesClient(client_wrapper=self._client_wrapper)
+ self.vat_rates = VatRatesClient(client_wrapper=self._client_wrapper)
+ self.webhook_deliveries = WebhookDeliveriesClient(client_wrapper=self._client_wrapper)
+ self.webhook_subscriptions = WebhookSubscriptionsClient(client_wrapper=self._client_wrapper)
+ self.accounting = AccountingClient(client_wrapper=self._client_wrapper)
+
+
+class AsyncMonite:
+ """
+ Use this class to access the different functions within the SDK. You can instantiate any number of clients with different configuration that will propagate to these functions.
+
+ Parameters
+ ----------
+ base_url : typing.Optional[str]
+ The base url to use for requests from the client.
+
+ environment : MoniteEnvironment
+ The environment to use for requests from the client. from .environment import MoniteEnvironment
+
+
+
+ Defaults to MoniteEnvironment.SANDBOX
+
+
+
+ monite_version : str
+ monite_entity_id : typing.Optional[str]
+ token : typing.Optional[typing.Union[str, typing.Callable[[], str]]]
+ timeout : typing.Optional[float]
+ The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
+
+ follow_redirects : typing.Optional[bool]
+ Whether the default httpx client follows redirects or not, this is irrelevant if a custom httpx client is passed in.
+
+ httpx_client : typing.Optional[httpx.AsyncClient]
+ The httpx client to use for making requests, a preconfigured client is used by default, however this is useful should you want to pass in any custom httpx configuration.
+
+ Examples
+ --------
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ """
+
+ def __init__(
+ self,
+ *,
+ base_url: typing.Optional[str] = None,
+ environment: MoniteEnvironment = MoniteEnvironment.SANDBOX,
+ monite_version: str,
+ monite_entity_id: typing.Optional[str] = None,
+ token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
+ timeout: typing.Optional[float] = None,
+ follow_redirects: typing.Optional[bool] = True,
+ httpx_client: typing.Optional[httpx.AsyncClient] = None,
+ ):
+ _defaulted_timeout = timeout if timeout is not None else 60 if httpx_client is None else None
+ self._client_wrapper = AsyncClientWrapper(
+ base_url=_get_base_url(base_url=base_url, environment=environment),
+ monite_version=monite_version,
+ monite_entity_id=monite_entity_id,
+ token=token,
+ httpx_client=httpx_client
+ if httpx_client is not None
+ else httpx.AsyncClient(timeout=_defaulted_timeout, follow_redirects=follow_redirects)
+ if follow_redirects is not None
+ else httpx.AsyncClient(timeout=_defaulted_timeout),
+ timeout=_defaulted_timeout,
+ )
+ self.approval_policies = AsyncApprovalPoliciesClient(client_wrapper=self._client_wrapper)
+ self.approval_requests = AsyncApprovalRequestsClient(client_wrapper=self._client_wrapper)
+ self.audit_logs = AsyncAuditLogsClient(client_wrapper=self._client_wrapper)
+ self.access_tokens = AsyncAccessTokensClient(client_wrapper=self._client_wrapper)
+ self.batch_payments = AsyncBatchPaymentsClient(client_wrapper=self._client_wrapper)
+ self.comments = AsyncCommentsClient(client_wrapper=self._client_wrapper)
+ self.counterparts = AsyncCounterpartsClient(client_wrapper=self._client_wrapper)
+ self.data_exports = AsyncDataExportsClient(client_wrapper=self._client_wrapper)
+ self.pdf_templates = AsyncPdfTemplatesClient(client_wrapper=self._client_wrapper)
+ self.entities = AsyncEntitiesClient(client_wrapper=self._client_wrapper)
+ self.entity_users = AsyncEntityUsersClient(client_wrapper=self._client_wrapper)
+ self.events = AsyncEventsClient(client_wrapper=self._client_wrapper)
+ self.files = AsyncFilesClient(client_wrapper=self._client_wrapper)
+ self.mail_templates = AsyncMailTemplatesClient(client_wrapper=self._client_wrapper)
+ self.mailbox_domains = AsyncMailboxDomainsClient(client_wrapper=self._client_wrapper)
+ self.mailboxes = AsyncMailboxesClient(client_wrapper=self._client_wrapper)
+ self.measure_units = AsyncMeasureUnitsClient(client_wrapper=self._client_wrapper)
+ self.onboarding_links = AsyncOnboardingLinksClient(client_wrapper=self._client_wrapper)
+ self.overdue_reminders = AsyncOverdueRemindersClient(client_wrapper=self._client_wrapper)
+ self.purchase_orders = AsyncPurchaseOrdersClient(client_wrapper=self._client_wrapper)
+ self.payables = AsyncPayablesClient(client_wrapper=self._client_wrapper)
+ self.payment_intents = AsyncPaymentIntentsClient(client_wrapper=self._client_wrapper)
+ self.payment_links = AsyncPaymentLinksClient(client_wrapper=self._client_wrapper)
+ self.payment_records = AsyncPaymentRecordsClient(client_wrapper=self._client_wrapper)
+ self.payment_reminders = AsyncPaymentRemindersClient(client_wrapper=self._client_wrapper)
+ self.payment_terms = AsyncPaymentTermsClient(client_wrapper=self._client_wrapper)
+ self.products = AsyncProductsClient(client_wrapper=self._client_wrapper)
+ self.projects = AsyncProjectsClient(client_wrapper=self._client_wrapper)
+ self.receivables = AsyncReceivablesClient(client_wrapper=self._client_wrapper)
+ self.recurrences = AsyncRecurrencesClient(client_wrapper=self._client_wrapper)
+ self.roles = AsyncRolesClient(client_wrapper=self._client_wrapper)
+ self.partner_settings = AsyncPartnerSettingsClient(client_wrapper=self._client_wrapper)
+ self.tags = AsyncTagsClient(client_wrapper=self._client_wrapper)
+ self.text_templates = AsyncTextTemplatesClient(client_wrapper=self._client_wrapper)
+ self.vat_rates = AsyncVatRatesClient(client_wrapper=self._client_wrapper)
+ self.webhook_deliveries = AsyncWebhookDeliveriesClient(client_wrapper=self._client_wrapper)
+ self.webhook_subscriptions = AsyncWebhookSubscriptionsClient(client_wrapper=self._client_wrapper)
+ self.accounting = AsyncAccountingClient(client_wrapper=self._client_wrapper)
+
+
+def _get_base_url(*, base_url: typing.Optional[str] = None, environment: MoniteEnvironment) -> str:
+ if base_url is not None:
+ return base_url
+ elif environment is not None:
+ return environment.value
+ else:
+ raise Exception("Please pass in either base_url or environment to construct the client")
diff --git a/src/monite/comments/__init__.py b/src/monite/comments/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/comments/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/comments/client.py b/src/monite/comments/client.py
new file mode 100644
index 0000000..b3d0bbe
--- /dev/null
+++ b/src/monite/comments/client.py
@@ -0,0 +1,1293 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.comment_cursor_fields import CommentCursorFields
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.comment_resource_list import CommentResourceList
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.conflict_error import ConflictError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.comment_resource import CommentResource
+from ..errors.not_found_error import NotFoundError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class CommentsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ object_id: str,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[CommentCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CommentResourceList:
+ """
+ Get comments
+
+ Parameters
+ ----------
+ object_id : str
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[CommentCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.comments.get(
+ object_id="object_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "comments",
+ method="GET",
+ params={
+ "object_type": "payable",
+ "object_id": object_id,
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResourceList,
+ parse_obj_as(
+ type_=CommentResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ object_id: str,
+ object_type: str,
+ text: str,
+ reply_to_entity_user_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CommentResource:
+ """
+ Create new comment
+
+ Parameters
+ ----------
+ object_id : str
+
+ object_type : str
+
+ text : str
+
+ reply_to_entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.comments.create(
+ object_id="object_id",
+ object_type="object_type",
+ text="text",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "comments",
+ method="POST",
+ json={
+ "object_id": object_id,
+ "object_type": object_type,
+ "reply_to_entity_user_id": reply_to_entity_user_id,
+ "text": text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResource,
+ parse_obj_as(
+ type_=CommentResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, comment_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> CommentResource:
+ """
+ Get comment
+
+ Parameters
+ ----------
+ comment_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.comments.get_by_id(
+ comment_id="comment_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"comments/{jsonable_encoder(comment_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResource,
+ parse_obj_as(
+ type_=CommentResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, comment_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete comment
+
+ Parameters
+ ----------
+ comment_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.comments.delete_by_id(
+ comment_id="comment_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"comments/{jsonable_encoder(comment_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ comment_id: str,
+ *,
+ reply_to_entity_user_id: typing.Optional[str] = OMIT,
+ text: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CommentResource:
+ """
+ Update comment
+
+ Parameters
+ ----------
+ comment_id : str
+
+ reply_to_entity_user_id : typing.Optional[str]
+
+ text : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.comments.update_by_id(
+ comment_id="comment_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"comments/{jsonable_encoder(comment_id)}",
+ method="PATCH",
+ json={
+ "reply_to_entity_user_id": reply_to_entity_user_id,
+ "text": text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResource,
+ parse_obj_as(
+ type_=CommentResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncCommentsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ object_id: str,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[CommentCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CommentResourceList:
+ """
+ Get comments
+
+ Parameters
+ ----------
+ object_id : str
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[CommentCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.comments.get(
+ object_id="object_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "comments",
+ method="GET",
+ params={
+ "object_type": "payable",
+ "object_id": object_id,
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResourceList,
+ parse_obj_as(
+ type_=CommentResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ object_id: str,
+ object_type: str,
+ text: str,
+ reply_to_entity_user_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CommentResource:
+ """
+ Create new comment
+
+ Parameters
+ ----------
+ object_id : str
+
+ object_type : str
+
+ text : str
+
+ reply_to_entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.comments.create(
+ object_id="object_id",
+ object_type="object_type",
+ text="text",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "comments",
+ method="POST",
+ json={
+ "object_id": object_id,
+ "object_type": object_type,
+ "reply_to_entity_user_id": reply_to_entity_user_id,
+ "text": text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResource,
+ parse_obj_as(
+ type_=CommentResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, comment_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CommentResource:
+ """
+ Get comment
+
+ Parameters
+ ----------
+ comment_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.comments.get_by_id(
+ comment_id="comment_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"comments/{jsonable_encoder(comment_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResource,
+ parse_obj_as(
+ type_=CommentResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, comment_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete comment
+
+ Parameters
+ ----------
+ comment_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.comments.delete_by_id(
+ comment_id="comment_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"comments/{jsonable_encoder(comment_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ comment_id: str,
+ *,
+ reply_to_entity_user_id: typing.Optional[str] = OMIT,
+ text: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CommentResource:
+ """
+ Update comment
+
+ Parameters
+ ----------
+ comment_id : str
+
+ reply_to_entity_user_id : typing.Optional[str]
+
+ text : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CommentResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.comments.update_by_id(
+ comment_id="comment_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"comments/{jsonable_encoder(comment_id)}",
+ method="PATCH",
+ json={
+ "reply_to_entity_user_id": reply_to_entity_user_id,
+ "text": text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CommentResource,
+ parse_obj_as(
+ type_=CommentResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/core/__init__.py b/src/monite/core/__init__.py
new file mode 100644
index 0000000..f03aecb
--- /dev/null
+++ b/src/monite/core/__init__.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .api_error import ApiError
+from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
+from .datetime_utils import serialize_datetime
+from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
+from .http_client import AsyncHttpClient, HttpClient
+from .jsonable_encoder import jsonable_encoder
+from .pydantic_utilities import (
+ IS_PYDANTIC_V2,
+ UniversalBaseModel,
+ UniversalRootModel,
+ parse_obj_as,
+ universal_field_validator,
+ universal_root_validator,
+ update_forward_refs,
+)
+from .query_encoder import encode_query
+from .remove_none_from_dict import remove_none_from_dict
+from .request_options import RequestOptions
+from .serialization import FieldMetadata, convert_and_respect_annotation_metadata
+
+__all__ = [
+ "ApiError",
+ "AsyncClientWrapper",
+ "AsyncHttpClient",
+ "BaseClientWrapper",
+ "FieldMetadata",
+ "File",
+ "HttpClient",
+ "IS_PYDANTIC_V2",
+ "RequestOptions",
+ "SyncClientWrapper",
+ "UniversalBaseModel",
+ "UniversalRootModel",
+ "convert_and_respect_annotation_metadata",
+ "convert_file_dict_to_httpx_tuples",
+ "encode_query",
+ "jsonable_encoder",
+ "parse_obj_as",
+ "remove_none_from_dict",
+ "serialize_datetime",
+ "universal_field_validator",
+ "universal_root_validator",
+ "update_forward_refs",
+ "with_content_type",
+]
diff --git a/src/monite/core/api_error.py b/src/monite/core/api_error.py
new file mode 100644
index 0000000..2e9fc54
--- /dev/null
+++ b/src/monite/core/api_error.py
@@ -0,0 +1,15 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+
+class ApiError(Exception):
+ status_code: typing.Optional[int]
+ body: typing.Any
+
+ def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
+ self.status_code = status_code
+ self.body = body
+
+ def __str__(self) -> str:
+ return f"status_code: {self.status_code}, body: {self.body}"
diff --git a/src/monite/core/client_wrapper.py b/src/monite/core/client_wrapper.py
new file mode 100644
index 0000000..4cd073f
--- /dev/null
+++ b/src/monite/core/client_wrapper.py
@@ -0,0 +1,101 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+import httpx
+from .http_client import HttpClient
+from .http_client import AsyncHttpClient
+
+
+class BaseClientWrapper:
+ def __init__(
+ self,
+ *,
+ monite_version: str,
+ monite_entity_id: typing.Optional[str] = None,
+ token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
+ base_url: str,
+ timeout: typing.Optional[float] = None,
+ ):
+ self._monite_version = monite_version
+ self._monite_entity_id = monite_entity_id
+ self._token = token
+ self._base_url = base_url
+ self._timeout = timeout
+
+ def get_headers(self) -> typing.Dict[str, str]:
+ headers: typing.Dict[str, str] = {
+ "X-Fern-Language": "Python",
+ "X-Fern-SDK-Name": "monite",
+ "X-Fern-SDK-Version": "0.0.0",
+ }
+ headers["x-monite-version"] = self._monite_version
+ if self._monite_entity_id is not None:
+ headers["x-monite-entity-id"] = self._monite_entity_id
+ token = self._get_token()
+ if token is not None:
+ headers["Authorization"] = f"Bearer {token}"
+ return headers
+
+ def _get_token(self) -> typing.Optional[str]:
+ if isinstance(self._token, str) or self._token is None:
+ return self._token
+ else:
+ return self._token()
+
+ def get_base_url(self) -> str:
+ return self._base_url
+
+ def get_timeout(self) -> typing.Optional[float]:
+ return self._timeout
+
+
+class SyncClientWrapper(BaseClientWrapper):
+ def __init__(
+ self,
+ *,
+ monite_version: str,
+ monite_entity_id: typing.Optional[str] = None,
+ token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
+ base_url: str,
+ timeout: typing.Optional[float] = None,
+ httpx_client: httpx.Client,
+ ):
+ super().__init__(
+ monite_version=monite_version,
+ monite_entity_id=monite_entity_id,
+ token=token,
+ base_url=base_url,
+ timeout=timeout,
+ )
+ self.httpx_client = HttpClient(
+ httpx_client=httpx_client,
+ base_headers=self.get_headers,
+ base_timeout=self.get_timeout,
+ base_url=self.get_base_url,
+ )
+
+
+class AsyncClientWrapper(BaseClientWrapper):
+ def __init__(
+ self,
+ *,
+ monite_version: str,
+ monite_entity_id: typing.Optional[str] = None,
+ token: typing.Optional[typing.Union[str, typing.Callable[[], str]]] = None,
+ base_url: str,
+ timeout: typing.Optional[float] = None,
+ httpx_client: httpx.AsyncClient,
+ ):
+ super().__init__(
+ monite_version=monite_version,
+ monite_entity_id=monite_entity_id,
+ token=token,
+ base_url=base_url,
+ timeout=timeout,
+ )
+ self.httpx_client = AsyncHttpClient(
+ httpx_client=httpx_client,
+ base_headers=self.get_headers,
+ base_timeout=self.get_timeout,
+ base_url=self.get_base_url,
+ )
diff --git a/src/monite/core/datetime_utils.py b/src/monite/core/datetime_utils.py
new file mode 100644
index 0000000..7c9864a
--- /dev/null
+++ b/src/monite/core/datetime_utils.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import datetime as dt
+
+
+def serialize_datetime(v: dt.datetime) -> str:
+ """
+ Serialize a datetime including timezone info.
+
+ Uses the timezone info provided if present, otherwise uses the current runtime's timezone info.
+
+ UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00.
+ """
+
+ def _serialize_zoned_datetime(v: dt.datetime) -> str:
+ if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None):
+ # UTC is a special case where we use "Z" at the end instead of "+00:00"
+ return v.isoformat().replace("+00:00", "Z")
+ else:
+ # Delegate to the typical +/- offset format
+ return v.isoformat()
+
+ if v.tzinfo is not None:
+ return _serialize_zoned_datetime(v)
+ else:
+ local_tz = dt.datetime.now().astimezone().tzinfo
+ localized_dt = v.replace(tzinfo=local_tz)
+ return _serialize_zoned_datetime(localized_dt)
diff --git a/src/monite/core/file.py b/src/monite/core/file.py
new file mode 100644
index 0000000..b4cbba3
--- /dev/null
+++ b/src/monite/core/file.py
@@ -0,0 +1,62 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast
+
+# File typing inspired by the flexibility of types within the httpx library
+# https://github.com/encode/httpx/blob/master/httpx/_types.py
+FileContent = Union[IO[bytes], bytes, str]
+File = Union[
+ # file (or bytes)
+ FileContent,
+ # (filename, file (or bytes))
+ Tuple[Optional[str], FileContent],
+ # (filename, file (or bytes), content_type)
+ Tuple[Optional[str], FileContent, Optional[str]],
+ # (filename, file (or bytes), content_type, headers)
+ Tuple[
+ Optional[str],
+ FileContent,
+ Optional[str],
+ Mapping[str, str],
+ ],
+]
+
+
+def convert_file_dict_to_httpx_tuples(
+ d: Dict[str, Union[File, List[File]]],
+) -> List[Tuple[str, File]]:
+ """
+ The format we use is a list of tuples, where the first element is the
+ name of the file and the second is the file object. Typically HTTPX wants
+ a dict, but to be able to send lists of files, you have to use the list
+ approach (which also works for non-lists)
+ https://github.com/encode/httpx/pull/1032
+ """
+
+ httpx_tuples = []
+ for key, file_like in d.items():
+ if isinstance(file_like, list):
+ for file_like_item in file_like:
+ httpx_tuples.append((key, file_like_item))
+ else:
+ httpx_tuples.append((key, file_like))
+ return httpx_tuples
+
+
+def with_content_type(*, file: File, content_type: str) -> File:
+ """ """
+ if isinstance(file, tuple):
+ if len(file) == 2:
+ filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore
+ return (filename, content, content_type)
+ elif len(file) == 3:
+ filename, content, _ = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore
+ return (filename, content, content_type)
+ elif len(file) == 4:
+ filename, content, _, headers = cast( # type: ignore
+ Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]], file
+ )
+ return (filename, content, content_type, headers)
+ else:
+ raise ValueError(f"Unexpected tuple length: {len(file)}")
+ return (None, file, content_type)
diff --git a/src/monite/core/http_client.py b/src/monite/core/http_client.py
new file mode 100644
index 0000000..eb4e894
--- /dev/null
+++ b/src/monite/core/http_client.py
@@ -0,0 +1,487 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import asyncio
+import email.utils
+import json
+import re
+import time
+import typing
+import urllib.parse
+from contextlib import asynccontextmanager, contextmanager
+from random import random
+
+import httpx
+
+from .file import File, convert_file_dict_to_httpx_tuples
+from .jsonable_encoder import jsonable_encoder
+from .query_encoder import encode_query
+from .remove_none_from_dict import remove_none_from_dict
+from .request_options import RequestOptions
+
+INITIAL_RETRY_DELAY_SECONDS = 0.5
+MAX_RETRY_DELAY_SECONDS = 10
+MAX_RETRY_DELAY_SECONDS_FROM_HEADER = 30
+
+
+def _parse_retry_after(response_headers: httpx.Headers) -> typing.Optional[float]:
+ """
+ This function parses the `Retry-After` header in a HTTP response and returns the number of seconds to wait.
+
+ Inspired by the urllib3 retry implementation.
+ """
+ retry_after_ms = response_headers.get("retry-after-ms")
+ if retry_after_ms is not None:
+ try:
+ return int(retry_after_ms) / 1000 if retry_after_ms > 0 else 0
+ except Exception:
+ pass
+
+ retry_after = response_headers.get("retry-after")
+ if retry_after is None:
+ return None
+
+ # Attempt to parse the header as an int.
+ if re.match(r"^\s*[0-9]+\s*$", retry_after):
+ seconds = float(retry_after)
+ # Fallback to parsing it as a date.
+ else:
+ retry_date_tuple = email.utils.parsedate_tz(retry_after)
+ if retry_date_tuple is None:
+ return None
+ if retry_date_tuple[9] is None: # Python 2
+ # Assume UTC if no timezone was specified
+ # On Python2.7, parsedate_tz returns None for a timezone offset
+ # instead of 0 if no timezone is given, where mktime_tz treats
+ # a None timezone offset as local time.
+ retry_date_tuple = retry_date_tuple[:9] + (0,) + retry_date_tuple[10:]
+
+ retry_date = email.utils.mktime_tz(retry_date_tuple)
+ seconds = retry_date - time.time()
+
+ if seconds < 0:
+ seconds = 0
+
+ return seconds
+
+
+def _retry_timeout(response: httpx.Response, retries: int) -> float:
+ """
+ Determine the amount of time to wait before retrying a request.
+ This function begins by trying to parse a retry-after header from the response, and then proceeds to use exponential backoff
+ with a jitter to determine the number of seconds to wait.
+ """
+
+ # If the API asks us to wait a certain amount of time (and it's a reasonable amount), just do what it says.
+ retry_after = _parse_retry_after(response.headers)
+ if retry_after is not None and retry_after <= MAX_RETRY_DELAY_SECONDS_FROM_HEADER:
+ return retry_after
+
+ # Apply exponential backoff, capped at MAX_RETRY_DELAY_SECONDS.
+ retry_delay = min(INITIAL_RETRY_DELAY_SECONDS * pow(2.0, retries), MAX_RETRY_DELAY_SECONDS)
+
+ # Add a randomness / jitter to the retry delay to avoid overwhelming the server with retries.
+ timeout = retry_delay * (1 - 0.25 * random())
+ return timeout if timeout >= 0 else 0
+
+
+def _should_retry(response: httpx.Response) -> bool:
+ retriable_400s = [429, 408, 409]
+ return response.status_code >= 500 or response.status_code in retriable_400s
+
+
+def remove_omit_from_dict(
+ original: typing.Dict[str, typing.Optional[typing.Any]],
+ omit: typing.Optional[typing.Any],
+) -> typing.Dict[str, typing.Any]:
+ if omit is None:
+ return original
+ new: typing.Dict[str, typing.Any] = {}
+ for key, value in original.items():
+ if value is not omit:
+ new[key] = value
+ return new
+
+
+def maybe_filter_request_body(
+ data: typing.Optional[typing.Any],
+ request_options: typing.Optional[RequestOptions],
+ omit: typing.Optional[typing.Any],
+) -> typing.Optional[typing.Any]:
+ if data is None:
+ return (
+ jsonable_encoder(request_options.get("additional_body_parameters", {})) or {}
+ if request_options is not None
+ else None
+ )
+ elif not isinstance(data, typing.Mapping):
+ data_content = jsonable_encoder(data)
+ else:
+ data_content = {
+ **(jsonable_encoder(remove_omit_from_dict(data, omit))), # type: ignore
+ **(
+ jsonable_encoder(request_options.get("additional_body_parameters", {})) or {}
+ if request_options is not None
+ else {}
+ ),
+ }
+ return data_content
+
+
+# Abstracted out for testing purposes
+def get_request_body(
+ *,
+ json: typing.Optional[typing.Any],
+ data: typing.Optional[typing.Any],
+ request_options: typing.Optional[RequestOptions],
+ omit: typing.Optional[typing.Any],
+) -> typing.Tuple[typing.Optional[typing.Any], typing.Optional[typing.Any]]:
+ json_body = None
+ data_body = None
+ if data is not None:
+ data_body = maybe_filter_request_body(data, request_options, omit)
+ else:
+ # If both data and json are None, we send json data in the event extra properties are specified
+ json_body = maybe_filter_request_body(json, request_options, omit)
+
+ # If you have an empty JSON body, you should just send None
+ return (json_body if json_body != {} else None), data_body if data_body != {} else None
+
+
+class HttpClient:
+ def __init__(
+ self,
+ *,
+ httpx_client: httpx.Client,
+ base_timeout: typing.Callable[[], typing.Optional[float]],
+ base_headers: typing.Callable[[], typing.Dict[str, str]],
+ base_url: typing.Optional[typing.Callable[[], str]] = None,
+ ):
+ self.base_url = base_url
+ self.base_timeout = base_timeout
+ self.base_headers = base_headers
+ self.httpx_client = httpx_client
+
+ def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str:
+ base_url = maybe_base_url
+ if self.base_url is not None and base_url is None:
+ base_url = self.base_url()
+
+ if base_url is None:
+ raise ValueError("A base_url is required to make this request, please provide one and try again.")
+ return base_url
+
+ def request(
+ self,
+ path: typing.Optional[str] = None,
+ *,
+ method: str,
+ base_url: typing.Optional[str] = None,
+ params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ json: typing.Optional[typing.Any] = None,
+ data: typing.Optional[typing.Any] = None,
+ content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ retries: int = 0,
+ omit: typing.Optional[typing.Any] = None,
+ ) -> httpx.Response:
+ base_url = self.get_base_url(base_url)
+ timeout = (
+ request_options.get("timeout_in_seconds")
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
+ else self.base_timeout()
+ )
+
+ json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+
+ response = self.httpx_client.request(
+ method=method,
+ url=urllib.parse.urljoin(f"{base_url}/", path),
+ headers=jsonable_encoder(
+ remove_none_from_dict(
+ {
+ **self.base_headers(),
+ **(headers if headers is not None else {}),
+ **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}),
+ }
+ )
+ ),
+ params=encode_query(
+ jsonable_encoder(
+ remove_none_from_dict(
+ remove_omit_from_dict(
+ {
+ **(params if params is not None else {}),
+ **(
+ request_options.get("additional_query_parameters", {}) or {}
+ if request_options is not None
+ else {}
+ ),
+ },
+ omit,
+ )
+ )
+ )
+ ),
+ json=json_body,
+ data=data_body,
+ content=content,
+ files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files))
+ if (files is not None and files is not omit)
+ else None,
+ timeout=timeout,
+ )
+
+ max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0
+ if _should_retry(response=response):
+ if max_retries > retries:
+ time.sleep(_retry_timeout(response=response, retries=retries))
+ return self.request(
+ path=path,
+ method=method,
+ base_url=base_url,
+ params=params,
+ json=json,
+ content=content,
+ files=files,
+ headers=headers,
+ request_options=request_options,
+ retries=retries + 1,
+ omit=omit,
+ )
+
+ return response
+
+ @contextmanager
+ def stream(
+ self,
+ path: typing.Optional[str] = None,
+ *,
+ method: str,
+ base_url: typing.Optional[str] = None,
+ params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ json: typing.Optional[typing.Any] = None,
+ data: typing.Optional[typing.Any] = None,
+ content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ retries: int = 0,
+ omit: typing.Optional[typing.Any] = None,
+ ) -> typing.Iterator[httpx.Response]:
+ base_url = self.get_base_url(base_url)
+ timeout = (
+ request_options.get("timeout_in_seconds")
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
+ else self.base_timeout()
+ )
+
+ json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+
+ with self.httpx_client.stream(
+ method=method,
+ url=urllib.parse.urljoin(f"{base_url}/", path),
+ headers=jsonable_encoder(
+ remove_none_from_dict(
+ {
+ **self.base_headers(),
+ **(headers if headers is not None else {}),
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
+ }
+ )
+ ),
+ params=encode_query(
+ jsonable_encoder(
+ remove_none_from_dict(
+ remove_omit_from_dict(
+ {
+ **(params if params is not None else {}),
+ **(
+ request_options.get("additional_query_parameters", {})
+ if request_options is not None
+ else {}
+ ),
+ },
+ omit,
+ )
+ )
+ )
+ ),
+ json=json_body,
+ data=data_body,
+ content=content,
+ files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files))
+ if (files is not None and files is not omit)
+ else None,
+ timeout=timeout,
+ ) as stream:
+ yield stream
+
+
+class AsyncHttpClient:
+ def __init__(
+ self,
+ *,
+ httpx_client: httpx.AsyncClient,
+ base_timeout: typing.Callable[[], typing.Optional[float]],
+ base_headers: typing.Callable[[], typing.Dict[str, str]],
+ base_url: typing.Optional[typing.Callable[[], str]] = None,
+ ):
+ self.base_url = base_url
+ self.base_timeout = base_timeout
+ self.base_headers = base_headers
+ self.httpx_client = httpx_client
+
+ def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str:
+ base_url = maybe_base_url
+ if self.base_url is not None and base_url is None:
+ base_url = self.base_url()
+
+ if base_url is None:
+ raise ValueError("A base_url is required to make this request, please provide one and try again.")
+ return base_url
+
+ async def request(
+ self,
+ path: typing.Optional[str] = None,
+ *,
+ method: str,
+ base_url: typing.Optional[str] = None,
+ params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ json: typing.Optional[typing.Any] = None,
+ data: typing.Optional[typing.Any] = None,
+ content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ retries: int = 0,
+ omit: typing.Optional[typing.Any] = None,
+ ) -> httpx.Response:
+ base_url = self.get_base_url(base_url)
+ timeout = (
+ request_options.get("timeout_in_seconds")
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
+ else self.base_timeout()
+ )
+
+ json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+
+ # Add the input to each of these and do None-safety checks
+ response = await self.httpx_client.request(
+ method=method,
+ url=urllib.parse.urljoin(f"{base_url}/", path),
+ headers=jsonable_encoder(
+ remove_none_from_dict(
+ {
+ **self.base_headers(),
+ **(headers if headers is not None else {}),
+ **(request_options.get("additional_headers", {}) or {} if request_options is not None else {}),
+ }
+ )
+ ),
+ params=encode_query(
+ jsonable_encoder(
+ remove_none_from_dict(
+ remove_omit_from_dict(
+ {
+ **(params if params is not None else {}),
+ **(
+ request_options.get("additional_query_parameters", {}) or {}
+ if request_options is not None
+ else {}
+ ),
+ },
+ omit,
+ )
+ )
+ )
+ ),
+ json=json_body,
+ data=data_body,
+ content=content,
+ files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None,
+ timeout=timeout,
+ )
+
+ max_retries: int = request_options.get("max_retries", 0) if request_options is not None else 0
+ if _should_retry(response=response):
+ if max_retries > retries:
+ await asyncio.sleep(_retry_timeout(response=response, retries=retries))
+ return await self.request(
+ path=path,
+ method=method,
+ base_url=base_url,
+ params=params,
+ json=json,
+ content=content,
+ files=files,
+ headers=headers,
+ request_options=request_options,
+ retries=retries + 1,
+ omit=omit,
+ )
+ return response
+
+ @asynccontextmanager
+ async def stream(
+ self,
+ path: typing.Optional[str] = None,
+ *,
+ method: str,
+ base_url: typing.Optional[str] = None,
+ params: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ json: typing.Optional[typing.Any] = None,
+ data: typing.Optional[typing.Any] = None,
+ content: typing.Optional[typing.Union[bytes, typing.Iterator[bytes], typing.AsyncIterator[bytes]]] = None,
+ files: typing.Optional[typing.Dict[str, typing.Optional[typing.Union[File, typing.List[File]]]]] = None,
+ headers: typing.Optional[typing.Dict[str, typing.Any]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ retries: int = 0,
+ omit: typing.Optional[typing.Any] = None,
+ ) -> typing.AsyncIterator[httpx.Response]:
+ base_url = self.get_base_url(base_url)
+ timeout = (
+ request_options.get("timeout_in_seconds")
+ if request_options is not None and request_options.get("timeout_in_seconds") is not None
+ else self.base_timeout()
+ )
+
+ json_body, data_body = get_request_body(json=json, data=data, request_options=request_options, omit=omit)
+
+ async with self.httpx_client.stream(
+ method=method,
+ url=urllib.parse.urljoin(f"{base_url}/", path),
+ headers=jsonable_encoder(
+ remove_none_from_dict(
+ {
+ **self.base_headers(),
+ **(headers if headers is not None else {}),
+ **(request_options.get("additional_headers", {}) if request_options is not None else {}),
+ }
+ )
+ ),
+ params=encode_query(
+ jsonable_encoder(
+ remove_none_from_dict(
+ remove_omit_from_dict(
+ {
+ **(params if params is not None else {}),
+ **(
+ request_options.get("additional_query_parameters", {})
+ if request_options is not None
+ else {}
+ ),
+ },
+ omit=omit,
+ )
+ )
+ )
+ ),
+ json=json_body,
+ data=data_body,
+ content=content,
+ files=convert_file_dict_to_httpx_tuples(remove_none_from_dict(files)) if files is not None else None,
+ timeout=timeout,
+ ) as stream:
+ yield stream
diff --git a/src/monite/core/jsonable_encoder.py b/src/monite/core/jsonable_encoder.py
new file mode 100644
index 0000000..1b631e9
--- /dev/null
+++ b/src/monite/core/jsonable_encoder.py
@@ -0,0 +1,101 @@
+# This file was auto-generated by Fern from our API Definition.
+
+"""
+jsonable_encoder converts a Python object to a JSON-friendly dict
+(e.g. datetimes to strings, Pydantic models to dicts).
+
+Taken from FastAPI, and made a bit simpler
+https://github.com/tiangolo/fastapi/blob/master/fastapi/encoders.py
+"""
+
+import base64
+import dataclasses
+import datetime as dt
+from enum import Enum
+from pathlib import PurePath
+from types import GeneratorType
+from typing import Any, Callable, Dict, List, Optional, Set, Union
+
+import pydantic
+
+from .datetime_utils import serialize_datetime
+from .pydantic_utilities import (
+ IS_PYDANTIC_V2,
+ encode_by_type,
+ to_jsonable_with_fallback,
+)
+
+SetIntStr = Set[Union[int, str]]
+DictIntStrAny = Dict[Union[int, str], Any]
+
+
+def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any:
+ custom_encoder = custom_encoder or {}
+ if custom_encoder:
+ if type(obj) in custom_encoder:
+ return custom_encoder[type(obj)](obj)
+ else:
+ for encoder_type, encoder_instance in custom_encoder.items():
+ if isinstance(obj, encoder_type):
+ return encoder_instance(obj)
+ if isinstance(obj, pydantic.BaseModel):
+ if IS_PYDANTIC_V2:
+ encoder = getattr(obj.model_config, "json_encoders", {}) # type: ignore # Pydantic v2
+ else:
+ encoder = getattr(obj.__config__, "json_encoders", {}) # type: ignore # Pydantic v1
+ if custom_encoder:
+ encoder.update(custom_encoder)
+ obj_dict = obj.dict(by_alias=True)
+ if "__root__" in obj_dict:
+ obj_dict = obj_dict["__root__"]
+ if "root" in obj_dict:
+ obj_dict = obj_dict["root"]
+ return jsonable_encoder(obj_dict, custom_encoder=encoder)
+ if dataclasses.is_dataclass(obj):
+ obj_dict = dataclasses.asdict(obj) # type: ignore
+ return jsonable_encoder(obj_dict, custom_encoder=custom_encoder)
+ if isinstance(obj, bytes):
+ return base64.b64encode(obj).decode("utf-8")
+ if isinstance(obj, Enum):
+ return obj.value
+ if isinstance(obj, PurePath):
+ return str(obj)
+ if isinstance(obj, (str, int, float, type(None))):
+ return obj
+ if isinstance(obj, dt.datetime):
+ return serialize_datetime(obj)
+ if isinstance(obj, dt.date):
+ return str(obj)
+ if isinstance(obj, dict):
+ encoded_dict = {}
+ allowed_keys = set(obj.keys())
+ for key, value in obj.items():
+ if key in allowed_keys:
+ encoded_key = jsonable_encoder(key, custom_encoder=custom_encoder)
+ encoded_value = jsonable_encoder(value, custom_encoder=custom_encoder)
+ encoded_dict[encoded_key] = encoded_value
+ return encoded_dict
+ if isinstance(obj, (list, set, frozenset, GeneratorType, tuple)):
+ encoded_list = []
+ for item in obj:
+ encoded_list.append(jsonable_encoder(item, custom_encoder=custom_encoder))
+ return encoded_list
+
+ def fallback_serializer(o: Any) -> Any:
+ attempt_encode = encode_by_type(o)
+ if attempt_encode is not None:
+ return attempt_encode
+
+ try:
+ data = dict(o)
+ except Exception as e:
+ errors: List[Exception] = []
+ errors.append(e)
+ try:
+ data = vars(o)
+ except Exception as e:
+ errors.append(e)
+ raise ValueError(errors) from e
+ return jsonable_encoder(data, custom_encoder=custom_encoder)
+
+ return to_jsonable_with_fallback(obj, fallback_serializer)
diff --git a/src/monite/core/pydantic_utilities.py b/src/monite/core/pydantic_utilities.py
new file mode 100644
index 0000000..ee8f0e4
--- /dev/null
+++ b/src/monite/core/pydantic_utilities.py
@@ -0,0 +1,296 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# nopycln: file
+import datetime as dt
+import typing
+from collections import defaultdict
+
+import typing_extensions
+
+import pydantic
+
+from .datetime_utils import serialize_datetime
+from .serialization import convert_and_respect_annotation_metadata
+
+IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
+
+if IS_PYDANTIC_V2:
+ # isort will try to reformat the comments on these imports, which breaks mypy
+ # isort: off
+ from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
+ parse_date as parse_date,
+ )
+ from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2
+ parse_datetime as parse_datetime,
+ )
+ from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
+ ENCODERS_BY_TYPE as encoders_by_type,
+ )
+ from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
+ get_args as get_args,
+ )
+ from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
+ get_origin as get_origin,
+ )
+ from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
+ is_literal_type as is_literal_type,
+ )
+ from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
+ is_union as is_union,
+ )
+ from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
+else:
+ from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1
+ from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1
+ from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1
+ from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1
+ from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1
+ from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1
+ from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1
+ from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1
+
+ # isort: on
+
+
+T = typing.TypeVar("T")
+Model = typing.TypeVar("Model", bound=pydantic.BaseModel)
+
+
+def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T:
+ dealiased_object = convert_and_respect_annotation_metadata(object_=object_, annotation=type_, direction="read")
+ if IS_PYDANTIC_V2:
+ adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2
+ return adapter.validate_python(dealiased_object)
+ else:
+ return pydantic.parse_obj_as(type_, dealiased_object)
+
+
+def to_jsonable_with_fallback(
+ obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any]
+) -> typing.Any:
+ if IS_PYDANTIC_V2:
+ from pydantic_core import to_jsonable_python
+
+ return to_jsonable_python(obj, fallback=fallback_serializer)
+ else:
+ return fallback_serializer(obj)
+
+
+class UniversalBaseModel(pydantic.BaseModel):
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
+ # Allow fields begining with `model_` to be used in the model
+ protected_namespaces=(),
+ ) # type: ignore # Pydantic v2
+
+ @pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore # Pydantic v2
+ def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> typing.Any: # type: ignore # Pydantic v2
+ serialized = handler(self)
+ data = {k: serialize_datetime(v) if isinstance(v, dt.datetime) else v for k, v in serialized.items()}
+ return data
+
+ else:
+
+ class Config:
+ smart_union = True
+ json_encoders = {dt.datetime: serialize_datetime}
+
+ @classmethod
+ def model_construct(
+ cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any
+ ) -> "Model":
+ dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read")
+ return cls.construct(_fields_set, **dealiased_object)
+
+ @classmethod
+ def construct(
+ cls: typing.Type["Model"], _fields_set: typing.Optional[typing.Set[str]] = None, **values: typing.Any
+ ) -> "Model":
+ dealiased_object = convert_and_respect_annotation_metadata(object_=values, annotation=cls, direction="read")
+ if IS_PYDANTIC_V2:
+ return super().model_construct(_fields_set, **dealiased_object) # type: ignore # Pydantic v2
+ else:
+ return super().construct(_fields_set, **dealiased_object)
+
+ def json(self, **kwargs: typing.Any) -> str:
+ kwargs_with_defaults: typing.Any = {
+ "by_alias": True,
+ "exclude_unset": True,
+ **kwargs,
+ }
+ if IS_PYDANTIC_V2:
+ return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2
+ else:
+ return super().json(**kwargs_with_defaults)
+
+ def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
+ """
+ Override the default dict method to `exclude_unset` by default. This function patches
+ `exclude_unset` to work include fields within non-None default values.
+ """
+ # Note: the logic here is multi-plexed given the levers exposed in Pydantic V1 vs V2
+ # Pydantic V1's .dict can be extremely slow, so we do not want to call it twice.
+ #
+ # We'd ideally do the same for Pydantic V2, but it shells out to a library to serialize models
+ # that we have less control over, and this is less intrusive than custom serializers for now.
+ if IS_PYDANTIC_V2:
+ kwargs_with_defaults_exclude_unset: typing.Any = {
+ **kwargs,
+ "by_alias": True,
+ "exclude_unset": True,
+ "exclude_none": False,
+ }
+ kwargs_with_defaults_exclude_none: typing.Any = {
+ **kwargs,
+ "by_alias": True,
+ "exclude_none": True,
+ "exclude_unset": False,
+ }
+ dict_dump = deep_union_pydantic_dicts(
+ super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2
+ super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2
+ )
+
+ else:
+ _fields_set = self.__fields_set__.copy()
+
+ fields = _get_model_fields(self.__class__)
+ for name, field in fields.items():
+ if name not in _fields_set:
+ default = _get_field_default(field)
+
+ # If the default values are non-null act like they've been set
+ # This effectively allows exclude_unset to work like exclude_none where
+ # the latter passes through intentionally set none values.
+ if default is not None or ("exclude_unset" in kwargs and not kwargs["exclude_unset"]):
+ _fields_set.add(name)
+
+ if default is not None:
+ self.__fields_set__.add(name)
+
+ kwargs_with_defaults_exclude_unset_include_fields: typing.Any = {
+ "by_alias": True,
+ "exclude_unset": True,
+ "include": _fields_set,
+ **kwargs,
+ }
+
+ dict_dump = super().dict(**kwargs_with_defaults_exclude_unset_include_fields)
+
+ return convert_and_respect_annotation_metadata(object_=dict_dump, annotation=self.__class__, direction="write")
+
+
+def _union_list_of_pydantic_dicts(
+ source: typing.List[typing.Any], destination: typing.List[typing.Any]
+) -> typing.List[typing.Any]:
+ converted_list: typing.List[typing.Any] = []
+ for i, item in enumerate(source):
+ destination_value = destination[i] # type: ignore
+ if isinstance(item, dict):
+ converted_list.append(deep_union_pydantic_dicts(item, destination_value))
+ elif isinstance(item, list):
+ converted_list.append(_union_list_of_pydantic_dicts(item, destination_value))
+ else:
+ converted_list.append(item)
+ return converted_list
+
+
+def deep_union_pydantic_dicts(
+ source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any]
+) -> typing.Dict[str, typing.Any]:
+ for key, value in source.items():
+ node = destination.setdefault(key, {})
+ if isinstance(value, dict):
+ deep_union_pydantic_dicts(value, node)
+ # Note: we do not do this same processing for sets given we do not have sets of models
+ # and given the sets are unordered, the processing of the set and matching objects would
+ # be non-trivial.
+ elif isinstance(value, list):
+ destination[key] = _union_list_of_pydantic_dicts(value, node)
+ else:
+ destination[key] = value
+
+ return destination
+
+
+if IS_PYDANTIC_V2:
+
+ class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2
+ pass
+
+ UniversalRootModel: typing_extensions.TypeAlias = V2RootModel # type: ignore
+else:
+ UniversalRootModel: typing_extensions.TypeAlias = UniversalBaseModel # type: ignore
+
+
+def encode_by_type(o: typing.Any) -> typing.Any:
+ encoders_by_class_tuples: typing.Dict[typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]] = (
+ defaultdict(tuple)
+ )
+ for type_, encoder in encoders_by_type.items():
+ encoders_by_class_tuples[encoder] += (type_,)
+
+ if type(o) in encoders_by_type:
+ return encoders_by_type[type(o)](o)
+ for encoder, classes_tuple in encoders_by_class_tuples.items():
+ if isinstance(o, classes_tuple):
+ return encoder(o)
+
+
+def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
+ if IS_PYDANTIC_V2:
+ model.model_rebuild(raise_errors=False) # type: ignore # Pydantic v2
+ else:
+ model.update_forward_refs(**localns)
+
+
+# Mirrors Pydantic's internal typing
+AnyCallable = typing.Callable[..., typing.Any]
+
+
+def universal_root_validator(
+ pre: bool = False,
+) -> typing.Callable[[AnyCallable], AnyCallable]:
+ def decorator(func: AnyCallable) -> AnyCallable:
+ if IS_PYDANTIC_V2:
+ return pydantic.model_validator(mode="before" if pre else "after")(func) # type: ignore # Pydantic v2
+ else:
+ return pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1
+
+ return decorator
+
+
+def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]:
+ def decorator(func: AnyCallable) -> AnyCallable:
+ if IS_PYDANTIC_V2:
+ return pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2
+ else:
+ return pydantic.validator(field_name, pre=pre)(func) # type: ignore # Pydantic v1
+
+ return decorator
+
+
+PydanticField = typing.Union[ModelField, pydantic.fields.FieldInfo]
+
+
+def _get_model_fields(
+ model: typing.Type["Model"],
+) -> typing.Mapping[str, PydanticField]:
+ if IS_PYDANTIC_V2:
+ return model.model_fields # type: ignore # Pydantic v2
+ else:
+ return model.__fields__ # type: ignore # Pydantic v1
+
+
+def _get_field_default(field: PydanticField) -> typing.Any:
+ try:
+ value = field.get_default() # type: ignore # Pydantic < v1.10.15
+ except:
+ value = field.default
+ if IS_PYDANTIC_V2:
+ from pydantic_core import PydanticUndefined
+
+ if value == PydanticUndefined:
+ return None
+ return value
+ return value
diff --git a/src/monite/core/query_encoder.py b/src/monite/core/query_encoder.py
new file mode 100644
index 0000000..3183001
--- /dev/null
+++ b/src/monite/core/query_encoder.py
@@ -0,0 +1,58 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from typing import Any, Dict, List, Optional, Tuple
+
+import pydantic
+
+
+# Flattens dicts to be of the form {"key[subkey][subkey2]": value} where value is not a dict
+def traverse_query_dict(dict_flat: Dict[str, Any], key_prefix: Optional[str] = None) -> List[Tuple[str, Any]]:
+ result = []
+ for k, v in dict_flat.items():
+ key = f"{key_prefix}[{k}]" if key_prefix is not None else k
+ if isinstance(v, dict):
+ result.extend(traverse_query_dict(v, key))
+ elif isinstance(v, list):
+ for arr_v in v:
+ if isinstance(arr_v, dict):
+ result.extend(traverse_query_dict(arr_v, key))
+ else:
+ result.append((key, arr_v))
+ else:
+ result.append((key, v))
+ return result
+
+
+def single_query_encoder(query_key: str, query_value: Any) -> List[Tuple[str, Any]]:
+ if isinstance(query_value, pydantic.BaseModel) or isinstance(query_value, dict):
+ if isinstance(query_value, pydantic.BaseModel):
+ obj_dict = query_value.dict(by_alias=True)
+ else:
+ obj_dict = query_value
+ return traverse_query_dict(obj_dict, query_key)
+ elif isinstance(query_value, list):
+ encoded_values: List[Tuple[str, Any]] = []
+ for value in query_value:
+ if isinstance(value, pydantic.BaseModel) or isinstance(value, dict):
+ if isinstance(value, pydantic.BaseModel):
+ obj_dict = value.dict(by_alias=True)
+ elif isinstance(value, dict):
+ obj_dict = value
+
+ encoded_values.extend(single_query_encoder(query_key, obj_dict))
+ else:
+ encoded_values.append((query_key, value))
+
+ return encoded_values
+
+ return [(query_key, query_value)]
+
+
+def encode_query(query: Optional[Dict[str, Any]]) -> Optional[List[Tuple[str, Any]]]:
+ if query is None:
+ return None
+
+ encoded_query = []
+ for k, v in query.items():
+ encoded_query.extend(single_query_encoder(k, v))
+ return encoded_query
diff --git a/src/monite/core/remove_none_from_dict.py b/src/monite/core/remove_none_from_dict.py
new file mode 100644
index 0000000..c229814
--- /dev/null
+++ b/src/monite/core/remove_none_from_dict.py
@@ -0,0 +1,11 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from typing import Any, Dict, Mapping, Optional
+
+
+def remove_none_from_dict(original: Mapping[str, Optional[Any]]) -> Dict[str, Any]:
+ new: Dict[str, Any] = {}
+ for key, value in original.items():
+ if value is not None:
+ new[key] = value
+ return new
diff --git a/src/monite/core/request_options.py b/src/monite/core/request_options.py
new file mode 100644
index 0000000..d0bf0db
--- /dev/null
+++ b/src/monite/core/request_options.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+try:
+ from typing import NotRequired # type: ignore
+except ImportError:
+ from typing_extensions import NotRequired
+
+
+class RequestOptions(typing.TypedDict, total=False):
+ """
+ Additional options for request-specific configuration when calling APIs via the SDK.
+ This is used primarily as an optional final parameter for service functions.
+
+ Attributes:
+ - timeout_in_seconds: int. The number of seconds to await an API call before timing out.
+
+ - max_retries: int. The max number of retries to attempt if the API call fails.
+
+ - additional_headers: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's header dict
+
+ - additional_query_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's query parameters dict
+
+ - additional_body_parameters: typing.Dict[str, typing.Any]. A dictionary containing additional parameters to spread into the request's body parameters dict
+ """
+
+ timeout_in_seconds: NotRequired[int]
+ max_retries: NotRequired[int]
+ additional_headers: NotRequired[typing.Dict[str, typing.Any]]
+ additional_query_parameters: NotRequired[typing.Dict[str, typing.Any]]
+ additional_body_parameters: NotRequired[typing.Dict[str, typing.Any]]
diff --git a/src/monite/core/serialization.py b/src/monite/core/serialization.py
new file mode 100644
index 0000000..cb5dcbf
--- /dev/null
+++ b/src/monite/core/serialization.py
@@ -0,0 +1,272 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import collections
+import inspect
+import typing
+
+import typing_extensions
+
+import pydantic
+
+
+class FieldMetadata:
+ """
+ Metadata class used to annotate fields to provide additional information.
+
+ Example:
+ class MyDict(TypedDict):
+ field: typing.Annotated[str, FieldMetadata(alias="field_name")]
+
+ Will serialize: `{"field": "value"}`
+ To: `{"field_name": "value"}`
+ """
+
+ alias: str
+
+ def __init__(self, *, alias: str) -> None:
+ self.alias = alias
+
+
+def convert_and_respect_annotation_metadata(
+ *,
+ object_: typing.Any,
+ annotation: typing.Any,
+ inner_type: typing.Optional[typing.Any] = None,
+ direction: typing.Literal["read", "write"],
+) -> typing.Any:
+ """
+ Respect the metadata annotations on a field, such as aliasing. This function effectively
+ manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for
+ TypedDicts, which cannot support aliasing out of the box, and can be extended for additional
+ utilities, such as defaults.
+
+ Parameters
+ ----------
+ object_ : typing.Any
+
+ annotation : type
+ The type we're looking to apply typing annotations from
+
+ inner_type : typing.Optional[type]
+
+ Returns
+ -------
+ typing.Any
+ """
+
+ if object_ is None:
+ return None
+ if inner_type is None:
+ inner_type = annotation
+
+ clean_type = _remove_annotations(inner_type)
+ # Pydantic models
+ if (
+ inspect.isclass(clean_type)
+ and issubclass(clean_type, pydantic.BaseModel)
+ and isinstance(object_, typing.Mapping)
+ ):
+ return _convert_mapping(object_, clean_type, direction)
+ # TypedDicts
+ if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping):
+ return _convert_mapping(object_, clean_type, direction)
+
+ if (
+ typing_extensions.get_origin(clean_type) == typing.Dict
+ or typing_extensions.get_origin(clean_type) == dict
+ or clean_type == typing.Dict
+ ) and isinstance(object_, typing.Dict):
+ key_type = typing_extensions.get_args(clean_type)[0]
+ value_type = typing_extensions.get_args(clean_type)[1]
+
+ return {
+ key: convert_and_respect_annotation_metadata(
+ object_=value,
+ annotation=annotation,
+ inner_type=value_type,
+ direction=direction,
+ )
+ for key, value in object_.items()
+ }
+
+ # If you're iterating on a string, do not bother to coerce it to a sequence.
+ if not isinstance(object_, str):
+ if (
+ typing_extensions.get_origin(clean_type) == typing.Set
+ or typing_extensions.get_origin(clean_type) == set
+ or clean_type == typing.Set
+ ) and isinstance(object_, typing.Set):
+ inner_type = typing_extensions.get_args(clean_type)[0]
+ return {
+ convert_and_respect_annotation_metadata(
+ object_=item,
+ annotation=annotation,
+ inner_type=inner_type,
+ direction=direction,
+ )
+ for item in object_
+ }
+ elif (
+ (
+ typing_extensions.get_origin(clean_type) == typing.List
+ or typing_extensions.get_origin(clean_type) == list
+ or clean_type == typing.List
+ )
+ and isinstance(object_, typing.List)
+ ) or (
+ (
+ typing_extensions.get_origin(clean_type) == typing.Sequence
+ or typing_extensions.get_origin(clean_type) == collections.abc.Sequence
+ or clean_type == typing.Sequence
+ )
+ and isinstance(object_, typing.Sequence)
+ ):
+ inner_type = typing_extensions.get_args(clean_type)[0]
+ return [
+ convert_and_respect_annotation_metadata(
+ object_=item,
+ annotation=annotation,
+ inner_type=inner_type,
+ direction=direction,
+ )
+ for item in object_
+ ]
+
+ if typing_extensions.get_origin(clean_type) == typing.Union:
+ # We should be able to ~relatively~ safely try to convert keys against all
+ # member types in the union, the edge case here is if one member aliases a field
+ # of the same name to a different name from another member
+ # Or if another member aliases a field of the same name that another member does not.
+ for member in typing_extensions.get_args(clean_type):
+ object_ = convert_and_respect_annotation_metadata(
+ object_=object_,
+ annotation=annotation,
+ inner_type=member,
+ direction=direction,
+ )
+ return object_
+
+ annotated_type = _get_annotation(annotation)
+ if annotated_type is None:
+ return object_
+
+ # If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.)
+ # Then we can safely call it on the recursive conversion.
+ return object_
+
+
+def _convert_mapping(
+ object_: typing.Mapping[str, object],
+ expected_type: typing.Any,
+ direction: typing.Literal["read", "write"],
+) -> typing.Mapping[str, object]:
+ converted_object: typing.Dict[str, object] = {}
+ annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
+ aliases_to_field_names = _get_alias_to_field_name(annotations)
+ for key, value in object_.items():
+ if direction == "read" and key in aliases_to_field_names:
+ dealiased_key = aliases_to_field_names.get(key)
+ if dealiased_key is not None:
+ type_ = annotations.get(dealiased_key)
+ else:
+ type_ = annotations.get(key)
+ # Note you can't get the annotation by the field name if you're in read mode, so you must check the aliases map
+ #
+ # So this is effectively saying if we're in write mode, and we don't have a type, or if we're in read mode and we don't have an alias
+ # then we can just pass the value through as is
+ if type_ is None:
+ converted_object[key] = value
+ elif direction == "read" and key not in aliases_to_field_names:
+ converted_object[key] = convert_and_respect_annotation_metadata(
+ object_=value, annotation=type_, direction=direction
+ )
+ else:
+ converted_object[_alias_key(key, type_, direction, aliases_to_field_names)] = (
+ convert_and_respect_annotation_metadata(object_=value, annotation=type_, direction=direction)
+ )
+ return converted_object
+
+
+def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]:
+ maybe_annotated_type = typing_extensions.get_origin(type_)
+ if maybe_annotated_type is None:
+ return None
+
+ if maybe_annotated_type == typing_extensions.NotRequired:
+ type_ = typing_extensions.get_args(type_)[0]
+ maybe_annotated_type = typing_extensions.get_origin(type_)
+
+ if maybe_annotated_type == typing_extensions.Annotated:
+ return type_
+
+ return None
+
+
+def _remove_annotations(type_: typing.Any) -> typing.Any:
+ maybe_annotated_type = typing_extensions.get_origin(type_)
+ if maybe_annotated_type is None:
+ return type_
+
+ if maybe_annotated_type == typing_extensions.NotRequired:
+ return _remove_annotations(typing_extensions.get_args(type_)[0])
+
+ if maybe_annotated_type == typing_extensions.Annotated:
+ return _remove_annotations(typing_extensions.get_args(type_)[0])
+
+ return type_
+
+
+def get_alias_to_field_mapping(type_: typing.Any) -> typing.Dict[str, str]:
+ annotations = typing_extensions.get_type_hints(type_, include_extras=True)
+ return _get_alias_to_field_name(annotations)
+
+
+def get_field_to_alias_mapping(type_: typing.Any) -> typing.Dict[str, str]:
+ annotations = typing_extensions.get_type_hints(type_, include_extras=True)
+ return _get_field_to_alias_name(annotations)
+
+
+def _get_alias_to_field_name(
+ field_to_hint: typing.Dict[str, typing.Any],
+) -> typing.Dict[str, str]:
+ aliases = {}
+ for field, hint in field_to_hint.items():
+ maybe_alias = _get_alias_from_type(hint)
+ if maybe_alias is not None:
+ aliases[maybe_alias] = field
+ return aliases
+
+
+def _get_field_to_alias_name(
+ field_to_hint: typing.Dict[str, typing.Any],
+) -> typing.Dict[str, str]:
+ aliases = {}
+ for field, hint in field_to_hint.items():
+ maybe_alias = _get_alias_from_type(hint)
+ if maybe_alias is not None:
+ aliases[field] = maybe_alias
+ return aliases
+
+
+def _get_alias_from_type(type_: typing.Any) -> typing.Optional[str]:
+ maybe_annotated_type = _get_annotation(type_)
+
+ if maybe_annotated_type is not None:
+ # The actual annotations are 1 onward, the first is the annotated type
+ annotations = typing_extensions.get_args(maybe_annotated_type)[1:]
+
+ for annotation in annotations:
+ if isinstance(annotation, FieldMetadata) and annotation.alias is not None:
+ return annotation.alias
+ return None
+
+
+def _alias_key(
+ key: str,
+ type_: typing.Any,
+ direction: typing.Literal["read", "write"],
+ aliases_to_field_names: typing.Dict[str, str],
+) -> str:
+ if direction == "read":
+ return aliases_to_field_names.get(key, key)
+ return _get_alias_from_type(type_=type_) or key
diff --git a/src/monite/counterparts/__init__.py b/src/monite/counterparts/__init__.py
new file mode 100644
index 0000000..aa91a18
--- /dev/null
+++ b/src/monite/counterparts/__init__.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from . import addresses, bank_accounts, contacts, vat_ids
+
+__all__ = ["addresses", "bank_accounts", "contacts", "vat_ids"]
diff --git a/src/monite/counterparts/addresses/__init__.py b/src/monite/counterparts/addresses/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/counterparts/addresses/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/counterparts/addresses/client.py b/src/monite/counterparts/addresses/client.py
new file mode 100644
index 0000000..6b226d4
--- /dev/null
+++ b/src/monite/counterparts/addresses/client.py
@@ -0,0 +1,1009 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.counterpart_address_resource_list import CounterpartAddressResourceList
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.not_found_error import NotFoundError
+from ...types.error_schema_response import ErrorSchemaResponse
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.allowed_countries import AllowedCountries
+from ...types.counterpart_address_response_with_counterpart_id import CounterpartAddressResponseWithCounterpartId
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class AddressesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartAddressResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.addresses.get(
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResourceList,
+ parse_obj_as(
+ type_=CounterpartAddressResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ counterpart_id: str,
+ *,
+ city: str,
+ country: AllowedCountries,
+ line1: str,
+ postal_code: str,
+ line2: typing.Optional[str] = OMIT,
+ state: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartAddressResponseWithCounterpartId:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ city : str
+ City name.
+
+ country : AllowedCountries
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+ line1 : str
+ Street address.
+
+ postal_code : str
+ ZIP or postal code.
+
+ line2 : typing.Optional[str]
+ Additional address information (if any).
+
+ state : typing.Optional[str]
+ State, region, province, or county.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResponseWithCounterpartId
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.addresses.create(
+ counterpart_id="counterpart_id",
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses",
+ method="POST",
+ json={
+ "city": city,
+ "country": country,
+ "line1": line1,
+ "line2": line2,
+ "postal_code": postal_code,
+ "state": state,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResponseWithCounterpartId,
+ parse_obj_as(
+ type_=CounterpartAddressResponseWithCounterpartId, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, address_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartAddressResponseWithCounterpartId:
+ """
+ Parameters
+ ----------
+ address_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResponseWithCounterpartId
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.addresses.get_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses/{jsonable_encoder(address_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResponseWithCounterpartId,
+ parse_obj_as(
+ type_=CounterpartAddressResponseWithCounterpartId, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, address_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ address_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.addresses.delete_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses/{jsonable_encoder(address_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ address_id: str,
+ counterpart_id: str,
+ *,
+ city: typing.Optional[str] = OMIT,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ line1: typing.Optional[str] = OMIT,
+ line2: typing.Optional[str] = OMIT,
+ postal_code: typing.Optional[str] = OMIT,
+ state: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartAddressResponseWithCounterpartId:
+ """
+ Parameters
+ ----------
+ address_id : str
+
+ counterpart_id : str
+
+ city : typing.Optional[str]
+ City name.
+
+ country : typing.Optional[AllowedCountries]
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+ line1 : typing.Optional[str]
+ Street address.
+
+ line2 : typing.Optional[str]
+ Additional address information (if any).
+
+ postal_code : typing.Optional[str]
+ ZIP or postal code.
+
+ state : typing.Optional[str]
+ State, region, province, or county.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResponseWithCounterpartId
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.addresses.update_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses/{jsonable_encoder(address_id)}",
+ method="PATCH",
+ json={
+ "city": city,
+ "country": country,
+ "line1": line1,
+ "line2": line2,
+ "postal_code": postal_code,
+ "state": state,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResponseWithCounterpartId,
+ parse_obj_as(
+ type_=CounterpartAddressResponseWithCounterpartId, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncAddressesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartAddressResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.addresses.get(
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResourceList,
+ parse_obj_as(
+ type_=CounterpartAddressResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ counterpart_id: str,
+ *,
+ city: str,
+ country: AllowedCountries,
+ line1: str,
+ postal_code: str,
+ line2: typing.Optional[str] = OMIT,
+ state: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartAddressResponseWithCounterpartId:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ city : str
+ City name.
+
+ country : AllowedCountries
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+ line1 : str
+ Street address.
+
+ postal_code : str
+ ZIP or postal code.
+
+ line2 : typing.Optional[str]
+ Additional address information (if any).
+
+ state : typing.Optional[str]
+ State, region, province, or county.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResponseWithCounterpartId
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.addresses.create(
+ counterpart_id="counterpart_id",
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses",
+ method="POST",
+ json={
+ "city": city,
+ "country": country,
+ "line1": line1,
+ "line2": line2,
+ "postal_code": postal_code,
+ "state": state,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResponseWithCounterpartId,
+ parse_obj_as(
+ type_=CounterpartAddressResponseWithCounterpartId, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, address_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartAddressResponseWithCounterpartId:
+ """
+ Parameters
+ ----------
+ address_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResponseWithCounterpartId
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.addresses.get_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses/{jsonable_encoder(address_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResponseWithCounterpartId,
+ parse_obj_as(
+ type_=CounterpartAddressResponseWithCounterpartId, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, address_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ address_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.addresses.delete_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses/{jsonable_encoder(address_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ address_id: str,
+ counterpart_id: str,
+ *,
+ city: typing.Optional[str] = OMIT,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ line1: typing.Optional[str] = OMIT,
+ line2: typing.Optional[str] = OMIT,
+ postal_code: typing.Optional[str] = OMIT,
+ state: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartAddressResponseWithCounterpartId:
+ """
+ Parameters
+ ----------
+ address_id : str
+
+ counterpart_id : str
+
+ city : typing.Optional[str]
+ City name.
+
+ country : typing.Optional[AllowedCountries]
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+ line1 : typing.Optional[str]
+ Street address.
+
+ line2 : typing.Optional[str]
+ Additional address information (if any).
+
+ postal_code : typing.Optional[str]
+ ZIP or postal code.
+
+ state : typing.Optional[str]
+ State, region, province, or county.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartAddressResponseWithCounterpartId
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.addresses.update_by_id(
+ address_id="address_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/addresses/{jsonable_encoder(address_id)}",
+ method="PATCH",
+ json={
+ "city": city,
+ "country": country,
+ "line1": line1,
+ "line2": line2,
+ "postal_code": postal_code,
+ "state": state,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartAddressResponseWithCounterpartId,
+ parse_obj_as(
+ type_=CounterpartAddressResponseWithCounterpartId, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/counterparts/bank_accounts/__init__.py b/src/monite/counterparts/bank_accounts/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/counterparts/bank_accounts/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/counterparts/bank_accounts/client.py b/src/monite/counterparts/bank_accounts/client.py
new file mode 100644
index 0000000..9b273cc
--- /dev/null
+++ b/src/monite/counterparts/bank_accounts/client.py
@@ -0,0 +1,1212 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.counterpart_bank_account_resource_list import CounterpartBankAccountResourceList
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.allowed_countries import AllowedCountries
+from ...types.currency_enum import CurrencyEnum
+from ...types.counterpart_bank_account_response import CounterpartBankAccountResponse
+from ...errors.not_found_error import NotFoundError
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class BankAccountsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartBankAccountResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.bank_accounts.get(
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResourceList,
+ parse_obj_as(
+ type_=CounterpartBankAccountResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ counterpart_id: str,
+ *,
+ country: AllowedCountries,
+ currency: CurrencyEnum,
+ account_holder_name: typing.Optional[str] = OMIT,
+ account_number: typing.Optional[str] = OMIT,
+ bic: typing.Optional[str] = OMIT,
+ iban: typing.Optional[str] = OMIT,
+ is_default_for_currency: typing.Optional[bool] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ routing_number: typing.Optional[str] = OMIT,
+ sort_code: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartBankAccountResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ country : AllowedCountries
+
+ currency : CurrencyEnum
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+ bic : typing.Optional[str]
+ The BIC/SWIFT code of the bank.
+
+ iban : typing.Optional[str]
+ The IBAN of the bank account.
+
+ is_default_for_currency : typing.Optional[bool]
+
+ name : typing.Optional[str]
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs.
+
+ routing_number : typing.Optional[str]
+ The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.bank_accounts.create(
+ counterpart_id="counterpart_id",
+ country="AF",
+ currency="AED",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts",
+ method="POST",
+ json={
+ "account_holder_name": account_holder_name,
+ "account_number": account_number,
+ "bic": bic,
+ "country": country,
+ "currency": currency,
+ "iban": iban,
+ "is_default_for_currency": is_default_for_currency,
+ "name": name,
+ "partner_metadata": partner_metadata,
+ "routing_number": routing_number,
+ "sort_code": sort_code,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResponse,
+ parse_obj_as(
+ type_=CounterpartBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, bank_account_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartBankAccountResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.bank_accounts.get_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResponse,
+ parse_obj_as(
+ type_=CounterpartBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, bank_account_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.bank_accounts.delete_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ bank_account_id: str,
+ counterpart_id: str,
+ *,
+ account_holder_name: typing.Optional[str] = OMIT,
+ account_number: typing.Optional[str] = OMIT,
+ bic: typing.Optional[str] = OMIT,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ iban: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ routing_number: typing.Optional[str] = OMIT,
+ sort_code: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartBankAccountResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+ bic : typing.Optional[str]
+ The BIC/SWIFT code of the bank.
+
+ country : typing.Optional[AllowedCountries]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ iban : typing.Optional[str]
+ The IBAN of the bank account.
+
+ name : typing.Optional[str]
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs.
+
+ routing_number : typing.Optional[str]
+ The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.bank_accounts.update_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="PATCH",
+ json={
+ "account_holder_name": account_holder_name,
+ "account_number": account_number,
+ "bic": bic,
+ "country": country,
+ "currency": currency,
+ "iban": iban,
+ "name": name,
+ "partner_metadata": partner_metadata,
+ "routing_number": routing_number,
+ "sort_code": sort_code,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResponse,
+ parse_obj_as(
+ type_=CounterpartBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def make_default_by_id(
+ self, bank_account_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.Optional[typing.Any]:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.Optional[typing.Any]
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.bank_accounts.make_default_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ typing.Optional[typing.Any],
+ parse_obj_as(
+ type_=typing.Optional[typing.Any], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncBankAccountsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartBankAccountResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.bank_accounts.get(
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResourceList,
+ parse_obj_as(
+ type_=CounterpartBankAccountResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ counterpart_id: str,
+ *,
+ country: AllowedCountries,
+ currency: CurrencyEnum,
+ account_holder_name: typing.Optional[str] = OMIT,
+ account_number: typing.Optional[str] = OMIT,
+ bic: typing.Optional[str] = OMIT,
+ iban: typing.Optional[str] = OMIT,
+ is_default_for_currency: typing.Optional[bool] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ routing_number: typing.Optional[str] = OMIT,
+ sort_code: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartBankAccountResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ country : AllowedCountries
+
+ currency : CurrencyEnum
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+ bic : typing.Optional[str]
+ The BIC/SWIFT code of the bank.
+
+ iban : typing.Optional[str]
+ The IBAN of the bank account.
+
+ is_default_for_currency : typing.Optional[bool]
+
+ name : typing.Optional[str]
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs.
+
+ routing_number : typing.Optional[str]
+ The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.bank_accounts.create(
+ counterpart_id="counterpart_id",
+ country="AF",
+ currency="AED",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts",
+ method="POST",
+ json={
+ "account_holder_name": account_holder_name,
+ "account_number": account_number,
+ "bic": bic,
+ "country": country,
+ "currency": currency,
+ "iban": iban,
+ "is_default_for_currency": is_default_for_currency,
+ "name": name,
+ "partner_metadata": partner_metadata,
+ "routing_number": routing_number,
+ "sort_code": sort_code,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResponse,
+ parse_obj_as(
+ type_=CounterpartBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, bank_account_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartBankAccountResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.bank_accounts.get_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResponse,
+ parse_obj_as(
+ type_=CounterpartBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, bank_account_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.bank_accounts.delete_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ bank_account_id: str,
+ counterpart_id: str,
+ *,
+ account_holder_name: typing.Optional[str] = OMIT,
+ account_number: typing.Optional[str] = OMIT,
+ bic: typing.Optional[str] = OMIT,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ iban: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ routing_number: typing.Optional[str] = OMIT,
+ sort_code: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartBankAccountResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+ bic : typing.Optional[str]
+ The BIC/SWIFT code of the bank.
+
+ country : typing.Optional[AllowedCountries]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ iban : typing.Optional[str]
+ The IBAN of the bank account.
+
+ name : typing.Optional[str]
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs.
+
+ routing_number : typing.Optional[str]
+ The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.bank_accounts.update_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="PATCH",
+ json={
+ "account_holder_name": account_holder_name,
+ "account_number": account_number,
+ "bic": bic,
+ "country": country,
+ "currency": currency,
+ "iban": iban,
+ "name": name,
+ "partner_metadata": partner_metadata,
+ "routing_number": routing_number,
+ "sort_code": sort_code,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartBankAccountResponse,
+ parse_obj_as(
+ type_=CounterpartBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def make_default_by_id(
+ self, bank_account_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.Optional[typing.Any]:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.Optional[typing.Any]
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.bank_accounts.make_default_by_id(
+ bank_account_id="bank_account_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/bank_accounts/{jsonable_encoder(bank_account_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ typing.Optional[typing.Any],
+ parse_obj_as(
+ type_=typing.Optional[typing.Any], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/counterparts/client.py b/src/monite/counterparts/client.py
new file mode 100644
index 0000000..916bb32
--- /dev/null
+++ b/src/monite/counterparts/client.py
@@ -0,0 +1,1501 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from .addresses.client import AddressesClient
+from .bank_accounts.client import BankAccountsClient
+from .contacts.client import ContactsClient
+from .vat_ids.client import VatIdsClient
+from ..types.order_enum import OrderEnum
+from ..types.counterpart_cursor_fields import CounterpartCursorFields
+from ..types.counterpart_type import CounterpartType
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.counterpart_pagination_response import CounterpartPaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.not_found_error import NotFoundError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.counterpart_create_payload import CounterpartCreatePayload
+from ..types.counterpart_response import CounterpartResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..core.jsonable_encoder import jsonable_encoder
+from ..types.counterpart_update_payload import CounterpartUpdatePayload
+from ..types.partner_metadata_response import PartnerMetadataResponse
+from ..core.client_wrapper import AsyncClientWrapper
+from .addresses.client import AsyncAddressesClient
+from .bank_accounts.client import AsyncBankAccountsClient
+from .contacts.client import AsyncContactsClient
+from .vat_ids.client import AsyncVatIdsClient
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class CounterpartsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.addresses = AddressesClient(client_wrapper=self._client_wrapper)
+ self.bank_accounts = BankAccountsClient(client_wrapper=self._client_wrapper)
+ self.contacts = ContactsClient(client_wrapper=self._client_wrapper)
+ self.vat_ids = VatIdsClient(client_wrapper=self._client_wrapper)
+
+ def get(
+ self,
+ *,
+ iban: typing.Optional[str] = None,
+ sort_code: typing.Optional[str] = None,
+ account_number: typing.Optional[str] = None,
+ tax_id: typing.Optional[str] = None,
+ vat_id: typing.Optional[str] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[CounterpartCursorFields] = None,
+ type: typing.Optional[CounterpartType] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_iexact: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ is_vendor: typing.Optional[bool] = None,
+ is_customer: typing.Optional[bool] = None,
+ email: typing.Optional[str] = None,
+ email_contains: typing.Optional[str] = None,
+ email_icontains: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ address_country: typing.Optional[str] = None,
+ address_city: typing.Optional[str] = None,
+ address_postal_code: typing.Optional[str] = None,
+ address_state: typing.Optional[str] = None,
+ address_line1: typing.Optional[str] = None,
+ address_line2: typing.Optional[str] = None,
+ tag_ids_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartPaginationResponse:
+ """
+ Parameters
+ ----------
+ iban : typing.Optional[str]
+ The IBAN of the counterpart's bank account.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+ tax_id : typing.Optional[str]
+ The tax ID of the counterpart.
+
+ vat_id : typing.Optional[str]
+ The VAT ID of the counterpart.
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ A list of counterpart IDs to search through.
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[CounterpartCursorFields]
+ Allowed sort fields
+
+ type : typing.Optional[CounterpartType]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_iexact : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ is_vendor : typing.Optional[bool]
+
+ is_customer : typing.Optional[bool]
+
+ email : typing.Optional[str]
+
+ email_contains : typing.Optional[str]
+
+ email_icontains : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ address_country : typing.Optional[str]
+
+ address_city : typing.Optional[str]
+
+ address_postal_code : typing.Optional[str]
+
+ address_state : typing.Optional[str]
+
+ address_line1 : typing.Optional[str]
+
+ address_line2 : typing.Optional[str]
+
+ tag_ids_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.get(
+ sort_code="123456",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "counterparts",
+ method="GET",
+ params={
+ "iban": iban,
+ "sort_code": sort_code,
+ "account_number": account_number,
+ "tax_id": tax_id,
+ "vat_id": vat_id,
+ "id__in": id_in,
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "type": type,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__iexact": counterpart_name_iexact,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "is_vendor": is_vendor,
+ "is_customer": is_customer,
+ "email": email,
+ "email__contains": email_contains,
+ "email__icontains": email_icontains,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "address.country": address_country,
+ "address.city": address_city,
+ "address.postal_code": address_postal_code,
+ "address.state": address_state,
+ "address.line1": address_line1,
+ "address.line2": address_line2,
+ "tag_ids__in": tag_ids_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartPaginationResponse,
+ parse_obj_as(
+ type_=CounterpartPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self, *, request: CounterpartCreatePayload, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartResponse:
+ """
+ Parameters
+ ----------
+ request : CounterpartCreatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import (
+ CounterpartAddress,
+ CounterpartCreatePayload_Individual,
+ CounterpartIndividualCreatePayload,
+ Monite,
+ )
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.create(
+ request=CounterpartCreatePayload_Individual(
+ individual=CounterpartIndividualCreatePayload(
+ address=CounterpartAddress(
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ ),
+ first_name="Adnan",
+ is_customer=True,
+ is_vendor=True,
+ last_name="Singh",
+ ),
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "counterparts",
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=CounterpartCreatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartResponse,
+ parse_obj_as(
+ type_=CounterpartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.get_by_id(
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartResponse,
+ parse_obj_as(
+ type_=CounterpartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.delete_by_id(
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ counterpart_id: str,
+ *,
+ request: CounterpartUpdatePayload,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request : CounterpartUpdatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import (
+ CounterpartIndividualRootUpdatePayload,
+ CounterpartIndividualUpdatePayload,
+ Monite,
+ )
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.update_by_id(
+ counterpart_id="counterpart_id",
+ request=CounterpartIndividualRootUpdatePayload(
+ individual=CounterpartIndividualUpdatePayload(),
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}",
+ method="PATCH",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=CounterpartUpdatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartResponse,
+ parse_obj_as(
+ type_=CounterpartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_partner_metadata_by_id(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PartnerMetadataResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.get_partner_metadata_by_id(
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/partner_metadata",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_partner_metadata_by_id(
+ self,
+ counterpart_id: str,
+ *,
+ metadata: typing.Dict[str, typing.Optional[typing.Any]],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PartnerMetadataResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ metadata : typing.Dict[str, typing.Optional[typing.Any]]
+ Metadata for partner needs
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.update_partner_metadata_by_id(
+ counterpart_id="counterpart_id",
+ metadata={"key": "value"},
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/partner_metadata",
+ method="PUT",
+ json={
+ "metadata": metadata,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncCounterpartsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.addresses = AsyncAddressesClient(client_wrapper=self._client_wrapper)
+ self.bank_accounts = AsyncBankAccountsClient(client_wrapper=self._client_wrapper)
+ self.contacts = AsyncContactsClient(client_wrapper=self._client_wrapper)
+ self.vat_ids = AsyncVatIdsClient(client_wrapper=self._client_wrapper)
+
+ async def get(
+ self,
+ *,
+ iban: typing.Optional[str] = None,
+ sort_code: typing.Optional[str] = None,
+ account_number: typing.Optional[str] = None,
+ tax_id: typing.Optional[str] = None,
+ vat_id: typing.Optional[str] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[CounterpartCursorFields] = None,
+ type: typing.Optional[CounterpartType] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_iexact: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ is_vendor: typing.Optional[bool] = None,
+ is_customer: typing.Optional[bool] = None,
+ email: typing.Optional[str] = None,
+ email_contains: typing.Optional[str] = None,
+ email_icontains: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ address_country: typing.Optional[str] = None,
+ address_city: typing.Optional[str] = None,
+ address_postal_code: typing.Optional[str] = None,
+ address_state: typing.Optional[str] = None,
+ address_line1: typing.Optional[str] = None,
+ address_line2: typing.Optional[str] = None,
+ tag_ids_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartPaginationResponse:
+ """
+ Parameters
+ ----------
+ iban : typing.Optional[str]
+ The IBAN of the counterpart's bank account.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+
+ tax_id : typing.Optional[str]
+ The tax ID of the counterpart.
+
+ vat_id : typing.Optional[str]
+ The VAT ID of the counterpart.
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ A list of counterpart IDs to search through.
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[CounterpartCursorFields]
+ Allowed sort fields
+
+ type : typing.Optional[CounterpartType]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_iexact : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ is_vendor : typing.Optional[bool]
+
+ is_customer : typing.Optional[bool]
+
+ email : typing.Optional[str]
+
+ email_contains : typing.Optional[str]
+
+ email_icontains : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ address_country : typing.Optional[str]
+
+ address_city : typing.Optional[str]
+
+ address_postal_code : typing.Optional[str]
+
+ address_state : typing.Optional[str]
+
+ address_line1 : typing.Optional[str]
+
+ address_line2 : typing.Optional[str]
+
+ tag_ids_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.get(
+ sort_code="123456",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "counterparts",
+ method="GET",
+ params={
+ "iban": iban,
+ "sort_code": sort_code,
+ "account_number": account_number,
+ "tax_id": tax_id,
+ "vat_id": vat_id,
+ "id__in": id_in,
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "type": type,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__iexact": counterpart_name_iexact,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "is_vendor": is_vendor,
+ "is_customer": is_customer,
+ "email": email,
+ "email__contains": email_contains,
+ "email__icontains": email_icontains,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "address.country": address_country,
+ "address.city": address_city,
+ "address.postal_code": address_postal_code,
+ "address.state": address_state,
+ "address.line1": address_line1,
+ "address.line2": address_line2,
+ "tag_ids__in": tag_ids_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartPaginationResponse,
+ parse_obj_as(
+ type_=CounterpartPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self, *, request: CounterpartCreatePayload, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartResponse:
+ """
+ Parameters
+ ----------
+ request : CounterpartCreatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import (
+ AsyncMonite,
+ CounterpartAddress,
+ CounterpartCreatePayload_Individual,
+ CounterpartIndividualCreatePayload,
+ )
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.create(
+ request=CounterpartCreatePayload_Individual(
+ individual=CounterpartIndividualCreatePayload(
+ address=CounterpartAddress(
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ ),
+ first_name="Adnan",
+ is_customer=True,
+ is_vendor=True,
+ last_name="Singh",
+ ),
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "counterparts",
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=CounterpartCreatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartResponse,
+ parse_obj_as(
+ type_=CounterpartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.get_by_id(
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartResponse,
+ parse_obj_as(
+ type_=CounterpartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.delete_by_id(
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ counterpart_id: str,
+ *,
+ request: CounterpartUpdatePayload,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request : CounterpartUpdatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import (
+ AsyncMonite,
+ CounterpartIndividualRootUpdatePayload,
+ CounterpartIndividualUpdatePayload,
+ )
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.update_by_id(
+ counterpart_id="counterpart_id",
+ request=CounterpartIndividualRootUpdatePayload(
+ individual=CounterpartIndividualUpdatePayload(),
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}",
+ method="PATCH",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=CounterpartUpdatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartResponse,
+ parse_obj_as(
+ type_=CounterpartResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_partner_metadata_by_id(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PartnerMetadataResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.get_partner_metadata_by_id(
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/partner_metadata",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_partner_metadata_by_id(
+ self,
+ counterpart_id: str,
+ *,
+ metadata: typing.Dict[str, typing.Optional[typing.Any]],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PartnerMetadataResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ metadata : typing.Dict[str, typing.Optional[typing.Any]]
+ Metadata for partner needs
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.update_partner_metadata_by_id(
+ counterpart_id="counterpart_id",
+ metadata={"key": "value"},
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/partner_metadata",
+ method="PUT",
+ json={
+ "metadata": metadata,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/counterparts/contacts/__init__.py b/src/monite/counterparts/contacts/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/counterparts/contacts/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/counterparts/contacts/client.py b/src/monite/counterparts/contacts/client.py
new file mode 100644
index 0000000..92cd08b
--- /dev/null
+++ b/src/monite/counterparts/contacts/client.py
@@ -0,0 +1,1176 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.counterpart_contacts_resource_list import CounterpartContactsResourceList
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.counterpart_address import CounterpartAddress
+from ...types.counterpart_contact_response import CounterpartContactResponse
+from ...core.serialization import convert_and_respect_annotation_metadata
+from ...errors.not_found_error import NotFoundError
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ContactsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartContactsResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactsResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.contacts.get(
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactsResourceList,
+ parse_obj_as(
+ type_=CounterpartContactsResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ counterpart_id: str,
+ *,
+ address: CounterpartAddress,
+ first_name: str,
+ last_name: str,
+ email: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ address : CounterpartAddress
+ The address of a contact person.
+
+ first_name : str
+ The first name of a contact person.
+
+ last_name : str
+ The last name of a contact person.
+
+ email : typing.Optional[str]
+ The email address of a contact person.
+
+ phone : typing.Optional[str]
+ The phone number of a contact person
+
+ title : typing.Optional[str]
+ The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import CounterpartAddress, Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.contacts.create(
+ counterpart_id="counterpart_id",
+ address=CounterpartAddress(
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ ),
+ first_name="Mary",
+ last_name="O'Brien",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts",
+ method="POST",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=CounterpartAddress, direction="write"
+ ),
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "phone": phone,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, contact_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.contacts.get_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, contact_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.contacts.delete_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ contact_id: str,
+ counterpart_id: str,
+ *,
+ address: typing.Optional[CounterpartAddress] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ address : typing.Optional[CounterpartAddress]
+ The address of a contact person.
+
+ email : typing.Optional[str]
+ The email address of a contact person.
+
+ first_name : typing.Optional[str]
+ The first name of a contact person.
+
+ last_name : typing.Optional[str]
+ The last name of a contact person.
+
+ phone : typing.Optional[str]
+ The phone number of a contact person
+
+ title : typing.Optional[str]
+ The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.contacts.update_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=CounterpartAddress, direction="write"
+ ),
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "phone": phone,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def make_default_by_id(
+ self, contact_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.contacts.make_default_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncContactsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartContactsResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactsResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.contacts.get(
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactsResourceList,
+ parse_obj_as(
+ type_=CounterpartContactsResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ counterpart_id: str,
+ *,
+ address: CounterpartAddress,
+ first_name: str,
+ last_name: str,
+ email: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ address : CounterpartAddress
+ The address of a contact person.
+
+ first_name : str
+ The first name of a contact person.
+
+ last_name : str
+ The last name of a contact person.
+
+ email : typing.Optional[str]
+ The email address of a contact person.
+
+ phone : typing.Optional[str]
+ The phone number of a contact person
+
+ title : typing.Optional[str]
+ The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, CounterpartAddress
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.contacts.create(
+ counterpart_id="counterpart_id",
+ address=CounterpartAddress(
+ city="Berlin",
+ country="AF",
+ line1="Flughafenstrasse 52",
+ postal_code="10115",
+ ),
+ first_name="Mary",
+ last_name="O'Brien",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts",
+ method="POST",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=CounterpartAddress, direction="write"
+ ),
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "phone": phone,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, contact_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.contacts.get_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, contact_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.contacts.delete_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ contact_id: str,
+ counterpart_id: str,
+ *,
+ address: typing.Optional[CounterpartAddress] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ address : typing.Optional[CounterpartAddress]
+ The address of a contact person.
+
+ email : typing.Optional[str]
+ The email address of a contact person.
+
+ first_name : typing.Optional[str]
+ The first name of a contact person.
+
+ last_name : typing.Optional[str]
+ The last name of a contact person.
+
+ phone : typing.Optional[str]
+ The phone number of a contact person
+
+ title : typing.Optional[str]
+ The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.contacts.update_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=CounterpartAddress, direction="write"
+ ),
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "phone": phone,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def make_default_by_id(
+ self, contact_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartContactResponse:
+ """
+ Parameters
+ ----------
+ contact_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartContactResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.contacts.make_default_by_id(
+ contact_id="contact_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/contacts/{jsonable_encoder(contact_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartContactResponse,
+ parse_obj_as(
+ type_=CounterpartContactResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/counterparts/vat_ids/__init__.py b/src/monite/counterparts/vat_ids/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/counterparts/vat_ids/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/counterparts/vat_ids/client.py b/src/monite/counterparts/vat_ids/client.py
new file mode 100644
index 0000000..a58f719
--- /dev/null
+++ b/src/monite/counterparts/vat_ids/client.py
@@ -0,0 +1,912 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.counterpart_vat_id_resource_list import CounterpartVatIdResourceList
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.allowed_countries import AllowedCountries
+from ...types.vat_id_type_enum import VatIdTypeEnum
+from ...types.counterpart_vat_id_response import CounterpartVatIdResponse
+from ...errors.not_found_error import NotFoundError
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class VatIdsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartVatIdResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.vat_ids.get(
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResourceList,
+ parse_obj_as(
+ type_=CounterpartVatIdResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ counterpart_id: str,
+ *,
+ value: str,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartVatIdResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ value : str
+
+ country : typing.Optional[AllowedCountries]
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.vat_ids.create(
+ counterpart_id="counterpart_id",
+ value="123456789",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids",
+ method="POST",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResponse,
+ parse_obj_as(
+ type_=CounterpartVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, vat_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartVatIdResponse:
+ """
+ Parameters
+ ----------
+ vat_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.vat_ids.get_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids/{jsonable_encoder(vat_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResponse,
+ parse_obj_as(
+ type_=CounterpartVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, vat_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ vat_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.vat_ids.delete_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids/{jsonable_encoder(vat_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ vat_id: str,
+ counterpart_id: str,
+ *,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ value: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartVatIdResponse:
+ """
+ Parameters
+ ----------
+ vat_id : str
+
+ counterpart_id : str
+
+ country : typing.Optional[AllowedCountries]
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ value : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.counterparts.vat_ids.update_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids/{jsonable_encoder(vat_id)}",
+ method="PATCH",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResponse,
+ parse_obj_as(
+ type_=CounterpartVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncVatIdsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartVatIdResourceList:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.vat_ids.get(
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResourceList,
+ parse_obj_as(
+ type_=CounterpartVatIdResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ counterpart_id: str,
+ *,
+ value: str,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartVatIdResponse:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+
+ value : str
+
+ country : typing.Optional[AllowedCountries]
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.vat_ids.create(
+ counterpart_id="counterpart_id",
+ value="123456789",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids",
+ method="POST",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResponse,
+ parse_obj_as(
+ type_=CounterpartVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, vat_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CounterpartVatIdResponse:
+ """
+ Parameters
+ ----------
+ vat_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.vat_ids.get_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids/{jsonable_encoder(vat_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResponse,
+ parse_obj_as(
+ type_=CounterpartVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, vat_id: str, counterpart_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ vat_id : str
+
+ counterpart_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.vat_ids.delete_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids/{jsonable_encoder(vat_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ vat_id: str,
+ counterpart_id: str,
+ *,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ value: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CounterpartVatIdResponse:
+ """
+ Parameters
+ ----------
+ vat_id : str
+
+ counterpart_id : str
+
+ country : typing.Optional[AllowedCountries]
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ value : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CounterpartVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.counterparts.vat_ids.update_by_id(
+ vat_id="vat_id",
+ counterpart_id="counterpart_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"counterparts/{jsonable_encoder(counterpart_id)}/vat_ids/{jsonable_encoder(vat_id)}",
+ method="PATCH",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CounterpartVatIdResponse,
+ parse_obj_as(
+ type_=CounterpartVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/data_exports/__init__.py b/src/monite/data_exports/__init__.py
new file mode 100644
index 0000000..4943ee9
--- /dev/null
+++ b/src/monite/data_exports/__init__.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from . import extra_data
+
+__all__ = ["extra_data"]
diff --git a/src/monite/data_exports/client.py b/src/monite/data_exports/client.py
new file mode 100644
index 0000000..9ba7456
--- /dev/null
+++ b/src/monite/data_exports/client.py
@@ -0,0 +1,1012 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from .extra_data.client import ExtraDataClient
+from ..types.order_enum import OrderEnum
+from ..types.data_export_cursor_fields import DataExportCursorFields
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.all_document_export_response_schema import AllDocumentExportResponseSchema
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.export_format import ExportFormat
+from ..types.export_object_schema import ExportObjectSchema
+from ..types.create_export_task_response_schema import CreateExportTaskResponseSchema
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..errors.not_found_error import NotFoundError
+from ..errors.conflict_error import ConflictError
+from ..types.supported_format_schema import SupportedFormatSchema
+from ..types.document_export_response_schema import DocumentExportResponseSchema
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+from .extra_data.client import AsyncExtraDataClient
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class DataExportsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.extra_data = ExtraDataClient(client_wrapper=self._client_wrapper)
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[DataExportCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ created_by_entity_user_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AllDocumentExportResponseSchema:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[DataExportCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ created_by_entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AllDocumentExportResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "data_exports",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "created_by_entity_user_id": created_by_entity_user_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AllDocumentExportResponseSchema,
+ parse_obj_as(
+ type_=AllDocumentExportResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ date_from: str,
+ date_to: str,
+ format: ExportFormat,
+ objects: typing.Sequence[ExportObjectSchema],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CreateExportTaskResponseSchema:
+ """
+ Parameters
+ ----------
+ date_from : str
+
+ date_to : str
+
+ format : ExportFormat
+
+ objects : typing.Sequence[ExportObjectSchema]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CreateExportTaskResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import ExportObjectSchema_Receivable, Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.create(
+ date_from="date_from",
+ date_to="date_to",
+ format="csv",
+ objects=[
+ ExportObjectSchema_Receivable(
+ statuses=["draft"],
+ )
+ ],
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "data_exports",
+ method="POST",
+ json={
+ "date_from": date_from,
+ "date_to": date_to,
+ "format": format,
+ "objects": convert_and_respect_annotation_metadata(
+ object_=objects, annotation=typing.Sequence[ExportObjectSchema], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CreateExportTaskResponseSchema,
+ parse_obj_as(
+ type_=CreateExportTaskResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_supported_formats(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.List[SupportedFormatSchema]:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.List[SupportedFormatSchema]
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.get_supported_formats()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "data_exports/supported_formats",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ typing.List[SupportedFormatSchema],
+ parse_obj_as(
+ type_=typing.List[SupportedFormatSchema], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, document_export_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> DocumentExportResponseSchema:
+ """
+ Parameters
+ ----------
+ document_export_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DocumentExportResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.get_by_id(
+ document_export_id="document_export_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"data_exports/{jsonable_encoder(document_export_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ DocumentExportResponseSchema,
+ parse_obj_as(
+ type_=DocumentExportResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncDataExportsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.extra_data = AsyncExtraDataClient(client_wrapper=self._client_wrapper)
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[DataExportCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ created_by_entity_user_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> AllDocumentExportResponseSchema:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[DataExportCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ created_by_entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AllDocumentExportResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "data_exports",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "created_by_entity_user_id": created_by_entity_user_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AllDocumentExportResponseSchema,
+ parse_obj_as(
+ type_=AllDocumentExportResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ date_from: str,
+ date_to: str,
+ format: ExportFormat,
+ objects: typing.Sequence[ExportObjectSchema],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CreateExportTaskResponseSchema:
+ """
+ Parameters
+ ----------
+ date_from : str
+
+ date_to : str
+
+ format : ExportFormat
+
+ objects : typing.Sequence[ExportObjectSchema]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CreateExportTaskResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, ExportObjectSchema_Receivable
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.create(
+ date_from="date_from",
+ date_to="date_to",
+ format="csv",
+ objects=[
+ ExportObjectSchema_Receivable(
+ statuses=["draft"],
+ )
+ ],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "data_exports",
+ method="POST",
+ json={
+ "date_from": date_from,
+ "date_to": date_to,
+ "format": format,
+ "objects": convert_and_respect_annotation_metadata(
+ object_=objects, annotation=typing.Sequence[ExportObjectSchema], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CreateExportTaskResponseSchema,
+ parse_obj_as(
+ type_=CreateExportTaskResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_supported_formats(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.List[SupportedFormatSchema]:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ typing.List[SupportedFormatSchema]
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.get_supported_formats()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "data_exports/supported_formats",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ typing.List[SupportedFormatSchema],
+ parse_obj_as(
+ type_=typing.List[SupportedFormatSchema], # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, document_export_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> DocumentExportResponseSchema:
+ """
+ Parameters
+ ----------
+ document_export_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DocumentExportResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.get_by_id(
+ document_export_id="document_export_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"data_exports/{jsonable_encoder(document_export_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ DocumentExportResponseSchema,
+ parse_obj_as(
+ type_=DocumentExportResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/data_exports/extra_data/__init__.py b/src/monite/data_exports/extra_data/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/data_exports/extra_data/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/data_exports/extra_data/client.py b/src/monite/data_exports/extra_data/client.py
new file mode 100644
index 0000000..6898898
--- /dev/null
+++ b/src/monite/data_exports/extra_data/client.py
@@ -0,0 +1,1266 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...types.order_enum import OrderEnum
+from ...types.export_setting_cursor_fields import ExportSettingCursorFields
+import datetime as dt
+from ...core.request_options import RequestOptions
+from ...types.extra_data_resource_list import ExtraDataResourceList
+from ...core.datetime_utils import serialize_datetime
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unauthorized_error import UnauthorizedError
+from ...types.error_schema_response import ErrorSchemaResponse
+from ...errors.forbidden_error import ForbiddenError
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.supported_field_names import SupportedFieldNames
+from ...types.extra_data_resource import ExtraDataResource
+from ...errors.bad_request_error import BadRequestError
+from ...core.jsonable_encoder import jsonable_encoder
+from ...errors.not_found_error import NotFoundError
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ExtraDataClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ExportSettingCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ object_id: typing.Optional[str] = None,
+ field_name: typing.Optional[str] = None,
+ field_value: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ExtraDataResourceList:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ExportSettingCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ object_id : typing.Optional[str]
+
+ field_name : typing.Optional[str]
+
+ field_value : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.extra_data.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "data_exports/extra_data",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ "object_id": object_id,
+ "field_name": field_name,
+ "field_value": field_value,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResourceList,
+ parse_obj_as(
+ type_=ExtraDataResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ field_name: SupportedFieldNames,
+ field_value: str,
+ object_id: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ field_name : SupportedFieldNames
+
+ field_value : str
+
+ object_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.extra_data.create(
+ field_name="default_account_code",
+ field_value="field_value",
+ object_id="object_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "data_exports/extra_data",
+ method="POST",
+ json={
+ "field_name": field_name,
+ "field_value": field_value,
+ "object_id": object_id,
+ "object_type": "counterpart",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, extra_data_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ extra_data_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.extra_data.get_by_id(
+ extra_data_id="extra_data_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"data_exports/extra_data/{jsonable_encoder(extra_data_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, extra_data_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ extra_data_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.extra_data.delete_by_id(
+ extra_data_id="extra_data_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"data_exports/extra_data/{jsonable_encoder(extra_data_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ extra_data_id: str,
+ *,
+ field_name: typing.Optional[SupportedFieldNames] = OMIT,
+ field_value: typing.Optional[str] = OMIT,
+ object_id: typing.Optional[str] = OMIT,
+ object_type: typing.Optional[typing.Literal["counterpart"]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ extra_data_id : str
+
+ field_name : typing.Optional[SupportedFieldNames]
+
+ field_value : typing.Optional[str]
+
+ object_id : typing.Optional[str]
+
+ object_type : typing.Optional[typing.Literal["counterpart"]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.data_exports.extra_data.update_by_id(
+ extra_data_id="extra_data_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"data_exports/extra_data/{jsonable_encoder(extra_data_id)}",
+ method="PATCH",
+ json={
+ "field_name": field_name,
+ "field_value": field_value,
+ "object_id": object_id,
+ "object_type": object_type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncExtraDataClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ExportSettingCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ object_id: typing.Optional[str] = None,
+ field_name: typing.Optional[str] = None,
+ field_value: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ExtraDataResourceList:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ExportSettingCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ object_id : typing.Optional[str]
+
+ field_name : typing.Optional[str]
+
+ field_value : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.extra_data.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "data_exports/extra_data",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ "object_id": object_id,
+ "field_name": field_name,
+ "field_value": field_value,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResourceList,
+ parse_obj_as(
+ type_=ExtraDataResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ field_name: SupportedFieldNames,
+ field_value: str,
+ object_id: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ field_name : SupportedFieldNames
+
+ field_value : str
+
+ object_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.extra_data.create(
+ field_name="default_account_code",
+ field_value="field_value",
+ object_id="object_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "data_exports/extra_data",
+ method="POST",
+ json={
+ "field_name": field_name,
+ "field_value": field_value,
+ "object_id": object_id,
+ "object_type": "counterpart",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, extra_data_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ extra_data_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.extra_data.get_by_id(
+ extra_data_id="extra_data_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"data_exports/extra_data/{jsonable_encoder(extra_data_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, extra_data_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ extra_data_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.extra_data.delete_by_id(
+ extra_data_id="extra_data_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"data_exports/extra_data/{jsonable_encoder(extra_data_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ extra_data_id: str,
+ *,
+ field_name: typing.Optional[SupportedFieldNames] = OMIT,
+ field_value: typing.Optional[str] = OMIT,
+ object_id: typing.Optional[str] = OMIT,
+ object_type: typing.Optional[typing.Literal["counterpart"]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ExtraDataResource:
+ """
+ Parameters
+ ----------
+ extra_data_id : str
+
+ field_name : typing.Optional[SupportedFieldNames]
+
+ field_value : typing.Optional[str]
+
+ object_id : typing.Optional[str]
+
+ object_type : typing.Optional[typing.Literal["counterpart"]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ExtraDataResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.data_exports.extra_data.update_by_id(
+ extra_data_id="extra_data_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"data_exports/extra_data/{jsonable_encoder(extra_data_id)}",
+ method="PATCH",
+ json={
+ "field_name": field_name,
+ "field_value": field_value,
+ "object_id": object_id,
+ "object_type": object_type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ExtraDataResource,
+ parse_obj_as(
+ type_=ExtraDataResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/entities/__init__.py b/src/monite/entities/__init__.py
new file mode 100644
index 0000000..1f02ce8
--- /dev/null
+++ b/src/monite/entities/__init__.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from . import bank_accounts, onboarding_data, payment_methods, persons, vat_ids
+
+__all__ = ["bank_accounts", "onboarding_data", "payment_methods", "persons", "vat_ids"]
diff --git a/src/monite/entities/bank_accounts/__init__.py b/src/monite/entities/bank_accounts/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/entities/bank_accounts/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/entities/bank_accounts/client.py b/src/monite/entities/bank_accounts/client.py
new file mode 100644
index 0000000..9460eaa
--- /dev/null
+++ b/src/monite/entities/bank_accounts/client.py
@@ -0,0 +1,2128 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.entity_bank_account_pagination_response import EntityBankAccountPaginationResponse
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.conflict_error import ConflictError
+from ...types.error_schema_response import ErrorSchemaResponse
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.allowed_countries import AllowedCountries
+from ...types.currency_enum import CurrencyEnum
+from ...types.entity_bank_account_response import EntityBankAccountResponse
+from ...types.complete_verification_airwallex_plaid_request import CompleteVerificationAirwallexPlaidRequest
+from ...types.complete_verification_response import CompleteVerificationResponse
+from ...core.serialization import convert_and_respect_annotation_metadata
+from ...types.verification_airwallex_plaid_request import VerificationAirwallexPlaidRequest
+from ...types.verification_response import VerificationResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...errors.not_found_error import NotFoundError
+from ...types.complete_refresh_verification_response import CompleteRefreshVerificationResponse
+from ...types.bank_account_verifications import BankAccountVerifications
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class BankAccountsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> EntityBankAccountPaginationResponse:
+ """
+ Get all bank accounts of this entity.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "bank_accounts",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountPaginationResponse,
+ parse_obj_as(
+ type_=EntityBankAccountPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ country: AllowedCountries,
+ currency: CurrencyEnum,
+ account_holder_name: typing.Optional[str] = OMIT,
+ account_number: typing.Optional[str] = OMIT,
+ bank_name: typing.Optional[str] = OMIT,
+ bic: typing.Optional[str] = OMIT,
+ display_name: typing.Optional[str] = OMIT,
+ iban: typing.Optional[str] = OMIT,
+ is_default_for_currency: typing.Optional[bool] = OMIT,
+ routing_number: typing.Optional[str] = OMIT,
+ sort_code: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityBankAccountResponse:
+ """
+ Add a new bank account for the specified entity.
+
+ The minimum required fields are `currency` and `country`. Other required fields depend on the currency:
+
+ - EUR accounts require `iban`.
+ - GBP accounts require `account_holder_name`, `account_number`, and `sort_code`.
+ - USD accounts require `account_holder_name`, `account_number`, and `routing_number`.
+ - Accounts in other currencies require one of:
+ - `iban`
+ - `account_number` and `sort_code`
+ - `account_number` and `routing_number`
+
+ Parameters
+ ----------
+ country : AllowedCountries
+ The country in which the bank account is registered, repsesented as a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+ currency : CurrencyEnum
+ The currency of the bank account, represented as a three-letter ISO [currency code](https://docs.monite.com/docs/currencies).
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. Required if the account currency is GBP or USD.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required if the account currency is GBP or USD. UK account numbers typically contain 8 digits. US bank account numbers contain 9 to 12 digits.
+
+ bank_name : typing.Optional[str]
+ The bank name.
+
+ bic : typing.Optional[str]
+ The SWIFT/BIC code of the bank.
+
+ display_name : typing.Optional[str]
+ User-defined name of this bank account, such as 'Primary account' or 'Savings account'.
+
+ iban : typing.Optional[str]
+ The IBAN of the bank account. Required if the account currency is EUR.
+
+ is_default_for_currency : typing.Optional[bool]
+ If set to `true` or if this is the first bank account added for the given currency, this account becomes the default one for its currency.
+
+ routing_number : typing.Optional[str]
+ The bank's routing transit number (RTN). Required if the account currency is USD. US routing numbers consist of 9 digits.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code. Required if the account currency is GBP.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.create(
+ country="AF",
+ currency="AED",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "bank_accounts",
+ method="POST",
+ json={
+ "account_holder_name": account_holder_name,
+ "account_number": account_number,
+ "bank_name": bank_name,
+ "bic": bic,
+ "country": country,
+ "currency": currency,
+ "display_name": display_name,
+ "iban": iban,
+ "is_default_for_currency": is_default_for_currency,
+ "routing_number": routing_number,
+ "sort_code": sort_code,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def complete_verification(
+ self,
+ *,
+ airwallex_plaid: CompleteVerificationAirwallexPlaidRequest,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CompleteVerificationResponse:
+ """
+ Parameters
+ ----------
+ airwallex_plaid : CompleteVerificationAirwallexPlaidRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CompleteVerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import (
+ AirwallexMandate,
+ AirwallexPlaidAccount,
+ AirwallexPlaidInstitution,
+ CompleteVerificationAirwallexPlaidRequest,
+ Monite,
+ )
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.complete_verification(
+ airwallex_plaid=CompleteVerificationAirwallexPlaidRequest(
+ account=AirwallexPlaidAccount(
+ id="id",
+ mask="mask",
+ name="name",
+ ),
+ institution=AirwallexPlaidInstitution(
+ id="id",
+ name="name",
+ ),
+ mandate=AirwallexMandate(
+ email="email",
+ signatory="signatory",
+ ),
+ public_token="public_token",
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "bank_accounts/complete_verification",
+ method="POST",
+ json={
+ "airwallex_plaid": convert_and_respect_annotation_metadata(
+ object_=airwallex_plaid, annotation=CompleteVerificationAirwallexPlaidRequest, direction="write"
+ ),
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CompleteVerificationResponse,
+ parse_obj_as(
+ type_=CompleteVerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def start_verification(
+ self,
+ *,
+ airwallex_plaid: VerificationAirwallexPlaidRequest,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VerificationResponse:
+ """
+ Start entity bank account verification. The flow depends on verification type.
+ For airwallex_plaid it generates Plaid Link token to init the Plaid SDK.
+
+ Parameters
+ ----------
+ airwallex_plaid : VerificationAirwallexPlaidRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite, VerificationAirwallexPlaidRequest
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.start_verification(
+ airwallex_plaid=VerificationAirwallexPlaidRequest(
+ client_name="client_name",
+ redirect_url="redirect_url",
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "bank_accounts/start_verification",
+ method="POST",
+ json={
+ "airwallex_plaid": convert_and_respect_annotation_metadata(
+ object_=airwallex_plaid, annotation=VerificationAirwallexPlaidRequest, direction="write"
+ ),
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VerificationResponse,
+ parse_obj_as(
+ type_=VerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityBankAccountResponse:
+ """
+ Retrieve a bank account by its ID.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.get_by_id(
+ bank_account_id="bank_account_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete the bank account specified by its ID.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.delete_by_id(
+ bank_account_id="bank_account_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ bank_account_id: str,
+ *,
+ account_holder_name: typing.Optional[str] = OMIT,
+ display_name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityBankAccountResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. If the account currency is GBP or USD, the holder name cannot be changed to an empty string.
+
+ display_name : typing.Optional[str]
+ User-defined name of this bank account, such as 'Primary account' or 'Savings account'.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.update_by_id(
+ bank_account_id="bank_account_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="PATCH",
+ json={
+ "account_holder_name": account_holder_name,
+ "display_name": display_name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def complete_verification_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CompleteRefreshVerificationResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CompleteRefreshVerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.complete_verification_by_id(
+ bank_account_id="bank_account_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/complete_verification",
+ method="POST",
+ json={
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CompleteRefreshVerificationResponse,
+ parse_obj_as(
+ type_=CompleteRefreshVerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def make_default_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityBankAccountResponse:
+ """
+ Set a bank account as the default for this entity per currency.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.make_default_by_id(
+ bank_account_id="bank_account_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def refresh_verification_by_id(
+ self,
+ bank_account_id: str,
+ *,
+ airwallex_plaid: VerificationAirwallexPlaidRequest,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VerificationResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ airwallex_plaid : VerificationAirwallexPlaidRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite, VerificationAirwallexPlaidRequest
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.refresh_verification_by_id(
+ bank_account_id="bank_account_id",
+ airwallex_plaid=VerificationAirwallexPlaidRequest(
+ client_name="client_name",
+ redirect_url="redirect_url",
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/refresh_verification",
+ method="POST",
+ json={
+ "airwallex_plaid": convert_and_respect_annotation_metadata(
+ object_=airwallex_plaid, annotation=VerificationAirwallexPlaidRequest, direction="write"
+ ),
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VerificationResponse,
+ parse_obj_as(
+ type_=VerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_verifications_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> BankAccountVerifications:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ BankAccountVerifications
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.bank_accounts.get_verifications_by_id(
+ bank_account_id="bank_account_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/verifications",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ BankAccountVerifications,
+ parse_obj_as(
+ type_=BankAccountVerifications, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncBankAccountsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityBankAccountPaginationResponse:
+ """
+ Get all bank accounts of this entity.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "bank_accounts",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountPaginationResponse,
+ parse_obj_as(
+ type_=EntityBankAccountPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ country: AllowedCountries,
+ currency: CurrencyEnum,
+ account_holder_name: typing.Optional[str] = OMIT,
+ account_number: typing.Optional[str] = OMIT,
+ bank_name: typing.Optional[str] = OMIT,
+ bic: typing.Optional[str] = OMIT,
+ display_name: typing.Optional[str] = OMIT,
+ iban: typing.Optional[str] = OMIT,
+ is_default_for_currency: typing.Optional[bool] = OMIT,
+ routing_number: typing.Optional[str] = OMIT,
+ sort_code: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityBankAccountResponse:
+ """
+ Add a new bank account for the specified entity.
+
+ The minimum required fields are `currency` and `country`. Other required fields depend on the currency:
+
+ - EUR accounts require `iban`.
+ - GBP accounts require `account_holder_name`, `account_number`, and `sort_code`.
+ - USD accounts require `account_holder_name`, `account_number`, and `routing_number`.
+ - Accounts in other currencies require one of:
+ - `iban`
+ - `account_number` and `sort_code`
+ - `account_number` and `routing_number`
+
+ Parameters
+ ----------
+ country : AllowedCountries
+ The country in which the bank account is registered, repsesented as a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+
+ currency : CurrencyEnum
+ The currency of the bank account, represented as a three-letter ISO [currency code](https://docs.monite.com/docs/currencies).
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. Required if the account currency is GBP or USD.
+
+ account_number : typing.Optional[str]
+ The bank account number. Required if the account currency is GBP or USD. UK account numbers typically contain 8 digits. US bank account numbers contain 9 to 12 digits.
+
+ bank_name : typing.Optional[str]
+ The bank name.
+
+ bic : typing.Optional[str]
+ The SWIFT/BIC code of the bank.
+
+ display_name : typing.Optional[str]
+ User-defined name of this bank account, such as 'Primary account' or 'Savings account'.
+
+ iban : typing.Optional[str]
+ The IBAN of the bank account. Required if the account currency is EUR.
+
+ is_default_for_currency : typing.Optional[bool]
+ If set to `true` or if this is the first bank account added for the given currency, this account becomes the default one for its currency.
+
+ routing_number : typing.Optional[str]
+ The bank's routing transit number (RTN). Required if the account currency is USD. US routing numbers consist of 9 digits.
+
+ sort_code : typing.Optional[str]
+ The bank's sort code. Required if the account currency is GBP.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.create(
+ country="AF",
+ currency="AED",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "bank_accounts",
+ method="POST",
+ json={
+ "account_holder_name": account_holder_name,
+ "account_number": account_number,
+ "bank_name": bank_name,
+ "bic": bic,
+ "country": country,
+ "currency": currency,
+ "display_name": display_name,
+ "iban": iban,
+ "is_default_for_currency": is_default_for_currency,
+ "routing_number": routing_number,
+ "sort_code": sort_code,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def complete_verification(
+ self,
+ *,
+ airwallex_plaid: CompleteVerificationAirwallexPlaidRequest,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CompleteVerificationResponse:
+ """
+ Parameters
+ ----------
+ airwallex_plaid : CompleteVerificationAirwallexPlaidRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CompleteVerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import (
+ AirwallexMandate,
+ AirwallexPlaidAccount,
+ AirwallexPlaidInstitution,
+ AsyncMonite,
+ CompleteVerificationAirwallexPlaidRequest,
+ )
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.complete_verification(
+ airwallex_plaid=CompleteVerificationAirwallexPlaidRequest(
+ account=AirwallexPlaidAccount(
+ id="id",
+ mask="mask",
+ name="name",
+ ),
+ institution=AirwallexPlaidInstitution(
+ id="id",
+ name="name",
+ ),
+ mandate=AirwallexMandate(
+ email="email",
+ signatory="signatory",
+ ),
+ public_token="public_token",
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "bank_accounts/complete_verification",
+ method="POST",
+ json={
+ "airwallex_plaid": convert_and_respect_annotation_metadata(
+ object_=airwallex_plaid, annotation=CompleteVerificationAirwallexPlaidRequest, direction="write"
+ ),
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CompleteVerificationResponse,
+ parse_obj_as(
+ type_=CompleteVerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def start_verification(
+ self,
+ *,
+ airwallex_plaid: VerificationAirwallexPlaidRequest,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VerificationResponse:
+ """
+ Start entity bank account verification. The flow depends on verification type.
+ For airwallex_plaid it generates Plaid Link token to init the Plaid SDK.
+
+ Parameters
+ ----------
+ airwallex_plaid : VerificationAirwallexPlaidRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, VerificationAirwallexPlaidRequest
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.start_verification(
+ airwallex_plaid=VerificationAirwallexPlaidRequest(
+ client_name="client_name",
+ redirect_url="redirect_url",
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "bank_accounts/start_verification",
+ method="POST",
+ json={
+ "airwallex_plaid": convert_and_respect_annotation_metadata(
+ object_=airwallex_plaid, annotation=VerificationAirwallexPlaidRequest, direction="write"
+ ),
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VerificationResponse,
+ parse_obj_as(
+ type_=VerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityBankAccountResponse:
+ """
+ Retrieve a bank account by its ID.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.get_by_id(
+ bank_account_id="bank_account_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Delete the bank account specified by its ID.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.delete_by_id(
+ bank_account_id="bank_account_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ bank_account_id: str,
+ *,
+ account_holder_name: typing.Optional[str] = OMIT,
+ display_name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityBankAccountResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ account_holder_name : typing.Optional[str]
+ The name of the person or business that owns this bank account. If the account currency is GBP or USD, the holder name cannot be changed to an empty string.
+
+ display_name : typing.Optional[str]
+ User-defined name of this bank account, such as 'Primary account' or 'Savings account'.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.update_by_id(
+ bank_account_id="bank_account_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}",
+ method="PATCH",
+ json={
+ "account_holder_name": account_holder_name,
+ "display_name": display_name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def complete_verification_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CompleteRefreshVerificationResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CompleteRefreshVerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.complete_verification_by_id(
+ bank_account_id="bank_account_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/complete_verification",
+ method="POST",
+ json={
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CompleteRefreshVerificationResponse,
+ parse_obj_as(
+ type_=CompleteRefreshVerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def make_default_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityBankAccountResponse:
+ """
+ Set a bank account as the default for this entity per currency.
+
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityBankAccountResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.make_default_by_id(
+ bank_account_id="bank_account_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityBankAccountResponse,
+ parse_obj_as(
+ type_=EntityBankAccountResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def refresh_verification_by_id(
+ self,
+ bank_account_id: str,
+ *,
+ airwallex_plaid: VerificationAirwallexPlaidRequest,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VerificationResponse:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ airwallex_plaid : VerificationAirwallexPlaidRequest
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VerificationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, VerificationAirwallexPlaidRequest
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.refresh_verification_by_id(
+ bank_account_id="bank_account_id",
+ airwallex_plaid=VerificationAirwallexPlaidRequest(
+ client_name="client_name",
+ redirect_url="redirect_url",
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/refresh_verification",
+ method="POST",
+ json={
+ "airwallex_plaid": convert_and_respect_annotation_metadata(
+ object_=airwallex_plaid, annotation=VerificationAirwallexPlaidRequest, direction="write"
+ ),
+ "type": "airwallex_plaid",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VerificationResponse,
+ parse_obj_as(
+ type_=VerificationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_verifications_by_id(
+ self, bank_account_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> BankAccountVerifications:
+ """
+ Parameters
+ ----------
+ bank_account_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ BankAccountVerifications
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.bank_accounts.get_verifications_by_id(
+ bank_account_id="bank_account_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"bank_accounts/{jsonable_encoder(bank_account_id)}/verifications",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ BankAccountVerifications,
+ parse_obj_as(
+ type_=BankAccountVerifications, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/entities/client.py b/src/monite/entities/client.py
new file mode 100644
index 0000000..cc358ed
--- /dev/null
+++ b/src/monite/entities/client.py
@@ -0,0 +1,3039 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from .bank_accounts.client import BankAccountsClient
+from .onboarding_data.client import OnboardingDataClient
+from .payment_methods.client import PaymentMethodsClient
+from .vat_ids.client import VatIdsClient
+from .persons.client import PersonsClient
+from ..types.order_enum import OrderEnum
+from ..types.entity_cursor_fields import EntityCursorFields
+from ..types.entity_type_enum import EntityTypeEnum
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.entity_pagination_response import EntityPaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.entity_address_schema import EntityAddressSchema
+from ..types.individual_schema import IndividualSchema
+from ..types.organization_schema import OrganizationSchema
+from ..types.entity_response import EntityResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..types.update_entity_address_schema import UpdateEntityAddressSchema
+from ..types.optional_individual_schema import OptionalIndividualSchema
+from ..types.optional_organization_schema import OptionalOrganizationSchema
+from ..core.jsonable_encoder import jsonable_encoder
+from .. import core
+from ..types.file_schema3 import FileSchema3
+from ..errors.not_found_error import NotFoundError
+from ..types.partner_metadata_response import PartnerMetadataResponse
+from ..types.merged_settings_response import MergedSettingsResponse
+from ..types.language_code_enum import LanguageCodeEnum
+from ..types.currency_settings import CurrencySettings
+from ..types.reminders_settings import RemindersSettings
+from ..types.vat_mode_enum import VatModeEnum
+from ..types.payment_priority_enum import PaymentPriorityEnum
+from ..types.receivable_edit_flow import ReceivableEditFlow
+from ..types.document_i_ds_settings_request import DocumentIDsSettingsRequest
+from ..types.ocr_auto_tagging_settings_request import OcrAutoTaggingSettingsRequest
+from ..types.get_onboarding_requirements_response import GetOnboardingRequirementsResponse
+from ..core.client_wrapper import AsyncClientWrapper
+from .bank_accounts.client import AsyncBankAccountsClient
+from .onboarding_data.client import AsyncOnboardingDataClient
+from .payment_methods.client import AsyncPaymentMethodsClient
+from .vat_ids.client import AsyncVatIdsClient
+from .persons.client import AsyncPersonsClient
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class EntitiesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.bank_accounts = BankAccountsClient(client_wrapper=self._client_wrapper)
+ self.onboarding_data = OnboardingDataClient(client_wrapper=self._client_wrapper)
+ self.payment_methods = PaymentMethodsClient(client_wrapper=self._client_wrapper)
+ self.vat_ids = VatIdsClient(client_wrapper=self._client_wrapper)
+ self.persons = PersonsClient(client_wrapper=self._client_wrapper)
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[EntityCursorFields] = None,
+ type: typing.Optional[EntityTypeEnum] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ id_not_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ email: typing.Optional[str] = None,
+ email_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ email_not_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityPaginationResponse:
+ """
+ Retrieve a list of all entities.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[EntityCursorFields]
+ Allowed sort fields
+
+ type : typing.Optional[EntityTypeEnum]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ id_not_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ email : typing.Optional[str]
+
+ email_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ email_not_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entities",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "type": type,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "id__in": id_in,
+ "id__not_in": id_not_in,
+ "email": email,
+ "email__in": email_in,
+ "email__not_in": email_not_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityPaginationResponse,
+ parse_obj_as(
+ type_=EntityPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ address: EntityAddressSchema,
+ email: str,
+ type: EntityTypeEnum,
+ individual: typing.Optional[IndividualSchema] = OMIT,
+ organization: typing.Optional[OrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Create a new entity from the specified values.
+
+ Parameters
+ ----------
+ address : EntityAddressSchema
+ An address description of the entity
+
+ email : str
+ An official email address of the entity
+
+ type : EntityTypeEnum
+ A type for an entity
+
+ individual : typing.Optional[IndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import EntityAddressSchema, Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.create(
+ address=EntityAddressSchema(
+ city="city",
+ country="AF",
+ line1="line1",
+ postal_code="postal_code",
+ ),
+ email="email",
+ type="individual",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entities",
+ method="POST",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=EntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=IndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "type": type,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_entities_me(self, *, request_options: typing.Optional[RequestOptions] = None) -> EntityResponse:
+ """
+ Deprecated. Use `GET /entity_users/my_entity` instead.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.get_entities_me()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entities/me",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def patch_entities_me(
+ self,
+ *,
+ address: typing.Optional[UpdateEntityAddressSchema] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ individual: typing.Optional[OptionalIndividualSchema] = OMIT,
+ organization: typing.Optional[OptionalOrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Deprecated. Use `PATCH /entity_users/my_entity` instead.
+
+ Parameters
+ ----------
+ address : typing.Optional[UpdateEntityAddressSchema]
+ An address description of the entity
+
+ email : typing.Optional[str]
+ An official email address of the entity
+
+ individual : typing.Optional[OptionalIndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OptionalOrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.patch_entities_me()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entities/me",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=UpdateEntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=OptionalIndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OptionalOrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> EntityResponse:
+ """
+ Retrieve an entity by its ID.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.get_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ entity_id: str,
+ *,
+ address: typing.Optional[UpdateEntityAddressSchema] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ individual: typing.Optional[OptionalIndividualSchema] = OMIT,
+ organization: typing.Optional[OptionalOrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ address : typing.Optional[UpdateEntityAddressSchema]
+ An address description of the entity
+
+ email : typing.Optional[str]
+ An official email address of the entity
+
+ individual : typing.Optional[OptionalIndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OptionalOrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.update_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=UpdateEntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=OptionalIndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OptionalOrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def upload_logo_by_id(
+ self, entity_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
+ ) -> FileSchema3:
+ """
+ Entity logo can be PNG, JPG, or GIF, up to 10 MB in size. The logo is used, for example, in PDF documents created by this entity.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ file : core.File
+ See core.File for more documentation
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FileSchema3
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.upload_logo_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/logo",
+ method="PUT",
+ data={},
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FileSchema3,
+ parse_obj_as(
+ type_=FileSchema3, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_logo_by_id(self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.delete_logo_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/logo",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_partner_metadata_by_id(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PartnerMetadataResponse:
+ """
+ Retrieve a metadata object associated with this entity, usually in a JSON format.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.get_partner_metadata_by_id(
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/partner_metadata",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_partner_metadata_by_id(
+ self,
+ entity_id: str,
+ *,
+ metadata: typing.Dict[str, typing.Optional[typing.Any]],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PartnerMetadataResponse:
+ """
+ Fully replace the current metadata object with the specified instance.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ metadata : typing.Dict[str, typing.Optional[typing.Any]]
+ Metadata for partner needs
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.update_partner_metadata_by_id(
+ entity_id="entity_id",
+ metadata={"key": "value"},
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/partner_metadata",
+ method="PUT",
+ json={
+ "metadata": metadata,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_settings_by_id(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> MergedSettingsResponse:
+ """
+ Retrieve all settings for this entity.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MergedSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.get_settings_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/settings",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MergedSettingsResponse,
+ parse_obj_as(
+ type_=MergedSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_settings_by_id(
+ self,
+ entity_id: str,
+ *,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ currency: typing.Optional[CurrencySettings] = OMIT,
+ reminder: typing.Optional[RemindersSettings] = OMIT,
+ vat_mode: typing.Optional[VatModeEnum] = OMIT,
+ payment_priority: typing.Optional[PaymentPriorityEnum] = OMIT,
+ allow_purchase_order_autolinking: typing.Optional[bool] = OMIT,
+ receivable_edit_flow: typing.Optional[ReceivableEditFlow] = OMIT,
+ document_ids: typing.Optional[DocumentIDsSettingsRequest] = OMIT,
+ payables_ocr_auto_tagging: typing.Optional[typing.Sequence[OcrAutoTaggingSettingsRequest]] = OMIT,
+ quote_signature_required: typing.Optional[bool] = OMIT,
+ generate_paid_invoice_pdf: typing.Optional[bool] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> MergedSettingsResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ language : typing.Optional[LanguageCodeEnum]
+
+ currency : typing.Optional[CurrencySettings]
+
+ reminder : typing.Optional[RemindersSettings]
+
+ vat_mode : typing.Optional[VatModeEnum]
+ Defines whether the prices of products in receivables will already include VAT or not.
+
+ payment_priority : typing.Optional[PaymentPriorityEnum]
+ Payment preferences for entity to automate calculating suggested payment date basing on payment terms and entity preferences
+
+ allow_purchase_order_autolinking : typing.Optional[bool]
+ Automatically attempt to find a corresponding purchase order for all incoming payables.
+
+ receivable_edit_flow : typing.Optional[ReceivableEditFlow]
+
+ document_ids : typing.Optional[DocumentIDsSettingsRequest]
+
+ payables_ocr_auto_tagging : typing.Optional[typing.Sequence[OcrAutoTaggingSettingsRequest]]
+ Auto tagging settings for all incoming OCR payable documents.
+
+ quote_signature_required : typing.Optional[bool]
+ Sets the default behavior of whether a signature is required to accept quotes
+
+ generate_paid_invoice_pdf : typing.Optional[bool]
+ If enabled, the paid invoice's PDF will be in a new layout set by the user
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MergedSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.update_settings_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/settings",
+ method="PATCH",
+ json={
+ "language": language,
+ "currency": convert_and_respect_annotation_metadata(
+ object_=currency, annotation=CurrencySettings, direction="write"
+ ),
+ "reminder": convert_and_respect_annotation_metadata(
+ object_=reminder, annotation=RemindersSettings, direction="write"
+ ),
+ "vat_mode": vat_mode,
+ "payment_priority": payment_priority,
+ "allow_purchase_order_autolinking": allow_purchase_order_autolinking,
+ "receivable_edit_flow": receivable_edit_flow,
+ "document_ids": convert_and_respect_annotation_metadata(
+ object_=document_ids, annotation=DocumentIDsSettingsRequest, direction="write"
+ ),
+ "payables_ocr_auto_tagging": convert_and_respect_annotation_metadata(
+ object_=payables_ocr_auto_tagging,
+ annotation=typing.Sequence[OcrAutoTaggingSettingsRequest],
+ direction="write",
+ ),
+ "quote_signature_required": quote_signature_required,
+ "generate_paid_invoice_pdf": generate_paid_invoice_pdf,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MergedSettingsResponse,
+ parse_obj_as(
+ type_=MergedSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def upload_onboarding_documents(
+ self,
+ *,
+ additional_verification_document_back: typing.Optional[str] = OMIT,
+ additional_verification_document_front: typing.Optional[str] = OMIT,
+ bank_account_ownership_verification: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_license: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_memorandum_of_association: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_ministerial_decree: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_registration_verification: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_tax_id_verification: typing.Optional[typing.Sequence[str]] = OMIT,
+ proof_of_registration: typing.Optional[typing.Sequence[str]] = OMIT,
+ verification_document_back: typing.Optional[str] = OMIT,
+ verification_document_front: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> None:
+ """
+ Provide files for entity onboarding verification
+
+ Parameters
+ ----------
+ additional_verification_document_back : typing.Optional[str]
+
+ additional_verification_document_front : typing.Optional[str]
+
+ bank_account_ownership_verification : typing.Optional[typing.Sequence[str]]
+
+ company_license : typing.Optional[typing.Sequence[str]]
+
+ company_memorandum_of_association : typing.Optional[typing.Sequence[str]]
+
+ company_ministerial_decree : typing.Optional[typing.Sequence[str]]
+
+ company_registration_verification : typing.Optional[typing.Sequence[str]]
+
+ company_tax_id_verification : typing.Optional[typing.Sequence[str]]
+
+ proof_of_registration : typing.Optional[typing.Sequence[str]]
+
+ verification_document_back : typing.Optional[str]
+
+ verification_document_front : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.upload_onboarding_documents()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "onboarding_documents",
+ method="POST",
+ json={
+ "additional_verification_document_back": additional_verification_document_back,
+ "additional_verification_document_front": additional_verification_document_front,
+ "bank_account_ownership_verification": bank_account_ownership_verification,
+ "company_license": company_license,
+ "company_memorandum_of_association": company_memorandum_of_association,
+ "company_ministerial_decree": company_ministerial_decree,
+ "company_registration_verification": company_registration_verification,
+ "company_tax_id_verification": company_tax_id_verification,
+ "proof_of_registration": proof_of_registration,
+ "verification_document_back": verification_document_back,
+ "verification_document_front": verification_document_front,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_onboarding_requirements(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetOnboardingRequirementsResponse:
+ """
+ Get onboarding requirements for the entity
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetOnboardingRequirementsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.get_onboarding_requirements()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "onboarding_requirements",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ GetOnboardingRequirementsResponse,
+ parse_obj_as(
+ type_=GetOnboardingRequirementsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncEntitiesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.bank_accounts = AsyncBankAccountsClient(client_wrapper=self._client_wrapper)
+ self.onboarding_data = AsyncOnboardingDataClient(client_wrapper=self._client_wrapper)
+ self.payment_methods = AsyncPaymentMethodsClient(client_wrapper=self._client_wrapper)
+ self.vat_ids = AsyncVatIdsClient(client_wrapper=self._client_wrapper)
+ self.persons = AsyncPersonsClient(client_wrapper=self._client_wrapper)
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[EntityCursorFields] = None,
+ type: typing.Optional[EntityTypeEnum] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ id_not_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ email: typing.Optional[str] = None,
+ email_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ email_not_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityPaginationResponse:
+ """
+ Retrieve a list of all entities.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[EntityCursorFields]
+ Allowed sort fields
+
+ type : typing.Optional[EntityTypeEnum]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ id_not_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ email : typing.Optional[str]
+
+ email_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ email_not_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entities",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "type": type,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "id__in": id_in,
+ "id__not_in": id_not_in,
+ "email": email,
+ "email__in": email_in,
+ "email__not_in": email_not_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityPaginationResponse,
+ parse_obj_as(
+ type_=EntityPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ address: EntityAddressSchema,
+ email: str,
+ type: EntityTypeEnum,
+ individual: typing.Optional[IndividualSchema] = OMIT,
+ organization: typing.Optional[OrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Create a new entity from the specified values.
+
+ Parameters
+ ----------
+ address : EntityAddressSchema
+ An address description of the entity
+
+ email : str
+ An official email address of the entity
+
+ type : EntityTypeEnum
+ A type for an entity
+
+ individual : typing.Optional[IndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, EntityAddressSchema
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.create(
+ address=EntityAddressSchema(
+ city="city",
+ country="AF",
+ line1="line1",
+ postal_code="postal_code",
+ ),
+ email="email",
+ type="individual",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entities",
+ method="POST",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=EntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=IndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "type": type,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_entities_me(self, *, request_options: typing.Optional[RequestOptions] = None) -> EntityResponse:
+ """
+ Deprecated. Use `GET /entity_users/my_entity` instead.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.get_entities_me()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entities/me",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def patch_entities_me(
+ self,
+ *,
+ address: typing.Optional[UpdateEntityAddressSchema] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ individual: typing.Optional[OptionalIndividualSchema] = OMIT,
+ organization: typing.Optional[OptionalOrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Deprecated. Use `PATCH /entity_users/my_entity` instead.
+
+ Parameters
+ ----------
+ address : typing.Optional[UpdateEntityAddressSchema]
+ An address description of the entity
+
+ email : typing.Optional[str]
+ An official email address of the entity
+
+ individual : typing.Optional[OptionalIndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OptionalOrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.patch_entities_me()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entities/me",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=UpdateEntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=OptionalIndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OptionalOrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityResponse:
+ """
+ Retrieve an entity by its ID.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.get_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ entity_id: str,
+ *,
+ address: typing.Optional[UpdateEntityAddressSchema] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ individual: typing.Optional[OptionalIndividualSchema] = OMIT,
+ organization: typing.Optional[OptionalOrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ address : typing.Optional[UpdateEntityAddressSchema]
+ An address description of the entity
+
+ email : typing.Optional[str]
+ An official email address of the entity
+
+ individual : typing.Optional[OptionalIndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OptionalOrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.update_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=UpdateEntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=OptionalIndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OptionalOrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def upload_logo_by_id(
+ self, entity_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
+ ) -> FileSchema3:
+ """
+ Entity logo can be PNG, JPG, or GIF, up to 10 MB in size. The logo is used, for example, in PDF documents created by this entity.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ file : core.File
+ See core.File for more documentation
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FileSchema3
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.upload_logo_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/logo",
+ method="PUT",
+ data={},
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FileSchema3,
+ parse_obj_as(
+ type_=FileSchema3, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_logo_by_id(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.delete_logo_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/logo",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_partner_metadata_by_id(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PartnerMetadataResponse:
+ """
+ Retrieve a metadata object associated with this entity, usually in a JSON format.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.get_partner_metadata_by_id(
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/partner_metadata",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_partner_metadata_by_id(
+ self,
+ entity_id: str,
+ *,
+ metadata: typing.Dict[str, typing.Optional[typing.Any]],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PartnerMetadataResponse:
+ """
+ Fully replace the current metadata object with the specified instance.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ metadata : typing.Dict[str, typing.Optional[typing.Any]]
+ Metadata for partner needs
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerMetadataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.update_partner_metadata_by_id(
+ entity_id="entity_id",
+ metadata={"key": "value"},
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/partner_metadata",
+ method="PUT",
+ json={
+ "metadata": metadata,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerMetadataResponse,
+ parse_obj_as(
+ type_=PartnerMetadataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_settings_by_id(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> MergedSettingsResponse:
+ """
+ Retrieve all settings for this entity.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MergedSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.get_settings_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/settings",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MergedSettingsResponse,
+ parse_obj_as(
+ type_=MergedSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_settings_by_id(
+ self,
+ entity_id: str,
+ *,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ currency: typing.Optional[CurrencySettings] = OMIT,
+ reminder: typing.Optional[RemindersSettings] = OMIT,
+ vat_mode: typing.Optional[VatModeEnum] = OMIT,
+ payment_priority: typing.Optional[PaymentPriorityEnum] = OMIT,
+ allow_purchase_order_autolinking: typing.Optional[bool] = OMIT,
+ receivable_edit_flow: typing.Optional[ReceivableEditFlow] = OMIT,
+ document_ids: typing.Optional[DocumentIDsSettingsRequest] = OMIT,
+ payables_ocr_auto_tagging: typing.Optional[typing.Sequence[OcrAutoTaggingSettingsRequest]] = OMIT,
+ quote_signature_required: typing.Optional[bool] = OMIT,
+ generate_paid_invoice_pdf: typing.Optional[bool] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> MergedSettingsResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ entity_id : str
+ A unique ID to specify the entity.
+
+ language : typing.Optional[LanguageCodeEnum]
+
+ currency : typing.Optional[CurrencySettings]
+
+ reminder : typing.Optional[RemindersSettings]
+
+ vat_mode : typing.Optional[VatModeEnum]
+ Defines whether the prices of products in receivables will already include VAT or not.
+
+ payment_priority : typing.Optional[PaymentPriorityEnum]
+ Payment preferences for entity to automate calculating suggested payment date basing on payment terms and entity preferences
+
+ allow_purchase_order_autolinking : typing.Optional[bool]
+ Automatically attempt to find a corresponding purchase order for all incoming payables.
+
+ receivable_edit_flow : typing.Optional[ReceivableEditFlow]
+
+ document_ids : typing.Optional[DocumentIDsSettingsRequest]
+
+ payables_ocr_auto_tagging : typing.Optional[typing.Sequence[OcrAutoTaggingSettingsRequest]]
+ Auto tagging settings for all incoming OCR payable documents.
+
+ quote_signature_required : typing.Optional[bool]
+ Sets the default behavior of whether a signature is required to accept quotes
+
+ generate_paid_invoice_pdf : typing.Optional[bool]
+ If enabled, the paid invoice's PDF will be in a new layout set by the user
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MergedSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.update_settings_by_id(
+ entity_id="ea837e28-509b-4b6a-a600-d54b6aa0b1f5",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/settings",
+ method="PATCH",
+ json={
+ "language": language,
+ "currency": convert_and_respect_annotation_metadata(
+ object_=currency, annotation=CurrencySettings, direction="write"
+ ),
+ "reminder": convert_and_respect_annotation_metadata(
+ object_=reminder, annotation=RemindersSettings, direction="write"
+ ),
+ "vat_mode": vat_mode,
+ "payment_priority": payment_priority,
+ "allow_purchase_order_autolinking": allow_purchase_order_autolinking,
+ "receivable_edit_flow": receivable_edit_flow,
+ "document_ids": convert_and_respect_annotation_metadata(
+ object_=document_ids, annotation=DocumentIDsSettingsRequest, direction="write"
+ ),
+ "payables_ocr_auto_tagging": convert_and_respect_annotation_metadata(
+ object_=payables_ocr_auto_tagging,
+ annotation=typing.Sequence[OcrAutoTaggingSettingsRequest],
+ direction="write",
+ ),
+ "quote_signature_required": quote_signature_required,
+ "generate_paid_invoice_pdf": generate_paid_invoice_pdf,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MergedSettingsResponse,
+ parse_obj_as(
+ type_=MergedSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def upload_onboarding_documents(
+ self,
+ *,
+ additional_verification_document_back: typing.Optional[str] = OMIT,
+ additional_verification_document_front: typing.Optional[str] = OMIT,
+ bank_account_ownership_verification: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_license: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_memorandum_of_association: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_ministerial_decree: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_registration_verification: typing.Optional[typing.Sequence[str]] = OMIT,
+ company_tax_id_verification: typing.Optional[typing.Sequence[str]] = OMIT,
+ proof_of_registration: typing.Optional[typing.Sequence[str]] = OMIT,
+ verification_document_back: typing.Optional[str] = OMIT,
+ verification_document_front: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> None:
+ """
+ Provide files for entity onboarding verification
+
+ Parameters
+ ----------
+ additional_verification_document_back : typing.Optional[str]
+
+ additional_verification_document_front : typing.Optional[str]
+
+ bank_account_ownership_verification : typing.Optional[typing.Sequence[str]]
+
+ company_license : typing.Optional[typing.Sequence[str]]
+
+ company_memorandum_of_association : typing.Optional[typing.Sequence[str]]
+
+ company_ministerial_decree : typing.Optional[typing.Sequence[str]]
+
+ company_registration_verification : typing.Optional[typing.Sequence[str]]
+
+ company_tax_id_verification : typing.Optional[typing.Sequence[str]]
+
+ proof_of_registration : typing.Optional[typing.Sequence[str]]
+
+ verification_document_back : typing.Optional[str]
+
+ verification_document_front : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.upload_onboarding_documents()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "onboarding_documents",
+ method="POST",
+ json={
+ "additional_verification_document_back": additional_verification_document_back,
+ "additional_verification_document_front": additional_verification_document_front,
+ "bank_account_ownership_verification": bank_account_ownership_verification,
+ "company_license": company_license,
+ "company_memorandum_of_association": company_memorandum_of_association,
+ "company_ministerial_decree": company_ministerial_decree,
+ "company_registration_verification": company_registration_verification,
+ "company_tax_id_verification": company_tax_id_verification,
+ "proof_of_registration": proof_of_registration,
+ "verification_document_back": verification_document_back,
+ "verification_document_front": verification_document_front,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_onboarding_requirements(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> GetOnboardingRequirementsResponse:
+ """
+ Get onboarding requirements for the entity
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetOnboardingRequirementsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.get_onboarding_requirements()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "onboarding_requirements",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ GetOnboardingRequirementsResponse,
+ parse_obj_as(
+ type_=GetOnboardingRequirementsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/entities/onboarding_data/__init__.py b/src/monite/entities/onboarding_data/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/entities/onboarding_data/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/entities/onboarding_data/client.py b/src/monite/entities/onboarding_data/client.py
new file mode 100644
index 0000000..ae1e02a
--- /dev/null
+++ b/src/monite/entities/onboarding_data/client.py
@@ -0,0 +1,456 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.entity_onboarding_data_response import EntityOnboardingDataResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.not_found_error import NotFoundError
+from ...types.error_schema_response import ErrorSchemaResponse
+from ...errors.conflict_error import ConflictError
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.business_profile import BusinessProfile
+from ...types.ownership_declaration import OwnershipDeclaration
+from ...types.terms_of_service_acceptance import TermsOfServiceAcceptance
+from ...core.serialization import convert_and_respect_annotation_metadata
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class OnboardingDataClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityOnboardingDataResponse:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityOnboardingDataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.onboarding_data.get(
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/onboarding_data",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityOnboardingDataResponse,
+ parse_obj_as(
+ type_=EntityOnboardingDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update(
+ self,
+ entity_id: str,
+ *,
+ business_profile: typing.Optional[BusinessProfile] = OMIT,
+ ownership_declaration: typing.Optional[OwnershipDeclaration] = OMIT,
+ tos_acceptance: typing.Optional[TermsOfServiceAcceptance] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityOnboardingDataResponse:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ business_profile : typing.Optional[BusinessProfile]
+ Business information about the entity.
+
+ ownership_declaration : typing.Optional[OwnershipDeclaration]
+ Used to attest that the beneficial owner information provided is both current and correct.
+
+ tos_acceptance : typing.Optional[TermsOfServiceAcceptance]
+ Details on the entity's acceptance of the service agreement.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityOnboardingDataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.onboarding_data.update(
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/onboarding_data",
+ method="PATCH",
+ json={
+ "business_profile": convert_and_respect_annotation_metadata(
+ object_=business_profile, annotation=BusinessProfile, direction="write"
+ ),
+ "ownership_declaration": convert_and_respect_annotation_metadata(
+ object_=ownership_declaration, annotation=OwnershipDeclaration, direction="write"
+ ),
+ "tos_acceptance": convert_and_respect_annotation_metadata(
+ object_=tos_acceptance, annotation=TermsOfServiceAcceptance, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityOnboardingDataResponse,
+ parse_obj_as(
+ type_=EntityOnboardingDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncOnboardingDataClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityOnboardingDataResponse:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityOnboardingDataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.onboarding_data.get(
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/onboarding_data",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityOnboardingDataResponse,
+ parse_obj_as(
+ type_=EntityOnboardingDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update(
+ self,
+ entity_id: str,
+ *,
+ business_profile: typing.Optional[BusinessProfile] = OMIT,
+ ownership_declaration: typing.Optional[OwnershipDeclaration] = OMIT,
+ tos_acceptance: typing.Optional[TermsOfServiceAcceptance] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityOnboardingDataResponse:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ business_profile : typing.Optional[BusinessProfile]
+ Business information about the entity.
+
+ ownership_declaration : typing.Optional[OwnershipDeclaration]
+ Used to attest that the beneficial owner information provided is both current and correct.
+
+ tos_acceptance : typing.Optional[TermsOfServiceAcceptance]
+ Details on the entity's acceptance of the service agreement.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityOnboardingDataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.onboarding_data.update(
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/onboarding_data",
+ method="PATCH",
+ json={
+ "business_profile": convert_and_respect_annotation_metadata(
+ object_=business_profile, annotation=BusinessProfile, direction="write"
+ ),
+ "ownership_declaration": convert_and_respect_annotation_metadata(
+ object_=ownership_declaration, annotation=OwnershipDeclaration, direction="write"
+ ),
+ "tos_acceptance": convert_and_respect_annotation_metadata(
+ object_=tos_acceptance, annotation=TermsOfServiceAcceptance, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityOnboardingDataResponse,
+ parse_obj_as(
+ type_=EntityOnboardingDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/entities/payment_methods/__init__.py b/src/monite/entities/payment_methods/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/entities/payment_methods/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/entities/payment_methods/client.py b/src/monite/entities/payment_methods/client.py
new file mode 100644
index 0000000..f932914
--- /dev/null
+++ b/src/monite/entities/payment_methods/client.py
@@ -0,0 +1,367 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.onboarding_payment_methods_response import OnboardingPaymentMethodsResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.monite_all_payment_methods_types import MoniteAllPaymentMethodsTypes
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PaymentMethodsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> OnboardingPaymentMethodsResponse:
+ """
+ Get all enabled payment methods.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OnboardingPaymentMethodsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.payment_methods.get(
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/payment_methods",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OnboardingPaymentMethodsResponse,
+ parse_obj_as(
+ type_=OnboardingPaymentMethodsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def set(
+ self,
+ entity_id: str,
+ *,
+ payment_methods: typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]] = OMIT,
+ payment_methods_receive: typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]] = OMIT,
+ payment_methods_send: typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OnboardingPaymentMethodsResponse:
+ """
+ Set which payment methods should be enabled.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ payment_methods : typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]
+ Deprecated. Use payment_methods_receive instead.
+
+ payment_methods_receive : typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]
+ Enable payment methods to receive money.
+
+ payment_methods_send : typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]
+ Enable payment methods to send money.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OnboardingPaymentMethodsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.payment_methods.set(
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/payment_methods",
+ method="PUT",
+ json={
+ "payment_methods": payment_methods,
+ "payment_methods_receive": payment_methods_receive,
+ "payment_methods_send": payment_methods_send,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OnboardingPaymentMethodsResponse,
+ parse_obj_as(
+ type_=OnboardingPaymentMethodsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPaymentMethodsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> OnboardingPaymentMethodsResponse:
+ """
+ Get all enabled payment methods.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OnboardingPaymentMethodsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.payment_methods.get(
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/payment_methods",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OnboardingPaymentMethodsResponse,
+ parse_obj_as(
+ type_=OnboardingPaymentMethodsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def set(
+ self,
+ entity_id: str,
+ *,
+ payment_methods: typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]] = OMIT,
+ payment_methods_receive: typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]] = OMIT,
+ payment_methods_send: typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OnboardingPaymentMethodsResponse:
+ """
+ Set which payment methods should be enabled.
+
+ Parameters
+ ----------
+ entity_id : str
+
+ payment_methods : typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]
+ Deprecated. Use payment_methods_receive instead.
+
+ payment_methods_receive : typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]
+ Enable payment methods to receive money.
+
+ payment_methods_send : typing.Optional[typing.Sequence[MoniteAllPaymentMethodsTypes]]
+ Enable payment methods to send money.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OnboardingPaymentMethodsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.payment_methods.set(
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/payment_methods",
+ method="PUT",
+ json={
+ "payment_methods": payment_methods,
+ "payment_methods_receive": payment_methods_receive,
+ "payment_methods_send": payment_methods_send,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OnboardingPaymentMethodsResponse,
+ parse_obj_as(
+ type_=OnboardingPaymentMethodsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/entities/persons/__init__.py b/src/monite/entities/persons/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/entities/persons/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/entities/persons/client.py b/src/monite/entities/persons/client.py
new file mode 100644
index 0000000..5bed00c
--- /dev/null
+++ b/src/monite/entities/persons/client.py
@@ -0,0 +1,1263 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.persons_response import PersonsResponse
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.person_relationship_request import PersonRelationshipRequest
+from ...types.person_address_request import PersonAddressRequest
+from ...types.allowed_countries import AllowedCountries
+from ...types.person_response import PersonResponse
+from ...core.serialization import convert_and_respect_annotation_metadata
+from ...errors.conflict_error import ConflictError
+from ...core.jsonable_encoder import jsonable_encoder
+from ...errors.not_found_error import NotFoundError
+from ...types.optional_person_address_request import OptionalPersonAddressRequest
+from ...types.optional_person_relationship import OptionalPersonRelationship
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PersonsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> PersonsResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.persons.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "persons",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonsResponse,
+ parse_obj_as(
+ type_=PersonsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ first_name: str,
+ last_name: str,
+ email: str,
+ relationship: PersonRelationshipRequest,
+ address: typing.Optional[PersonAddressRequest] = OMIT,
+ date_of_birth: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ id_number: typing.Optional[str] = OMIT,
+ ssn_last4: typing.Optional[str] = OMIT,
+ citizenship: typing.Optional[AllowedCountries] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PersonResponse:
+ """
+ Parameters
+ ----------
+ first_name : str
+ The person's first name
+
+ last_name : str
+ The person's last name
+
+ email : str
+ The person's email address
+
+ relationship : PersonRelationshipRequest
+ Describes the person's relationship to the entity
+
+ address : typing.Optional[PersonAddressRequest]
+ The person's address
+
+ date_of_birth : typing.Optional[str]
+ The person's date of birth
+
+ phone : typing.Optional[str]
+ The person's phone number
+
+ id_number : typing.Optional[str]
+ The person's ID number, as appropriate for their country
+
+ ssn_last4 : typing.Optional[str]
+ The last four digits of the person's Social Security number
+
+ citizenship : typing.Optional[AllowedCountries]
+ Required for persons of US entities. The country of the person's citizenship, as a two-letter country code (ISO 3166-1 alpha-2). In case of dual or multiple citizenship, specify any.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite, PersonRelationshipRequest
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.persons.create(
+ first_name="first_name",
+ last_name="last_name",
+ email="email",
+ relationship=PersonRelationshipRequest(),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "persons",
+ method="POST",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=PersonAddressRequest, direction="write"
+ ),
+ "date_of_birth": date_of_birth,
+ "first_name": first_name,
+ "last_name": last_name,
+ "email": email,
+ "phone": phone,
+ "relationship": convert_and_respect_annotation_metadata(
+ object_=relationship, annotation=PersonRelationshipRequest, direction="write"
+ ),
+ "id_number": id_number,
+ "ssn_last_4": ssn_last4,
+ "citizenship": citizenship,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonResponse,
+ parse_obj_as(
+ type_=PersonResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, person_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> PersonResponse:
+ """
+ Parameters
+ ----------
+ person_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.persons.get_by_id(
+ person_id="person_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonResponse,
+ parse_obj_as(
+ type_=PersonResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, person_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ person_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.persons.delete_by_id(
+ person_id="person_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ person_id: str,
+ *,
+ address: typing.Optional[OptionalPersonAddressRequest] = OMIT,
+ date_of_birth: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ relationship: typing.Optional[OptionalPersonRelationship] = OMIT,
+ id_number: typing.Optional[str] = OMIT,
+ ssn_last4: typing.Optional[str] = OMIT,
+ citizenship: typing.Optional[AllowedCountries] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PersonResponse:
+ """
+ Parameters
+ ----------
+ person_id : str
+
+ address : typing.Optional[OptionalPersonAddressRequest]
+ The person's address
+
+ date_of_birth : typing.Optional[str]
+ The person's date of birth
+
+ first_name : typing.Optional[str]
+ The person's first name
+
+ last_name : typing.Optional[str]
+ The person's last name
+
+ email : typing.Optional[str]
+ The person's email address
+
+ phone : typing.Optional[str]
+ The person's phone number
+
+ relationship : typing.Optional[OptionalPersonRelationship]
+ Describes the person's relationship to the entity
+
+ id_number : typing.Optional[str]
+ The person's ID number, as appropriate for their country
+
+ ssn_last4 : typing.Optional[str]
+ The last four digits of the person's Social Security number
+
+ citizenship : typing.Optional[AllowedCountries]
+ Required for persons of US entities. The country of the person's citizenship, as a two-letter country code (ISO 3166-1 alpha-2). In case of dual or multiple citizenship, specify any.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.persons.update_by_id(
+ person_id="person_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=OptionalPersonAddressRequest, direction="write"
+ ),
+ "date_of_birth": date_of_birth,
+ "first_name": first_name,
+ "last_name": last_name,
+ "email": email,
+ "phone": phone,
+ "relationship": convert_and_respect_annotation_metadata(
+ object_=relationship, annotation=OptionalPersonRelationship, direction="write"
+ ),
+ "id_number": id_number,
+ "ssn_last_4": ssn_last4,
+ "citizenship": citizenship,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonResponse,
+ parse_obj_as(
+ type_=PersonResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def upload_onboarding_documents(
+ self,
+ person_id: str,
+ *,
+ additional_verification_document_back: typing.Optional[str] = OMIT,
+ additional_verification_document_front: typing.Optional[str] = OMIT,
+ verification_document_back: typing.Optional[str] = OMIT,
+ verification_document_front: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> None:
+ """
+ Provide files for person onboarding verification
+
+ Parameters
+ ----------
+ person_id : str
+
+ additional_verification_document_back : typing.Optional[str]
+
+ additional_verification_document_front : typing.Optional[str]
+
+ verification_document_back : typing.Optional[str]
+
+ verification_document_front : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.persons.upload_onboarding_documents(
+ person_id="person_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}/onboarding_documents",
+ method="POST",
+ json={
+ "additional_verification_document_back": additional_verification_document_back,
+ "additional_verification_document_front": additional_verification_document_front,
+ "verification_document_back": verification_document_back,
+ "verification_document_front": verification_document_front,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPersonsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> PersonsResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.persons.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "persons",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonsResponse,
+ parse_obj_as(
+ type_=PersonsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ first_name: str,
+ last_name: str,
+ email: str,
+ relationship: PersonRelationshipRequest,
+ address: typing.Optional[PersonAddressRequest] = OMIT,
+ date_of_birth: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ id_number: typing.Optional[str] = OMIT,
+ ssn_last4: typing.Optional[str] = OMIT,
+ citizenship: typing.Optional[AllowedCountries] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PersonResponse:
+ """
+ Parameters
+ ----------
+ first_name : str
+ The person's first name
+
+ last_name : str
+ The person's last name
+
+ email : str
+ The person's email address
+
+ relationship : PersonRelationshipRequest
+ Describes the person's relationship to the entity
+
+ address : typing.Optional[PersonAddressRequest]
+ The person's address
+
+ date_of_birth : typing.Optional[str]
+ The person's date of birth
+
+ phone : typing.Optional[str]
+ The person's phone number
+
+ id_number : typing.Optional[str]
+ The person's ID number, as appropriate for their country
+
+ ssn_last4 : typing.Optional[str]
+ The last four digits of the person's Social Security number
+
+ citizenship : typing.Optional[AllowedCountries]
+ Required for persons of US entities. The country of the person's citizenship, as a two-letter country code (ISO 3166-1 alpha-2). In case of dual or multiple citizenship, specify any.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, PersonRelationshipRequest
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.persons.create(
+ first_name="first_name",
+ last_name="last_name",
+ email="email",
+ relationship=PersonRelationshipRequest(),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "persons",
+ method="POST",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=PersonAddressRequest, direction="write"
+ ),
+ "date_of_birth": date_of_birth,
+ "first_name": first_name,
+ "last_name": last_name,
+ "email": email,
+ "phone": phone,
+ "relationship": convert_and_respect_annotation_metadata(
+ object_=relationship, annotation=PersonRelationshipRequest, direction="write"
+ ),
+ "id_number": id_number,
+ "ssn_last_4": ssn_last4,
+ "citizenship": citizenship,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonResponse,
+ parse_obj_as(
+ type_=PersonResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, person_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PersonResponse:
+ """
+ Parameters
+ ----------
+ person_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.persons.get_by_id(
+ person_id="person_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonResponse,
+ parse_obj_as(
+ type_=PersonResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, person_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ person_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.persons.delete_by_id(
+ person_id="person_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ person_id: str,
+ *,
+ address: typing.Optional[OptionalPersonAddressRequest] = OMIT,
+ date_of_birth: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ relationship: typing.Optional[OptionalPersonRelationship] = OMIT,
+ id_number: typing.Optional[str] = OMIT,
+ ssn_last4: typing.Optional[str] = OMIT,
+ citizenship: typing.Optional[AllowedCountries] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PersonResponse:
+ """
+ Parameters
+ ----------
+ person_id : str
+
+ address : typing.Optional[OptionalPersonAddressRequest]
+ The person's address
+
+ date_of_birth : typing.Optional[str]
+ The person's date of birth
+
+ first_name : typing.Optional[str]
+ The person's first name
+
+ last_name : typing.Optional[str]
+ The person's last name
+
+ email : typing.Optional[str]
+ The person's email address
+
+ phone : typing.Optional[str]
+ The person's phone number
+
+ relationship : typing.Optional[OptionalPersonRelationship]
+ Describes the person's relationship to the entity
+
+ id_number : typing.Optional[str]
+ The person's ID number, as appropriate for their country
+
+ ssn_last4 : typing.Optional[str]
+ The last four digits of the person's Social Security number
+
+ citizenship : typing.Optional[AllowedCountries]
+ Required for persons of US entities. The country of the person's citizenship, as a two-letter country code (ISO 3166-1 alpha-2). In case of dual or multiple citizenship, specify any.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PersonResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.persons.update_by_id(
+ person_id="person_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=OptionalPersonAddressRequest, direction="write"
+ ),
+ "date_of_birth": date_of_birth,
+ "first_name": first_name,
+ "last_name": last_name,
+ "email": email,
+ "phone": phone,
+ "relationship": convert_and_respect_annotation_metadata(
+ object_=relationship, annotation=OptionalPersonRelationship, direction="write"
+ ),
+ "id_number": id_number,
+ "ssn_last_4": ssn_last4,
+ "citizenship": citizenship,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PersonResponse,
+ parse_obj_as(
+ type_=PersonResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def upload_onboarding_documents(
+ self,
+ person_id: str,
+ *,
+ additional_verification_document_back: typing.Optional[str] = OMIT,
+ additional_verification_document_front: typing.Optional[str] = OMIT,
+ verification_document_back: typing.Optional[str] = OMIT,
+ verification_document_front: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> None:
+ """
+ Provide files for person onboarding verification
+
+ Parameters
+ ----------
+ person_id : str
+
+ additional_verification_document_back : typing.Optional[str]
+
+ additional_verification_document_front : typing.Optional[str]
+
+ verification_document_back : typing.Optional[str]
+
+ verification_document_front : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.persons.upload_onboarding_documents(
+ person_id="person_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"persons/{jsonable_encoder(person_id)}/onboarding_documents",
+ method="POST",
+ json={
+ "additional_verification_document_back": additional_verification_document_back,
+ "additional_verification_document_front": additional_verification_document_front,
+ "verification_document_back": verification_document_back,
+ "verification_document_front": verification_document_front,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/entities/vat_ids/__init__.py b/src/monite/entities/vat_ids/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/entities/vat_ids/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/entities/vat_ids/client.py b/src/monite/entities/vat_ids/client.py
new file mode 100644
index 0000000..ac2a58b
--- /dev/null
+++ b/src/monite/entities/vat_ids/client.py
@@ -0,0 +1,912 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...core.request_options import RequestOptions
+from ...types.entity_vat_id_resource_list import EntityVatIdResourceList
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from ...types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.allowed_countries import AllowedCountries
+from ...types.vat_id_type_enum import VatIdTypeEnum
+from ...types.entity_vat_id_response import EntityVatIdResponse
+from ...errors.not_found_error import NotFoundError
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class VatIdsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityVatIdResourceList:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResourceList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.vat_ids.get(
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResourceList,
+ parse_obj_as(
+ type_=EntityVatIdResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ entity_id: str,
+ *,
+ country: AllowedCountries,
+ value: str,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityVatIdResponse:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ country : AllowedCountries
+
+ value : str
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.vat_ids.create(
+ entity_id="entity_id",
+ country="AF",
+ value="123456789",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids",
+ method="POST",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResponse,
+ parse_obj_as(
+ type_=EntityVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityVatIdResponse:
+ """
+ Parameters
+ ----------
+ id : str
+
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.vat_ids.get_by_id(
+ id="id",
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids/{jsonable_encoder(id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResponse,
+ parse_obj_as(
+ type_=EntityVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ id : str
+
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.vat_ids.delete_by_id(
+ id="id",
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids/{jsonable_encoder(id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ id: str,
+ entity_id: str,
+ *,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ value: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityVatIdResponse:
+ """
+ Parameters
+ ----------
+ id : str
+
+ entity_id : str
+
+ country : typing.Optional[AllowedCountries]
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ value : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entities.vat_ids.update_by_id(
+ id="id",
+ entity_id="entity_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids/{jsonable_encoder(id)}",
+ method="PATCH",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResponse,
+ parse_obj_as(
+ type_=EntityVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncVatIdsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityVatIdResourceList:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResourceList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.vat_ids.get(
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResourceList,
+ parse_obj_as(
+ type_=EntityVatIdResourceList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ entity_id: str,
+ *,
+ country: AllowedCountries,
+ value: str,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityVatIdResponse:
+ """
+ Parameters
+ ----------
+ entity_id : str
+
+ country : AllowedCountries
+
+ value : str
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.vat_ids.create(
+ entity_id="entity_id",
+ country="AF",
+ value="123456789",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids",
+ method="POST",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResponse,
+ parse_obj_as(
+ type_=EntityVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityVatIdResponse:
+ """
+ Parameters
+ ----------
+ id : str
+
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.vat_ids.get_by_id(
+ id="id",
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids/{jsonable_encoder(id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResponse,
+ parse_obj_as(
+ type_=EntityVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, id: str, entity_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ id : str
+
+ entity_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.vat_ids.delete_by_id(
+ id="id",
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids/{jsonable_encoder(id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ id: str,
+ entity_id: str,
+ *,
+ country: typing.Optional[AllowedCountries] = OMIT,
+ type: typing.Optional[VatIdTypeEnum] = OMIT,
+ value: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityVatIdResponse:
+ """
+ Parameters
+ ----------
+ id : str
+
+ entity_id : str
+
+ country : typing.Optional[AllowedCountries]
+
+ type : typing.Optional[VatIdTypeEnum]
+
+ value : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityVatIdResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entities.vat_ids.update_by_id(
+ id="id",
+ entity_id="entity_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entities/{jsonable_encoder(entity_id)}/vat_ids/{jsonable_encoder(id)}",
+ method="PATCH",
+ json={
+ "country": country,
+ "type": type,
+ "value": value,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityVatIdResponse,
+ parse_obj_as(
+ type_=EntityVatIdResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/entity_users/__init__.py b/src/monite/entity_users/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/entity_users/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/entity_users/client.py b/src/monite/entity_users/client.py
new file mode 100644
index 0000000..50bb20a
--- /dev/null
+++ b/src/monite/entity_users/client.py
@@ -0,0 +1,2129 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.entity_user_cursor_fields import EntityUserCursorFields
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.entity_user_pagination_response import EntityUserPaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.entity_user_response import EntityUserResponse
+from ..types.entity_response import EntityResponse
+from ..types.update_entity_address_schema import UpdateEntityAddressSchema
+from ..types.optional_individual_schema import OptionalIndividualSchema
+from ..types.optional_organization_schema import OptionalOrganizationSchema
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..types.role_response import RoleResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class EntityUsersClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[EntityUserCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ id_not_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ role_id: typing.Optional[str] = None,
+ role_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ login: typing.Optional[str] = None,
+ status: typing.Optional[str] = None,
+ first_name: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserPaginationResponse:
+ """
+ Retrieve a list of all entity users.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[EntityUserCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ id_not_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ role_id : typing.Optional[str]
+
+ role_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ login : typing.Optional[str]
+
+ status : typing.Optional[str]
+
+ first_name : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entity_users",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "id__not_in": id_not_in,
+ "role_id": role_id,
+ "role_id__in": role_id_in,
+ "login": login,
+ "status": status,
+ "first_name": first_name,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserPaginationResponse,
+ parse_obj_as(
+ type_=EntityUserPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ first_name: str,
+ login: str,
+ email: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ role_id: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserResponse:
+ """
+ Create a new entity user from the specified values.
+
+ Parameters
+ ----------
+ first_name : str
+ First name
+
+ login : str
+
+ email : typing.Optional[str]
+ An entity user business email
+
+ last_name : typing.Optional[str]
+ Last name
+
+ phone : typing.Optional[str]
+ An entity user phone number in the international format
+
+ role_id : typing.Optional[str]
+ UUID of the role assigned to this entity user
+
+ title : typing.Optional[str]
+ Title
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.create(
+ first_name="Andrey",
+ login="login",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entity_users",
+ method="POST",
+ json={
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "login": login,
+ "phone": phone,
+ "role_id": role_id,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_current(self, *, request_options: typing.Optional[RequestOptions] = None) -> EntityUserResponse:
+ """
+ Retrieve an entity user by its ID.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.get_current()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entity_users/me",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_current(
+ self,
+ *,
+ email: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserResponse:
+ """
+ Change the specified fields with provided values.
+
+ Parameters
+ ----------
+ email : typing.Optional[str]
+ An entity user business email
+
+ first_name : typing.Optional[str]
+ First name
+
+ last_name : typing.Optional[str]
+ Last name
+
+ phone : typing.Optional[str]
+ An entity user phone number in the international format
+
+ title : typing.Optional[str]
+ Title
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.update_current()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entity_users/me",
+ method="PATCH",
+ json={
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "phone": phone,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_current_entity(self, *, request_options: typing.Optional[RequestOptions] = None) -> EntityResponse:
+ """
+ Retrieves information of an entity, which this entity user belongs to.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.get_current_entity()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entity_users/my_entity",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_current_entity(
+ self,
+ *,
+ address: typing.Optional[UpdateEntityAddressSchema] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ individual: typing.Optional[OptionalIndividualSchema] = OMIT,
+ organization: typing.Optional[OptionalOrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Update information of an entity, which this entity user belongs to.
+
+ Parameters
+ ----------
+ address : typing.Optional[UpdateEntityAddressSchema]
+ An address description of the entity
+
+ email : typing.Optional[str]
+ An official email address of the entity
+
+ individual : typing.Optional[OptionalIndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OptionalOrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.update_current_entity()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entity_users/my_entity",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=UpdateEntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=OptionalIndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OptionalOrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_current_role(self, *, request_options: typing.Optional[RequestOptions] = None) -> RoleResponse:
+ """
+ Retrieves information of a role assigned to this entity user.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.get_current_role()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "entity_users/my_role",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, entity_user_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityUserResponse:
+ """
+ Retrieve an entity user by its ID.
+
+ Parameters
+ ----------
+ entity_user_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.get_by_id(
+ entity_user_id="entity_user_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entity_users/{jsonable_encoder(entity_user_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, entity_user_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ entity_user_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.delete_by_id(
+ entity_user_id="entity_user_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entity_users/{jsonable_encoder(entity_user_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ entity_user_id: str,
+ *,
+ email: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ login: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ role_id: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserResponse:
+ """
+ Change the specified fields with provided values.
+
+ Parameters
+ ----------
+ entity_user_id : str
+
+ email : typing.Optional[str]
+ An entity user business email
+
+ first_name : typing.Optional[str]
+ First name
+
+ last_name : typing.Optional[str]
+ Last name
+
+ login : typing.Optional[str]
+ Login
+
+ phone : typing.Optional[str]
+ An entity user phone number in the international format
+
+ role_id : typing.Optional[str]
+ UUID of the role assigned to this entity user
+
+ title : typing.Optional[str]
+ Title
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.entity_users.update_by_id(
+ entity_user_id="entity_user_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"entity_users/{jsonable_encoder(entity_user_id)}",
+ method="PATCH",
+ json={
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "login": login,
+ "phone": phone,
+ "role_id": role_id,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncEntityUsersClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[EntityUserCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ id_not_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ role_id: typing.Optional[str] = None,
+ role_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ login: typing.Optional[str] = None,
+ status: typing.Optional[str] = None,
+ first_name: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserPaginationResponse:
+ """
+ Retrieve a list of all entity users.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[EntityUserCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ id_not_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ role_id : typing.Optional[str]
+
+ role_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ login : typing.Optional[str]
+
+ status : typing.Optional[str]
+
+ first_name : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entity_users",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "id__not_in": id_not_in,
+ "role_id": role_id,
+ "role_id__in": role_id_in,
+ "login": login,
+ "status": status,
+ "first_name": first_name,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserPaginationResponse,
+ parse_obj_as(
+ type_=EntityUserPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ first_name: str,
+ login: str,
+ email: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ role_id: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserResponse:
+ """
+ Create a new entity user from the specified values.
+
+ Parameters
+ ----------
+ first_name : str
+ First name
+
+ login : str
+
+ email : typing.Optional[str]
+ An entity user business email
+
+ last_name : typing.Optional[str]
+ Last name
+
+ phone : typing.Optional[str]
+ An entity user phone number in the international format
+
+ role_id : typing.Optional[str]
+ UUID of the role assigned to this entity user
+
+ title : typing.Optional[str]
+ Title
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.create(
+ first_name="Andrey",
+ login="login",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entity_users",
+ method="POST",
+ json={
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "login": login,
+ "phone": phone,
+ "role_id": role_id,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_current(self, *, request_options: typing.Optional[RequestOptions] = None) -> EntityUserResponse:
+ """
+ Retrieve an entity user by its ID.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.get_current()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entity_users/me",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_current(
+ self,
+ *,
+ email: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserResponse:
+ """
+ Change the specified fields with provided values.
+
+ Parameters
+ ----------
+ email : typing.Optional[str]
+ An entity user business email
+
+ first_name : typing.Optional[str]
+ First name
+
+ last_name : typing.Optional[str]
+ Last name
+
+ phone : typing.Optional[str]
+ An entity user phone number in the international format
+
+ title : typing.Optional[str]
+ Title
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.update_current()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entity_users/me",
+ method="PATCH",
+ json={
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "phone": phone,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_current_entity(self, *, request_options: typing.Optional[RequestOptions] = None) -> EntityResponse:
+ """
+ Retrieves information of an entity, which this entity user belongs to.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.get_current_entity()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entity_users/my_entity",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_current_entity(
+ self,
+ *,
+ address: typing.Optional[UpdateEntityAddressSchema] = OMIT,
+ email: typing.Optional[str] = OMIT,
+ individual: typing.Optional[OptionalIndividualSchema] = OMIT,
+ organization: typing.Optional[OptionalOrganizationSchema] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ tax_id: typing.Optional[str] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityResponse:
+ """
+ Update information of an entity, which this entity user belongs to.
+
+ Parameters
+ ----------
+ address : typing.Optional[UpdateEntityAddressSchema]
+ An address description of the entity
+
+ email : typing.Optional[str]
+ An official email address of the entity
+
+ individual : typing.Optional[OptionalIndividualSchema]
+ A set of meta data describing the individual
+
+ organization : typing.Optional[OptionalOrganizationSchema]
+ A set of meta data describing the organization
+
+ phone : typing.Optional[str]
+ A phone number of the entity
+
+ tax_id : typing.Optional[str]
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+
+ website : typing.Optional[str]
+ A website of the entity
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.update_current_entity()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entity_users/my_entity",
+ method="PATCH",
+ json={
+ "address": convert_and_respect_annotation_metadata(
+ object_=address, annotation=UpdateEntityAddressSchema, direction="write"
+ ),
+ "email": email,
+ "individual": convert_and_respect_annotation_metadata(
+ object_=individual, annotation=OptionalIndividualSchema, direction="write"
+ ),
+ "organization": convert_and_respect_annotation_metadata(
+ object_=organization, annotation=OptionalOrganizationSchema, direction="write"
+ ),
+ "phone": phone,
+ "tax_id": tax_id,
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityResponse,
+ parse_obj_as(
+ type_=EntityResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_current_role(self, *, request_options: typing.Optional[RequestOptions] = None) -> RoleResponse:
+ """
+ Retrieves information of a role assigned to this entity user.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.get_current_role()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "entity_users/my_role",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, entity_user_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EntityUserResponse:
+ """
+ Retrieve an entity user by its ID.
+
+ Parameters
+ ----------
+ entity_user_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.get_by_id(
+ entity_user_id="entity_user_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entity_users/{jsonable_encoder(entity_user_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, entity_user_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ entity_user_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.delete_by_id(
+ entity_user_id="entity_user_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entity_users/{jsonable_encoder(entity_user_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ entity_user_id: str,
+ *,
+ email: typing.Optional[str] = OMIT,
+ first_name: typing.Optional[str] = OMIT,
+ last_name: typing.Optional[str] = OMIT,
+ login: typing.Optional[str] = OMIT,
+ phone: typing.Optional[str] = OMIT,
+ role_id: typing.Optional[str] = OMIT,
+ title: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EntityUserResponse:
+ """
+ Change the specified fields with provided values.
+
+ Parameters
+ ----------
+ entity_user_id : str
+
+ email : typing.Optional[str]
+ An entity user business email
+
+ first_name : typing.Optional[str]
+ First name
+
+ last_name : typing.Optional[str]
+ Last name
+
+ login : typing.Optional[str]
+ Login
+
+ phone : typing.Optional[str]
+ An entity user phone number in the international format
+
+ role_id : typing.Optional[str]
+ UUID of the role assigned to this entity user
+
+ title : typing.Optional[str]
+ Title
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EntityUserResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.entity_users.update_by_id(
+ entity_user_id="entity_user_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"entity_users/{jsonable_encoder(entity_user_id)}",
+ method="PATCH",
+ json={
+ "email": email,
+ "first_name": first_name,
+ "last_name": last_name,
+ "login": login,
+ "phone": phone,
+ "role_id": role_id,
+ "title": title,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EntityUserResponse,
+ parse_obj_as(
+ type_=EntityUserResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/environment.py b/src/monite/environment.py
new file mode 100644
index 0000000..cd77989
--- /dev/null
+++ b/src/monite/environment.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import enum
+
+
+class MoniteEnvironment(enum.Enum):
+ SANDBOX = "https://api.sandbox.monite.com/v1"
+ EU_PRODUCTION = "https://api.monite.com/v1"
+ NA_PRODUCTION = "https://us.api.monite.com/v1"
diff --git a/src/monite/errors/__init__.py b/src/monite/errors/__init__.py
new file mode 100644
index 0000000..92aeac7
--- /dev/null
+++ b/src/monite/errors/__init__.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .bad_request_error import BadRequestError
+from .conflict_error import ConflictError
+from .forbidden_error import ForbiddenError
+from .internal_server_error import InternalServerError
+from .not_acceptable_error import NotAcceptableError
+from .not_found_error import NotFoundError
+from .range_not_satisfiable_error import RangeNotSatisfiableError
+from .unauthorized_error import UnauthorizedError
+from .unprocessable_entity_error import UnprocessableEntityError
+
+__all__ = [
+ "BadRequestError",
+ "ConflictError",
+ "ForbiddenError",
+ "InternalServerError",
+ "NotAcceptableError",
+ "NotFoundError",
+ "RangeNotSatisfiableError",
+ "UnauthorizedError",
+ "UnprocessableEntityError",
+]
diff --git a/src/monite/errors/bad_request_error.py b/src/monite/errors/bad_request_error.py
new file mode 100644
index 0000000..3de0c8b
--- /dev/null
+++ b/src/monite/errors/bad_request_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class BadRequestError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=400, body=body)
diff --git a/src/monite/errors/conflict_error.py b/src/monite/errors/conflict_error.py
new file mode 100644
index 0000000..2bfad04
--- /dev/null
+++ b/src/monite/errors/conflict_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class ConflictError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=409, body=body)
diff --git a/src/monite/errors/forbidden_error.py b/src/monite/errors/forbidden_error.py
new file mode 100644
index 0000000..fd869d2
--- /dev/null
+++ b/src/monite/errors/forbidden_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class ForbiddenError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=403, body=body)
diff --git a/src/monite/errors/internal_server_error.py b/src/monite/errors/internal_server_error.py
new file mode 100644
index 0000000..7548517
--- /dev/null
+++ b/src/monite/errors/internal_server_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class InternalServerError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=500, body=body)
diff --git a/src/monite/errors/not_acceptable_error.py b/src/monite/errors/not_acceptable_error.py
new file mode 100644
index 0000000..5798fff
--- /dev/null
+++ b/src/monite/errors/not_acceptable_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class NotAcceptableError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=406, body=body)
diff --git a/src/monite/errors/not_found_error.py b/src/monite/errors/not_found_error.py
new file mode 100644
index 0000000..a5cbefd
--- /dev/null
+++ b/src/monite/errors/not_found_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class NotFoundError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=404, body=body)
diff --git a/src/monite/errors/range_not_satisfiable_error.py b/src/monite/errors/range_not_satisfiable_error.py
new file mode 100644
index 0000000..d969a68
--- /dev/null
+++ b/src/monite/errors/range_not_satisfiable_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class RangeNotSatisfiableError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=416, body=body)
diff --git a/src/monite/errors/unauthorized_error.py b/src/monite/errors/unauthorized_error.py
new file mode 100644
index 0000000..dcc075d
--- /dev/null
+++ b/src/monite/errors/unauthorized_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.error_schema_response import ErrorSchemaResponse
+
+
+class UnauthorizedError(ApiError):
+ def __init__(self, body: ErrorSchemaResponse):
+ super().__init__(status_code=401, body=body)
diff --git a/src/monite/errors/unprocessable_entity_error.py b/src/monite/errors/unprocessable_entity_error.py
new file mode 100644
index 0000000..47470a7
--- /dev/null
+++ b/src/monite/errors/unprocessable_entity_error.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.api_error import ApiError
+from ..types.http_validation_error import HttpValidationError
+
+
+class UnprocessableEntityError(ApiError):
+ def __init__(self, body: HttpValidationError):
+ super().__init__(status_code=422, body=body)
diff --git a/src/monite/events/__init__.py b/src/monite/events/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/events/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/events/client.py b/src/monite/events/client.py
new file mode 100644
index 0000000..6107479
--- /dev/null
+++ b/src/monite/events/client.py
@@ -0,0 +1,405 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.client_wrapper import SyncClientWrapper
+import typing
+from ..types.order_enum import OrderEnum
+from ..types.event_cursor_fields import EventCursorFields
+from ..types.webhook_object_type import WebhookObjectType
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.event_pagination_resource import EventPaginationResource
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.event_resource import EventResource
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+
+class EventsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[EventCursorFields] = None,
+ object_type: typing.Optional[WebhookObjectType] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EventPaginationResource:
+ """
+ Get events for a given entity.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[EventCursorFields]
+ Allowed sort fields
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EventPaginationResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.events.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "events",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_type": object_type,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EventPaginationResource,
+ parse_obj_as(
+ type_=EventPaginationResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, event_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> EventResource:
+ """
+ Get event by ID.
+
+ Parameters
+ ----------
+ event_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EventResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.events.get_by_id(
+ event_id="event_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"events/{jsonable_encoder(event_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EventResource,
+ parse_obj_as(
+ type_=EventResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncEventsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[EventCursorFields] = None,
+ object_type: typing.Optional[WebhookObjectType] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> EventPaginationResource:
+ """
+ Get events for a given entity.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[EventCursorFields]
+ Allowed sort fields
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EventPaginationResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.events.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "events",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_type": object_type,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EventPaginationResource,
+ parse_obj_as(
+ type_=EventPaginationResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, event_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> EventResource:
+ """
+ Get event by ID.
+
+ Parameters
+ ----------
+ event_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ EventResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.events.get_by_id(
+ event_id="event_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"events/{jsonable_encoder(event_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ EventResource,
+ parse_obj_as(
+ type_=EventResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/files/__init__.py b/src/monite/files/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/files/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/files/client.py b/src/monite/files/client.py
new file mode 100644
index 0000000..3108964
--- /dev/null
+++ b/src/monite/files/client.py
@@ -0,0 +1,617 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.files_response import FilesResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from .. import core
+from ..types.allowed_file_types import AllowedFileTypes
+from ..types.file_response import FileResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class FilesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> FilesResponse:
+ """
+ Parameters
+ ----------
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FilesResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.files.get(
+ id_in="string",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "files",
+ method="GET",
+ params={
+ "id__in": id_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FilesResponse,
+ parse_obj_as(
+ type_=FilesResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def upload(
+ self, *, file: core.File, file_type: AllowedFileTypes, request_options: typing.Optional[RequestOptions] = None
+ ) -> FileResponse:
+ """
+ Parameters
+ ----------
+ file : core.File
+ See core.File for more documentation
+
+ file_type : AllowedFileTypes
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FileResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.files.upload(
+ file_type="ocr_results",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "files",
+ method="POST",
+ data={
+ "file_type": file_type,
+ },
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FileResponse,
+ parse_obj_as(
+ type_=FileResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, file_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> FileResponse:
+ """
+ Parameters
+ ----------
+ file_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FileResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.files.get_by_id(
+ file_id="file_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"files/{jsonable_encoder(file_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FileResponse,
+ parse_obj_as(
+ type_=FileResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete(self, file_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ file_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.files.delete(
+ file_id="file_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"files/{jsonable_encoder(file_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncFilesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> FilesResponse:
+ """
+ Parameters
+ ----------
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FilesResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.files.get(
+ id_in="string",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "files",
+ method="GET",
+ params={
+ "id__in": id_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FilesResponse,
+ parse_obj_as(
+ type_=FilesResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def upload(
+ self, *, file: core.File, file_type: AllowedFileTypes, request_options: typing.Optional[RequestOptions] = None
+ ) -> FileResponse:
+ """
+ Parameters
+ ----------
+ file : core.File
+ See core.File for more documentation
+
+ file_type : AllowedFileTypes
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FileResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.files.upload(
+ file_type="ocr_results",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "files",
+ method="POST",
+ data={
+ "file_type": file_type,
+ },
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FileResponse,
+ parse_obj_as(
+ type_=FileResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(self, file_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> FileResponse:
+ """
+ Parameters
+ ----------
+ file_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ FileResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.files.get_by_id(
+ file_id="file_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"files/{jsonable_encoder(file_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ FileResponse,
+ parse_obj_as(
+ type_=FileResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete(self, file_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ file_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.files.delete(
+ file_id="file_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"files/{jsonable_encoder(file_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/mail_templates/__init__.py b/src/monite/mail_templates/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/mail_templates/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/mail_templates/client.py b/src/monite/mail_templates/client.py
new file mode 100644
index 0000000..5bf5061
--- /dev/null
+++ b/src/monite/mail_templates/client.py
@@ -0,0 +1,1477 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.custom_templates_cursor_fields import CustomTemplatesCursorFields
+from ..types.document_object_type_request_enum import DocumentObjectTypeRequestEnum
+from ..core.request_options import RequestOptions
+from ..types.custom_templates_pagination_response import CustomTemplatesPaginationResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.language_code_enum import LanguageCodeEnum
+from ..types.custom_template_data_schema import CustomTemplateDataSchema
+from ..types.preview_template_response import PreviewTemplateResponse
+from ..types.system_templates import SystemTemplates
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class MailTemplatesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[CustomTemplatesCursorFields] = None,
+ type: typing.Optional[DocumentObjectTypeRequestEnum] = None,
+ type_in: typing.Optional[
+ typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]
+ ] = None,
+ type_not_in: typing.Optional[
+ typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]
+ ] = None,
+ is_default: typing.Optional[bool] = None,
+ name: typing.Optional[str] = None,
+ name_iexact: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_icontains: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CustomTemplatesPaginationResponse:
+ """
+ Get all custom templates
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[CustomTemplatesCursorFields]
+ Allowed sort fields
+
+ type : typing.Optional[DocumentObjectTypeRequestEnum]
+
+ type_in : typing.Optional[typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]]
+
+ type_not_in : typing.Optional[typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]]
+
+ is_default : typing.Optional[bool]
+
+ name : typing.Optional[str]
+
+ name_iexact : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_icontains : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplatesPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mail_templates",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "type": type,
+ "type__in": type_in,
+ "type__not_in": type_not_in,
+ "is_default": is_default,
+ "name": name,
+ "name__iexact": name_iexact,
+ "name__contains": name_contains,
+ "name__icontains": name_icontains,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplatesPaginationResponse,
+ parse_obj_as(
+ type_=CustomTemplatesPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ body_template: str,
+ name: str,
+ subject_template: str,
+ type: DocumentObjectTypeRequestEnum,
+ is_default: typing.Optional[bool] = OMIT,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CustomTemplateDataSchema:
+ """
+ Create custom template
+
+ Parameters
+ ----------
+ body_template : str
+ Jinja2 compatible string with email body
+
+ name : str
+ Custom template name
+
+ subject_template : str
+ Jinja2 compatible string with email subject
+
+ type : DocumentObjectTypeRequestEnum
+ Document type of content
+
+ is_default : typing.Optional[bool]
+ Is default template
+
+ language : typing.Optional[LanguageCodeEnum]
+ Lowercase ISO code of language
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.create(
+ body_template="body_template",
+ name="name",
+ subject_template="subject_template",
+ type="receivables_quote",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mail_templates",
+ method="POST",
+ json={
+ "body_template": body_template,
+ "is_default": is_default,
+ "language": language,
+ "name": name,
+ "subject_template": subject_template,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def preview(
+ self,
+ *,
+ body: str,
+ document_type: DocumentObjectTypeRequestEnum,
+ language_code: LanguageCodeEnum,
+ subject: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PreviewTemplateResponse:
+ """
+ Preview rendered template
+
+ Parameters
+ ----------
+ body : str
+ Body text of the template
+
+ document_type : DocumentObjectTypeRequestEnum
+ Document type of content
+
+ language_code : LanguageCodeEnum
+ Lowercase ISO code of language
+
+ subject : str
+ Subject text of the template
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PreviewTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.preview(
+ body="body",
+ document_type="receivables_quote",
+ language_code="ab",
+ subject="subject",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mail_templates/preview",
+ method="POST",
+ json={
+ "body": body,
+ "document_type": document_type,
+ "language_code": language_code,
+ "subject": subject,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PreviewTemplateResponse,
+ parse_obj_as(
+ type_=PreviewTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_system(self, *, request_options: typing.Optional[RequestOptions] = None) -> SystemTemplates:
+ """
+ Get all system templates
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SystemTemplates
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.get_system()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mail_templates/system",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SystemTemplates,
+ parse_obj_as(
+ type_=SystemTemplates, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CustomTemplateDataSchema:
+ """
+ Get custom template by ID
+
+ Parameters
+ ----------
+ template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.get_by_id(
+ template_id="template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, template_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete custom template bt ID
+
+ Parameters
+ ----------
+ template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.delete_by_id(
+ template_id="template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ template_id: str,
+ *,
+ body_template: typing.Optional[str] = OMIT,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ subject_template: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CustomTemplateDataSchema:
+ """
+ Update custom template by ID
+
+ Parameters
+ ----------
+ template_id : str
+
+ body_template : typing.Optional[str]
+ Jinja2 compatible string with email body
+
+ language : typing.Optional[LanguageCodeEnum]
+ Lowercase ISO code of language
+
+ name : typing.Optional[str]
+ Custom template name
+
+ subject_template : typing.Optional[str]
+ Jinja2 compatible string with email subject
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.update_by_id(
+ template_id="template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}",
+ method="PATCH",
+ json={
+ "body_template": body_template,
+ "language": language,
+ "name": name,
+ "subject_template": subject_template,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def make_default_by_id(
+ self, template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CustomTemplateDataSchema:
+ """
+ Make template default
+
+ Parameters
+ ----------
+ template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mail_templates.make_default_by_id(
+ template_id="template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncMailTemplatesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[CustomTemplatesCursorFields] = None,
+ type: typing.Optional[DocumentObjectTypeRequestEnum] = None,
+ type_in: typing.Optional[
+ typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]
+ ] = None,
+ type_not_in: typing.Optional[
+ typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]
+ ] = None,
+ is_default: typing.Optional[bool] = None,
+ name: typing.Optional[str] = None,
+ name_iexact: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_icontains: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CustomTemplatesPaginationResponse:
+ """
+ Get all custom templates
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[CustomTemplatesCursorFields]
+ Allowed sort fields
+
+ type : typing.Optional[DocumentObjectTypeRequestEnum]
+
+ type_in : typing.Optional[typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]]
+
+ type_not_in : typing.Optional[typing.Union[DocumentObjectTypeRequestEnum, typing.Sequence[DocumentObjectTypeRequestEnum]]]
+
+ is_default : typing.Optional[bool]
+
+ name : typing.Optional[str]
+
+ name_iexact : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_icontains : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplatesPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mail_templates",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "type": type,
+ "type__in": type_in,
+ "type__not_in": type_not_in,
+ "is_default": is_default,
+ "name": name,
+ "name__iexact": name_iexact,
+ "name__contains": name_contains,
+ "name__icontains": name_icontains,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplatesPaginationResponse,
+ parse_obj_as(
+ type_=CustomTemplatesPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ body_template: str,
+ name: str,
+ subject_template: str,
+ type: DocumentObjectTypeRequestEnum,
+ is_default: typing.Optional[bool] = OMIT,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CustomTemplateDataSchema:
+ """
+ Create custom template
+
+ Parameters
+ ----------
+ body_template : str
+ Jinja2 compatible string with email body
+
+ name : str
+ Custom template name
+
+ subject_template : str
+ Jinja2 compatible string with email subject
+
+ type : DocumentObjectTypeRequestEnum
+ Document type of content
+
+ is_default : typing.Optional[bool]
+ Is default template
+
+ language : typing.Optional[LanguageCodeEnum]
+ Lowercase ISO code of language
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.create(
+ body_template="body_template",
+ name="name",
+ subject_template="subject_template",
+ type="receivables_quote",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mail_templates",
+ method="POST",
+ json={
+ "body_template": body_template,
+ "is_default": is_default,
+ "language": language,
+ "name": name,
+ "subject_template": subject_template,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def preview(
+ self,
+ *,
+ body: str,
+ document_type: DocumentObjectTypeRequestEnum,
+ language_code: LanguageCodeEnum,
+ subject: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PreviewTemplateResponse:
+ """
+ Preview rendered template
+
+ Parameters
+ ----------
+ body : str
+ Body text of the template
+
+ document_type : DocumentObjectTypeRequestEnum
+ Document type of content
+
+ language_code : LanguageCodeEnum
+ Lowercase ISO code of language
+
+ subject : str
+ Subject text of the template
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PreviewTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.preview(
+ body="body",
+ document_type="receivables_quote",
+ language_code="ab",
+ subject="subject",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mail_templates/preview",
+ method="POST",
+ json={
+ "body": body,
+ "document_type": document_type,
+ "language_code": language_code,
+ "subject": subject,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PreviewTemplateResponse,
+ parse_obj_as(
+ type_=PreviewTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_system(self, *, request_options: typing.Optional[RequestOptions] = None) -> SystemTemplates:
+ """
+ Get all system templates
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SystemTemplates
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.get_system()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mail_templates/system",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SystemTemplates,
+ parse_obj_as(
+ type_=SystemTemplates, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CustomTemplateDataSchema:
+ """
+ Get custom template by ID
+
+ Parameters
+ ----------
+ template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.get_by_id(
+ template_id="template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, template_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete custom template bt ID
+
+ Parameters
+ ----------
+ template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.delete_by_id(
+ template_id="template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ template_id: str,
+ *,
+ body_template: typing.Optional[str] = OMIT,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ subject_template: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> CustomTemplateDataSchema:
+ """
+ Update custom template by ID
+
+ Parameters
+ ----------
+ template_id : str
+
+ body_template : typing.Optional[str]
+ Jinja2 compatible string with email body
+
+ language : typing.Optional[LanguageCodeEnum]
+ Lowercase ISO code of language
+
+ name : typing.Optional[str]
+ Custom template name
+
+ subject_template : typing.Optional[str]
+ Jinja2 compatible string with email subject
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.update_by_id(
+ template_id="template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}",
+ method="PATCH",
+ json={
+ "body_template": body_template,
+ "language": language,
+ "name": name,
+ "subject_template": subject_template,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def make_default_by_id(
+ self, template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> CustomTemplateDataSchema:
+ """
+ Make template default
+
+ Parameters
+ ----------
+ template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ CustomTemplateDataSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mail_templates.make_default_by_id(
+ template_id="template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"mail_templates/{jsonable_encoder(template_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ CustomTemplateDataSchema,
+ parse_obj_as(
+ type_=CustomTemplateDataSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/mailbox_domains/__init__.py b/src/monite/mailbox_domains/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/mailbox_domains/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/mailbox_domains/client.py b/src/monite/mailbox_domains/client.py
new file mode 100644
index 0000000..aa62f34
--- /dev/null
+++ b/src/monite/mailbox_domains/client.py
@@ -0,0 +1,781 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.domain_list_response import DomainListResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.domain_response import DomainResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.bad_request_error import BadRequestError
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_found_error import NotFoundError
+from ..types.verify_response import VerifyResponse
+from ..errors.conflict_error import ConflictError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class MailboxDomainsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> DomainListResponse:
+ """
+ Get all domains owned by partner_id
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DomainListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailbox_domains.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mailbox_domains",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ DomainListResponse,
+ parse_obj_as(
+ type_=DomainListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(self, *, domain: str, request_options: typing.Optional[RequestOptions] = None) -> DomainResponse:
+ """
+ Create domain for the partner_id
+
+ Parameters
+ ----------
+ domain : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DomainResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailbox_domains.create(
+ domain="domain",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mailbox_domains",
+ method="POST",
+ json={
+ "domain": domain,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ DomainResponse,
+ parse_obj_as(
+ type_=DomainResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, domain_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete domain for the partner_id
+
+ Parameters
+ ----------
+ domain_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailbox_domains.delete_by_id(
+ domain_id="domain_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"mailbox_domains/{jsonable_encoder(domain_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def verify_by_id(
+ self, domain_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> VerifyResponse:
+ """
+ Verify domain for the partner_id
+
+ Parameters
+ ----------
+ domain_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VerifyResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailbox_domains.verify_by_id(
+ domain_id="domain_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"mailbox_domains/{jsonable_encoder(domain_id)}/verify",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VerifyResponse,
+ parse_obj_as(
+ type_=VerifyResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncMailboxDomainsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> DomainListResponse:
+ """
+ Get all domains owned by partner_id
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DomainListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailbox_domains.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mailbox_domains",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ DomainListResponse,
+ parse_obj_as(
+ type_=DomainListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(self, *, domain: str, request_options: typing.Optional[RequestOptions] = None) -> DomainResponse:
+ """
+ Create domain for the partner_id
+
+ Parameters
+ ----------
+ domain : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ DomainResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailbox_domains.create(
+ domain="domain",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mailbox_domains",
+ method="POST",
+ json={
+ "domain": domain,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ DomainResponse,
+ parse_obj_as(
+ type_=DomainResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, domain_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete domain for the partner_id
+
+ Parameters
+ ----------
+ domain_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailbox_domains.delete_by_id(
+ domain_id="domain_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"mailbox_domains/{jsonable_encoder(domain_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def verify_by_id(
+ self, domain_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> VerifyResponse:
+ """
+ Verify domain for the partner_id
+
+ Parameters
+ ----------
+ domain_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VerifyResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailbox_domains.verify_by_id(
+ domain_id="domain_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"mailbox_domains/{jsonable_encoder(domain_id)}/verify",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VerifyResponse,
+ parse_obj_as(
+ type_=VerifyResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/mailboxes/__init__.py b/src/monite/mailboxes/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/mailboxes/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/mailboxes/client.py b/src/monite/mailboxes/client.py
new file mode 100644
index 0000000..76fa2f3
--- /dev/null
+++ b/src/monite/mailboxes/client.py
@@ -0,0 +1,701 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.mailbox_data_response import MailboxDataResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.mailbox_response import MailboxResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.bad_request_error import BadRequestError
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_found_error import NotFoundError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class MailboxesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> MailboxDataResponse:
+ """
+ Get all mailboxes owned by Entity
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MailboxDataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailboxes.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mailboxes",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MailboxDataResponse,
+ parse_obj_as(
+ type_=MailboxDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self, *, mailbox_domain_id: str, mailbox_name: str, request_options: typing.Optional[RequestOptions] = None
+ ) -> MailboxResponse:
+ """
+ Create a new mailbox
+
+ Parameters
+ ----------
+ mailbox_domain_id : str
+
+ mailbox_name : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MailboxResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailboxes.create(
+ mailbox_domain_id="mailbox_domain_id",
+ mailbox_name="mailbox_name",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mailboxes",
+ method="POST",
+ json={
+ "mailbox_domain_id": mailbox_domain_id,
+ "mailbox_name": mailbox_name,
+ "related_object_type": "payable",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MailboxResponse,
+ parse_obj_as(
+ type_=MailboxResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def search(
+ self, *, entity_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ ) -> MailboxDataResponse:
+ """
+ Get all mailboxes owned by Entity
+
+ Parameters
+ ----------
+ entity_ids : typing.Sequence[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MailboxDataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailboxes.search(
+ entity_ids=["entity_ids"],
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "mailboxes/search",
+ method="POST",
+ json={
+ "entity_ids": entity_ids,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MailboxDataResponse,
+ parse_obj_as(
+ type_=MailboxDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, mailbox_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete mailbox
+
+ Parameters
+ ----------
+ mailbox_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.mailboxes.delete_by_id(
+ mailbox_id="mailbox_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"mailboxes/{jsonable_encoder(mailbox_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncMailboxesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> MailboxDataResponse:
+ """
+ Get all mailboxes owned by Entity
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MailboxDataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailboxes.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mailboxes",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MailboxDataResponse,
+ parse_obj_as(
+ type_=MailboxDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self, *, mailbox_domain_id: str, mailbox_name: str, request_options: typing.Optional[RequestOptions] = None
+ ) -> MailboxResponse:
+ """
+ Create a new mailbox
+
+ Parameters
+ ----------
+ mailbox_domain_id : str
+
+ mailbox_name : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MailboxResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailboxes.create(
+ mailbox_domain_id="mailbox_domain_id",
+ mailbox_name="mailbox_name",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mailboxes",
+ method="POST",
+ json={
+ "mailbox_domain_id": mailbox_domain_id,
+ "mailbox_name": mailbox_name,
+ "related_object_type": "payable",
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MailboxResponse,
+ parse_obj_as(
+ type_=MailboxResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def search(
+ self, *, entity_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
+ ) -> MailboxDataResponse:
+ """
+ Get all mailboxes owned by Entity
+
+ Parameters
+ ----------
+ entity_ids : typing.Sequence[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ MailboxDataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailboxes.search(
+ entity_ids=["entity_ids"],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "mailboxes/search",
+ method="POST",
+ json={
+ "entity_ids": entity_ids,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ MailboxDataResponse,
+ parse_obj_as(
+ type_=MailboxDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, mailbox_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete mailbox
+
+ Parameters
+ ----------
+ mailbox_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.mailboxes.delete_by_id(
+ mailbox_id="mailbox_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"mailboxes/{jsonable_encoder(mailbox_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/measure_units/__init__.py b/src/monite/measure_units/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/measure_units/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/measure_units/client.py b/src/monite/measure_units/client.py
new file mode 100644
index 0000000..f4d65ae
--- /dev/null
+++ b/src/monite/measure_units/client.py
@@ -0,0 +1,1129 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.unit_list_response import UnitListResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.unit_response import UnitResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.not_found_error import NotFoundError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class MeasureUnitsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> UnitListResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.measure_units.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "measure_units",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitListResponse,
+ parse_obj_as(
+ type_=UnitListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ description: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> UnitResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ description : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.measure_units.create(
+ name="name",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "measure_units",
+ method="POST",
+ json={
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitResponse,
+ parse_obj_as(
+ type_=UnitResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, unit_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> UnitResponse:
+ """
+ Parameters
+ ----------
+ unit_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.measure_units.get_by_id(
+ unit_id="unit_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"measure_units/{jsonable_encoder(unit_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitResponse,
+ parse_obj_as(
+ type_=UnitResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, unit_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ unit_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.measure_units.delete_by_id(
+ unit_id="unit_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"measure_units/{jsonable_encoder(unit_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ unit_id: str,
+ *,
+ description: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> UnitResponse:
+ """
+ Parameters
+ ----------
+ unit_id : str
+
+ description : typing.Optional[str]
+
+ name : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.measure_units.update_by_id(
+ unit_id="unit_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"measure_units/{jsonable_encoder(unit_id)}",
+ method="PATCH",
+ json={
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitResponse,
+ parse_obj_as(
+ type_=UnitResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncMeasureUnitsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> UnitListResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.measure_units.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "measure_units",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitListResponse,
+ parse_obj_as(
+ type_=UnitListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ description: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> UnitResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ description : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.measure_units.create(
+ name="name",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "measure_units",
+ method="POST",
+ json={
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitResponse,
+ parse_obj_as(
+ type_=UnitResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(self, unit_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> UnitResponse:
+ """
+ Parameters
+ ----------
+ unit_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.measure_units.get_by_id(
+ unit_id="unit_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"measure_units/{jsonable_encoder(unit_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitResponse,
+ parse_obj_as(
+ type_=UnitResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, unit_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ unit_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.measure_units.delete_by_id(
+ unit_id="unit_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"measure_units/{jsonable_encoder(unit_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ unit_id: str,
+ *,
+ description: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> UnitResponse:
+ """
+ Parameters
+ ----------
+ unit_id : str
+
+ description : typing.Optional[str]
+
+ name : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ UnitResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.measure_units.update_by_id(
+ unit_id="unit_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"measure_units/{jsonable_encoder(unit_id)}",
+ method="PATCH",
+ json={
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ UnitResponse,
+ parse_obj_as(
+ type_=UnitResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/onboarding_links/__init__.py b/src/monite/onboarding_links/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/onboarding_links/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/onboarding_links/client.py b/src/monite/onboarding_links/client.py
new file mode 100644
index 0000000..cd68066
--- /dev/null
+++ b/src/monite/onboarding_links/client.py
@@ -0,0 +1,213 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.onboarding_link_public_response import OnboardingLinkPublicResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class OnboardingLinksClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def create(
+ self,
+ *,
+ expires_at: dt.datetime,
+ refresh_url: str,
+ return_url: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OnboardingLinkPublicResponse:
+ """
+ Parameters
+ ----------
+ expires_at : dt.datetime
+
+ refresh_url : str
+
+ return_url : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OnboardingLinkPublicResponse
+ Successful Response
+
+ Examples
+ --------
+ import datetime
+
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.onboarding_links.create(
+ expires_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ refresh_url="refresh_url",
+ return_url="return_url",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "onboarding_links",
+ method="POST",
+ json={
+ "expires_at": expires_at,
+ "refresh_url": refresh_url,
+ "return_url": return_url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OnboardingLinkPublicResponse,
+ parse_obj_as(
+ type_=OnboardingLinkPublicResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncOnboardingLinksClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def create(
+ self,
+ *,
+ expires_at: dt.datetime,
+ refresh_url: str,
+ return_url: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OnboardingLinkPublicResponse:
+ """
+ Parameters
+ ----------
+ expires_at : dt.datetime
+
+ refresh_url : str
+
+ return_url : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OnboardingLinkPublicResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+ import datetime
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.onboarding_links.create(
+ expires_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ refresh_url="refresh_url",
+ return_url="return_url",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "onboarding_links",
+ method="POST",
+ json={
+ "expires_at": expires_at,
+ "refresh_url": refresh_url,
+ "return_url": return_url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OnboardingLinkPublicResponse,
+ parse_obj_as(
+ type_=OnboardingLinkPublicResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/overdue_reminders/__init__.py b/src/monite/overdue_reminders/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/overdue_reminders/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/overdue_reminders/client.py b/src/monite/overdue_reminders/client.py
new file mode 100644
index 0000000..5f20660
--- /dev/null
+++ b/src/monite/overdue_reminders/client.py
@@ -0,0 +1,1136 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.all_overdue_reminders_response import AllOverdueRemindersResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unauthorized_error import UnauthorizedError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.recipients import Recipients
+from ..types.overdue_reminder_term import OverdueReminderTerm
+from ..types.overdue_reminder_response import OverdueReminderResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..errors.bad_request_error import BadRequestError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.not_found_error import NotFoundError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class OverdueRemindersClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AllOverdueRemindersResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AllOverdueRemindersResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.overdue_reminders.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "overdue_reminders",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AllOverdueRemindersResponse,
+ parse_obj_as(
+ type_=AllOverdueRemindersResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ recipients: typing.Optional[Recipients] = OMIT,
+ terms: typing.Optional[typing.Sequence[OverdueReminderTerm]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OverdueReminderResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ recipients : typing.Optional[Recipients]
+
+ terms : typing.Optional[typing.Sequence[OverdueReminderTerm]]
+ Overdue reminder terms to send for payment
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OverdueReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.overdue_reminders.create(
+ name="name",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "overdue_reminders",
+ method="POST",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "terms": convert_and_respect_annotation_metadata(
+ object_=terms, annotation=typing.Sequence[OverdueReminderTerm], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OverdueReminderResponse,
+ parse_obj_as(
+ type_=OverdueReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, overdue_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> OverdueReminderResponse:
+ """
+ Parameters
+ ----------
+ overdue_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OverdueReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.overdue_reminders.get_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"overdue_reminders/{jsonable_encoder(overdue_reminder_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OverdueReminderResponse,
+ parse_obj_as(
+ type_=OverdueReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, overdue_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ overdue_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.overdue_reminders.delete_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"overdue_reminders/{jsonable_encoder(overdue_reminder_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ overdue_reminder_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ recipients: typing.Optional[Recipients] = OMIT,
+ terms: typing.Optional[typing.Sequence[OverdueReminderTerm]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OverdueReminderResponse:
+ """
+ Parameters
+ ----------
+ overdue_reminder_id : str
+
+ name : typing.Optional[str]
+
+ recipients : typing.Optional[Recipients]
+
+ terms : typing.Optional[typing.Sequence[OverdueReminderTerm]]
+ Overdue reminder terms to send for payment
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OverdueReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.overdue_reminders.update_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"overdue_reminders/{jsonable_encoder(overdue_reminder_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "terms": convert_and_respect_annotation_metadata(
+ object_=terms, annotation=typing.Sequence[OverdueReminderTerm], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OverdueReminderResponse,
+ parse_obj_as(
+ type_=OverdueReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncOverdueRemindersClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> AllOverdueRemindersResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ AllOverdueRemindersResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.overdue_reminders.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "overdue_reminders",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ AllOverdueRemindersResponse,
+ parse_obj_as(
+ type_=AllOverdueRemindersResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ recipients: typing.Optional[Recipients] = OMIT,
+ terms: typing.Optional[typing.Sequence[OverdueReminderTerm]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OverdueReminderResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ recipients : typing.Optional[Recipients]
+
+ terms : typing.Optional[typing.Sequence[OverdueReminderTerm]]
+ Overdue reminder terms to send for payment
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OverdueReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.overdue_reminders.create(
+ name="name",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "overdue_reminders",
+ method="POST",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "terms": convert_and_respect_annotation_metadata(
+ object_=terms, annotation=typing.Sequence[OverdueReminderTerm], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OverdueReminderResponse,
+ parse_obj_as(
+ type_=OverdueReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, overdue_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> OverdueReminderResponse:
+ """
+ Parameters
+ ----------
+ overdue_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OverdueReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.overdue_reminders.get_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"overdue_reminders/{jsonable_encoder(overdue_reminder_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OverdueReminderResponse,
+ parse_obj_as(
+ type_=OverdueReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, overdue_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ overdue_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.overdue_reminders.delete_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"overdue_reminders/{jsonable_encoder(overdue_reminder_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ overdue_reminder_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ recipients: typing.Optional[Recipients] = OMIT,
+ terms: typing.Optional[typing.Sequence[OverdueReminderTerm]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> OverdueReminderResponse:
+ """
+ Parameters
+ ----------
+ overdue_reminder_id : str
+
+ name : typing.Optional[str]
+
+ recipients : typing.Optional[Recipients]
+
+ terms : typing.Optional[typing.Sequence[OverdueReminderTerm]]
+ Overdue reminder terms to send for payment
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ OverdueReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.overdue_reminders.update_by_id(
+ overdue_reminder_id="overdue_reminder_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"overdue_reminders/{jsonable_encoder(overdue_reminder_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "terms": convert_and_respect_annotation_metadata(
+ object_=terms, annotation=typing.Sequence[OverdueReminderTerm], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ OverdueReminderResponse,
+ parse_obj_as(
+ type_=OverdueReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/partner_settings/__init__.py b/src/monite/partner_settings/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/partner_settings/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/partner_settings/client.py b/src/monite/partner_settings/client.py
new file mode 100644
index 0000000..5b74678
--- /dev/null
+++ b/src/monite/partner_settings/client.py
@@ -0,0 +1,514 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.partner_project_settings_response import PartnerProjectSettingsResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.accounting_settings_payload import AccountingSettingsPayload
+from ..types.api_version import ApiVersion
+from ..types.currency_settings import CurrencySettings
+from ..types.e_invoicing_settings_payload import EInvoicingSettingsPayload
+from ..types.mail_settings_payload import MailSettingsPayload
+from ..types.payable_settings_payload import PayableSettingsPayload
+from ..types.payments_settings_payload import PaymentsSettingsPayload
+from ..types.receivable_settings_payload import ReceivableSettingsPayload
+from ..types.unit import Unit
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PartnerSettingsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> PartnerProjectSettingsResponse:
+ """
+ Retrieve all settings for this partner.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerProjectSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.partner_settings.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "settings",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerProjectSettingsResponse,
+ parse_obj_as(
+ type_=PartnerProjectSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update(
+ self,
+ *,
+ accounting: typing.Optional[AccountingSettingsPayload] = OMIT,
+ api_version: typing.Optional[ApiVersion] = OMIT,
+ commercial_conditions: typing.Optional[typing.Sequence[str]] = OMIT,
+ currency: typing.Optional[CurrencySettings] = OMIT,
+ default_role: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ einvoicing: typing.Optional[EInvoicingSettingsPayload] = OMIT,
+ mail: typing.Optional[MailSettingsPayload] = OMIT,
+ payable: typing.Optional[PayableSettingsPayload] = OMIT,
+ payments: typing.Optional[PaymentsSettingsPayload] = OMIT,
+ receivable: typing.Optional[ReceivableSettingsPayload] = OMIT,
+ units: typing.Optional[typing.Sequence[Unit]] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PartnerProjectSettingsResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ accounting : typing.Optional[AccountingSettingsPayload]
+ Settings for the accounting module.
+
+ api_version : typing.Optional[ApiVersion]
+ Default API version for partner.
+
+ commercial_conditions : typing.Optional[typing.Sequence[str]]
+ Commercial conditions for receivables.
+
+ currency : typing.Optional[CurrencySettings]
+ Custom currency exchange rates.
+
+ default_role : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ A default role to provision upon new entity creation.
+
+ einvoicing : typing.Optional[EInvoicingSettingsPayload]
+ Settings for the e-invoicing module.
+
+ mail : typing.Optional[MailSettingsPayload]
+ Settings for email and mailboxes.
+
+ payable : typing.Optional[PayableSettingsPayload]
+ Settings for the payables module.
+
+ payments : typing.Optional[PaymentsSettingsPayload]
+ Settings for the payments module.
+
+ receivable : typing.Optional[ReceivableSettingsPayload]
+ Settings for the receivables module.
+
+ units : typing.Optional[typing.Sequence[Unit]]
+ Measurement units.
+
+ website : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerProjectSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.partner_settings.update()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "settings",
+ method="PATCH",
+ json={
+ "accounting": convert_and_respect_annotation_metadata(
+ object_=accounting, annotation=AccountingSettingsPayload, direction="write"
+ ),
+ "api_version": api_version,
+ "commercial_conditions": commercial_conditions,
+ "currency": convert_and_respect_annotation_metadata(
+ object_=currency, annotation=CurrencySettings, direction="write"
+ ),
+ "default_role": default_role,
+ "einvoicing": convert_and_respect_annotation_metadata(
+ object_=einvoicing, annotation=EInvoicingSettingsPayload, direction="write"
+ ),
+ "mail": convert_and_respect_annotation_metadata(
+ object_=mail, annotation=MailSettingsPayload, direction="write"
+ ),
+ "payable": convert_and_respect_annotation_metadata(
+ object_=payable, annotation=PayableSettingsPayload, direction="write"
+ ),
+ "payments": convert_and_respect_annotation_metadata(
+ object_=payments, annotation=PaymentsSettingsPayload, direction="write"
+ ),
+ "receivable": convert_and_respect_annotation_metadata(
+ object_=receivable, annotation=ReceivableSettingsPayload, direction="write"
+ ),
+ "units": convert_and_respect_annotation_metadata(
+ object_=units, annotation=typing.Sequence[Unit], direction="write"
+ ),
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerProjectSettingsResponse,
+ parse_obj_as(
+ type_=PartnerProjectSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPartnerSettingsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> PartnerProjectSettingsResponse:
+ """
+ Retrieve all settings for this partner.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerProjectSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.partner_settings.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "settings",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerProjectSettingsResponse,
+ parse_obj_as(
+ type_=PartnerProjectSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update(
+ self,
+ *,
+ accounting: typing.Optional[AccountingSettingsPayload] = OMIT,
+ api_version: typing.Optional[ApiVersion] = OMIT,
+ commercial_conditions: typing.Optional[typing.Sequence[str]] = OMIT,
+ currency: typing.Optional[CurrencySettings] = OMIT,
+ default_role: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ einvoicing: typing.Optional[EInvoicingSettingsPayload] = OMIT,
+ mail: typing.Optional[MailSettingsPayload] = OMIT,
+ payable: typing.Optional[PayableSettingsPayload] = OMIT,
+ payments: typing.Optional[PaymentsSettingsPayload] = OMIT,
+ receivable: typing.Optional[ReceivableSettingsPayload] = OMIT,
+ units: typing.Optional[typing.Sequence[Unit]] = OMIT,
+ website: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PartnerProjectSettingsResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ accounting : typing.Optional[AccountingSettingsPayload]
+ Settings for the accounting module.
+
+ api_version : typing.Optional[ApiVersion]
+ Default API version for partner.
+
+ commercial_conditions : typing.Optional[typing.Sequence[str]]
+ Commercial conditions for receivables.
+
+ currency : typing.Optional[CurrencySettings]
+ Custom currency exchange rates.
+
+ default_role : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ A default role to provision upon new entity creation.
+
+ einvoicing : typing.Optional[EInvoicingSettingsPayload]
+ Settings for the e-invoicing module.
+
+ mail : typing.Optional[MailSettingsPayload]
+ Settings for email and mailboxes.
+
+ payable : typing.Optional[PayableSettingsPayload]
+ Settings for the payables module.
+
+ payments : typing.Optional[PaymentsSettingsPayload]
+ Settings for the payments module.
+
+ receivable : typing.Optional[ReceivableSettingsPayload]
+ Settings for the receivables module.
+
+ units : typing.Optional[typing.Sequence[Unit]]
+ Measurement units.
+
+ website : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PartnerProjectSettingsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.partner_settings.update()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "settings",
+ method="PATCH",
+ json={
+ "accounting": convert_and_respect_annotation_metadata(
+ object_=accounting, annotation=AccountingSettingsPayload, direction="write"
+ ),
+ "api_version": api_version,
+ "commercial_conditions": commercial_conditions,
+ "currency": convert_and_respect_annotation_metadata(
+ object_=currency, annotation=CurrencySettings, direction="write"
+ ),
+ "default_role": default_role,
+ "einvoicing": convert_and_respect_annotation_metadata(
+ object_=einvoicing, annotation=EInvoicingSettingsPayload, direction="write"
+ ),
+ "mail": convert_and_respect_annotation_metadata(
+ object_=mail, annotation=MailSettingsPayload, direction="write"
+ ),
+ "payable": convert_and_respect_annotation_metadata(
+ object_=payable, annotation=PayableSettingsPayload, direction="write"
+ ),
+ "payments": convert_and_respect_annotation_metadata(
+ object_=payments, annotation=PaymentsSettingsPayload, direction="write"
+ ),
+ "receivable": convert_and_respect_annotation_metadata(
+ object_=receivable, annotation=ReceivableSettingsPayload, direction="write"
+ ),
+ "units": convert_and_respect_annotation_metadata(
+ object_=units, annotation=typing.Sequence[Unit], direction="write"
+ ),
+ "website": website,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PartnerProjectSettingsResponse,
+ parse_obj_as(
+ type_=PartnerProjectSettingsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/payables/__init__.py b/src/monite/payables/__init__.py
new file mode 100644
index 0000000..fb26886
--- /dev/null
+++ b/src/monite/payables/__init__.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from . import line_items
+
+__all__ = ["line_items"]
diff --git a/src/monite/payables/client.py b/src/monite/payables/client.py
new file mode 100644
index 0000000..b98e6c8
--- /dev/null
+++ b/src/monite/payables/client.py
@@ -0,0 +1,5901 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from .line_items.client import LineItemsClient
+from ..types.order_enum import OrderEnum
+from ..types.payable_cursor_fields import PayableCursorFields
+import datetime as dt
+from ..types.payable_state_enum import PayableStateEnum
+from ..types.currency_enum import CurrencyEnum
+from ..types.source_of_payable_data_enum import SourceOfPayableDataEnum
+from ..types.ocr_status_enum import OcrStatusEnum
+from ..core.request_options import RequestOptions
+from ..types.payable_pagination_response import PayablePaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.payable_payment_terms_create_payload import PayablePaymentTermsCreatePayload
+from ..types.suggested_payment_term import SuggestedPaymentTerm
+from ..types.payable_response_schema import PayableResponseSchema
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..types.payable_aggregated_data_response import PayableAggregatedDataResponse
+from .. import core
+from ..errors.conflict_error import ConflictError
+from ..types.payable_validations_resource import PayableValidationsResource
+from ..types.payables_fields_allowed_for_validate import PayablesFieldsAllowedForValidate
+from ..types.payable_templates_variables_object_list import PayableTemplatesVariablesObjectList
+from ..errors.not_found_error import NotFoundError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..types.counterpart_raw_data_update_request import CounterpartRawDataUpdateRequest
+from ..types.payable_validation_response import PayableValidationResponse
+from ..core.client_wrapper import AsyncClientWrapper
+from .line_items.client import AsyncLineItemsClient
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PayablesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.line_items = LineItemsClient(client_wrapper=self._client_wrapper)
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PayableCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ status: typing.Optional[PayableStateEnum] = None,
+ status_in: typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ total_amount: typing.Optional[int] = None,
+ total_amount_gt: typing.Optional[int] = None,
+ total_amount_lt: typing.Optional[int] = None,
+ total_amount_gte: typing.Optional[int] = None,
+ total_amount_lte: typing.Optional[int] = None,
+ amount: typing.Optional[int] = None,
+ amount_gt: typing.Optional[int] = None,
+ amount_lt: typing.Optional[int] = None,
+ amount_gte: typing.Optional[int] = None,
+ amount_lte: typing.Optional[int] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ search_text: typing.Optional[str] = None,
+ due_date: typing.Optional[str] = None,
+ due_date_gt: typing.Optional[str] = None,
+ due_date_lt: typing.Optional[str] = None,
+ due_date_gte: typing.Optional[str] = None,
+ due_date_lte: typing.Optional[str] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_contains: typing.Optional[str] = None,
+ document_id_icontains: typing.Optional[str] = None,
+ was_created_by_user_id: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ source_of_payable_data: typing.Optional[SourceOfPayableDataEnum] = None,
+ ocr_status: typing.Optional[OcrStatusEnum] = None,
+ line_item_id: typing.Optional[str] = None,
+ purchase_order_id: typing.Optional[str] = None,
+ project_id: typing.Optional[str] = None,
+ tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayablePaginationResponse:
+ """
+ Lists all payables from the connected entity.
+
+ If you already have the data of the payable (amount in [minor units](https://docs.monite.com/docs/currencies#minor-units), currency, vendor information, and other details)
+ stored somewhere as individual attributes, you can create a payable with these attributes by calling [POST
+ /payables](https://docs.monite.com/reference/post_payables) and providing the [base64-encoded](https://en.wikipedia.org/wiki/Base64) contents of the original invoice file in the field `base64_encoded_file`.
+
+ A payable is a financial document given by an entity`s supplier itemizing the purchase of a good or a service and
+ demanding payment.
+
+ The `file_name` field is optional. If omitted, it defaults to “default_file_name”. If the settings are configured
+ to automatically set `suggested_payment_term`, this object can be omitted from the request body.
+
+ The `id` generated for this payable can be used in other API calls to update the data of this payable or trigger [
+ status transitions](https://docs.monite.com/docs/payable-status-transitions), for example. essential data
+ fields to move from `draft` to `new`
+
+ Related guide: [Create a payable from data](https://docs.monite.com/docs/collect-payables#create-a-payable-from-data)
+
+ See also:
+
+ [Automatic calculation of due date](https://docs.monite.com/docs/collect-payables#automatic-calculation-of-due-date)
+
+ [Suggested payment date](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+ [Attach file](https://docs.monite.com/docs/collect-payables#attach-file)
+
+ [Collect payables by email](https://docs.monite.com/docs/collect-payables#send-payables-by-email)
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PayableCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ status : typing.Optional[PayableStateEnum]
+
+ status_in : typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ total_amount : typing.Optional[int]
+
+ total_amount_gt : typing.Optional[int]
+
+ total_amount_lt : typing.Optional[int]
+
+ total_amount_gte : typing.Optional[int]
+
+ total_amount_lte : typing.Optional[int]
+
+ amount : typing.Optional[int]
+
+ amount_gt : typing.Optional[int]
+
+ amount_lt : typing.Optional[int]
+
+ amount_gte : typing.Optional[int]
+
+ amount_lte : typing.Optional[int]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ search_text : typing.Optional[str]
+
+ due_date : typing.Optional[str]
+
+ due_date_gt : typing.Optional[str]
+
+ due_date_lt : typing.Optional[str]
+
+ due_date_gte : typing.Optional[str]
+
+ due_date_lte : typing.Optional[str]
+
+ document_id : typing.Optional[str]
+
+ document_id_contains : typing.Optional[str]
+
+ document_id_icontains : typing.Optional[str]
+
+ was_created_by_user_id : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ source_of_payable_data : typing.Optional[SourceOfPayableDataEnum]
+
+ ocr_status : typing.Optional[OcrStatusEnum]
+
+ line_item_id : typing.Optional[str]
+ Search for a payable by the identifier of the line item associated with it.
+
+ purchase_order_id : typing.Optional[str]
+ Search for a payable by the identifier of the purchase order associated with it.
+
+ project_id : typing.Optional[str]
+ Search for a payable by the identifier of the project associated with it.
+
+ tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Search for a payable by the identifiers of the tags associated with it.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayablePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "status": status,
+ "status__in": status_in,
+ "id__in": id_in,
+ "total_amount": total_amount,
+ "total_amount__gt": total_amount_gt,
+ "total_amount__lt": total_amount_lt,
+ "total_amount__gte": total_amount_gte,
+ "total_amount__lte": total_amount_lte,
+ "amount": amount,
+ "amount__gt": amount_gt,
+ "amount__lt": amount_lt,
+ "amount__gte": amount_gte,
+ "amount__lte": amount_lte,
+ "currency": currency,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "search_text": search_text,
+ "due_date": due_date,
+ "due_date__gt": due_date_gt,
+ "due_date__lt": due_date_lt,
+ "due_date__gte": due_date_gte,
+ "due_date__lte": due_date_lte,
+ "document_id": document_id,
+ "document_id__contains": document_id_contains,
+ "document_id__icontains": document_id_icontains,
+ "was_created_by_user_id": was_created_by_user_id,
+ "counterpart_id": counterpart_id,
+ "source_of_payable_data": source_of_payable_data,
+ "ocr_status": ocr_status,
+ "line_item_id": line_item_id,
+ "purchase_order_id": purchase_order_id,
+ "project_id": project_id,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayablePaginationResponse,
+ parse_obj_as(
+ type_=PayablePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ base64encoded_file: typing.Optional[str] = OMIT,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ counterpart_bank_account_id: typing.Optional[str] = OMIT,
+ counterpart_id: typing.Optional[str] = OMIT,
+ counterpart_vat_id_id: typing.Optional[str] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ document_id: typing.Optional[str] = OMIT,
+ due_date: typing.Optional[str] = OMIT,
+ file_name: typing.Optional[str] = OMIT,
+ issued_at: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ payment_terms: typing.Optional[PayablePaymentTermsCreatePayload] = OMIT,
+ project_id: typing.Optional[str] = OMIT,
+ purchase_order_id: typing.Optional[str] = OMIT,
+ sender: typing.Optional[str] = OMIT,
+ subtotal: typing.Optional[int] = OMIT,
+ suggested_payment_term: typing.Optional[SuggestedPaymentTerm] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ tax_amount: typing.Optional[int] = OMIT,
+ total_amount: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableResponseSchema:
+ """
+ Add a new payable by providing the amount, currency, vendor name, and other details.
+ You can provide the base64_encoded contents of the original invoice file in the field `base64_encoded_file`.
+
+ You can use this endpoint to bypass the Monite OCR service and provide the data directly
+ (for example, if you already have the data in place).
+
+ A newly created payable has the the `draft` [status](https://docs.monite.com/docs/payables-lifecycle).
+
+ Parameters
+ ----------
+ base64encoded_file : typing.Optional[str]
+ Base64-encoded contents of the original issued payable. The file is provided for reference purposes as the original source of the data.
+
+ Any file formats are allowed. The most common formats are PDF, PNG, JPEG, TIFF.
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service
+
+ counterpart_bank_account_id : typing.Optional[str]
+ The ID of counterpart bank account object stored in counterparts service
+
+ counterpart_id : typing.Optional[str]
+ The ID of the counterpart object that represents the vendor or supplier.
+
+ counterpart_vat_id_id : typing.Optional[str]
+ The ID of counterpart VAT ID object stored in counterparts service
+
+ currency : typing.Optional[CurrencyEnum]
+ The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.
+
+ description : typing.Optional[str]
+ An arbitrary description of this payable.
+
+ document_id : typing.Optional[str]
+ A unique invoice number assigned by the invoice issuer for payment tracking purposes.
+
+ due_date : typing.Optional[str]
+ The date by which the payable must be paid, in the YYYY-MM-DD format. If the payable specifies payment terms with early payment discounts, this is the final payment date.
+
+ file_name : typing.Optional[str]
+ The original file name.
+
+ issued_at : typing.Optional[str]
+ The date when the payable was issued, in the YYYY-MM-DD format.
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs
+
+ payment_terms : typing.Optional[PayablePaymentTermsCreatePayload]
+ The number of days to pay with potential discount for options shorter than due_date
+
+ project_id : typing.Optional[str]
+ The ID of a project
+
+ purchase_order_id : typing.Optional[str]
+ The identifier of the purchase order to which this payable belongs.
+
+ sender : typing.Optional[str]
+ The email address from which the invoice was sent to the entity.
+
+ subtotal : typing.Optional[int]
+ The subtotal amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ suggested_payment_term : typing.Optional[SuggestedPaymentTerm]
+ The suggested date and corresponding discount in which payable could be paid. The date is in the YYYY-MM-DD format. The discount is calculated as X * (10^-4) - for example, 100 is 1%, 25 is 0,25%, 10000 is 100 %. Date varies depending on the payment terms and may even be equal to the due date with discount 0.
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this payable. Tags can be used to trigger a specific approval policy for this payable.
+
+ tax : typing.Optional[int]
+ Registered tax percentage applied for a service price in minor units, e.g. 200 means 2%. 1050 means 10.5%.
+
+ tax_amount : typing.Optional[int]
+ Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ total_amount : typing.Optional[int]
+ The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.create()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables",
+ method="POST",
+ json={
+ "base64_encoded_file": base64encoded_file,
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_bank_account_id": counterpart_bank_account_id,
+ "counterpart_id": counterpart_id,
+ "counterpart_vat_id_id": counterpart_vat_id_id,
+ "currency": currency,
+ "description": description,
+ "document_id": document_id,
+ "due_date": due_date,
+ "file_name": file_name,
+ "issued_at": issued_at,
+ "partner_metadata": partner_metadata,
+ "payment_terms": convert_and_respect_annotation_metadata(
+ object_=payment_terms, annotation=PayablePaymentTermsCreatePayload, direction="write"
+ ),
+ "project_id": project_id,
+ "purchase_order_id": purchase_order_id,
+ "sender": sender,
+ "subtotal": subtotal,
+ "suggested_payment_term": convert_and_respect_annotation_metadata(
+ object_=suggested_payment_term, annotation=SuggestedPaymentTerm, direction="write"
+ ),
+ "tag_ids": tag_ids,
+ "tax": tax,
+ "tax_amount": tax_amount,
+ "total_amount": total_amount,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_analytics(
+ self,
+ *,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ status: typing.Optional[PayableStateEnum] = None,
+ status_in: typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ total_amount: typing.Optional[int] = None,
+ total_amount_gt: typing.Optional[int] = None,
+ total_amount_lt: typing.Optional[int] = None,
+ total_amount_gte: typing.Optional[int] = None,
+ total_amount_lte: typing.Optional[int] = None,
+ amount: typing.Optional[int] = None,
+ amount_gt: typing.Optional[int] = None,
+ amount_lt: typing.Optional[int] = None,
+ amount_gte: typing.Optional[int] = None,
+ amount_lte: typing.Optional[int] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ search_text: typing.Optional[str] = None,
+ due_date: typing.Optional[str] = None,
+ due_date_gt: typing.Optional[str] = None,
+ due_date_lt: typing.Optional[str] = None,
+ due_date_gte: typing.Optional[str] = None,
+ due_date_lte: typing.Optional[str] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_contains: typing.Optional[str] = None,
+ document_id_icontains: typing.Optional[str] = None,
+ was_created_by_user_id: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ source_of_payable_data: typing.Optional[SourceOfPayableDataEnum] = None,
+ ocr_status: typing.Optional[OcrStatusEnum] = None,
+ line_item_id: typing.Optional[str] = None,
+ purchase_order_id: typing.Optional[str] = None,
+ project_id: typing.Optional[str] = None,
+ tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableAggregatedDataResponse:
+ """
+ Retrieve aggregated statistics for payables, including total amount and count, both overall and by status.
+
+ Parameters
+ ----------
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ status : typing.Optional[PayableStateEnum]
+
+ status_in : typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ total_amount : typing.Optional[int]
+
+ total_amount_gt : typing.Optional[int]
+
+ total_amount_lt : typing.Optional[int]
+
+ total_amount_gte : typing.Optional[int]
+
+ total_amount_lte : typing.Optional[int]
+
+ amount : typing.Optional[int]
+
+ amount_gt : typing.Optional[int]
+
+ amount_lt : typing.Optional[int]
+
+ amount_gte : typing.Optional[int]
+
+ amount_lte : typing.Optional[int]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ search_text : typing.Optional[str]
+
+ due_date : typing.Optional[str]
+
+ due_date_gt : typing.Optional[str]
+
+ due_date_lt : typing.Optional[str]
+
+ due_date_gte : typing.Optional[str]
+
+ due_date_lte : typing.Optional[str]
+
+ document_id : typing.Optional[str]
+
+ document_id_contains : typing.Optional[str]
+
+ document_id_icontains : typing.Optional[str]
+
+ was_created_by_user_id : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ source_of_payable_data : typing.Optional[SourceOfPayableDataEnum]
+
+ ocr_status : typing.Optional[OcrStatusEnum]
+
+ line_item_id : typing.Optional[str]
+ Search for a payable by the identifier of the line item associated with it.
+
+ purchase_order_id : typing.Optional[str]
+ Search for a payable by the identifier of the purchase order associated with it.
+
+ project_id : typing.Optional[str]
+ Search for a payable by the identifier of the project associated with it.
+
+ tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Search for a payable by the identifiers of the tags associated with it.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableAggregatedDataResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.get_analytics()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables/analytics",
+ method="GET",
+ params={
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "status": status,
+ "status__in": status_in,
+ "id__in": id_in,
+ "total_amount": total_amount,
+ "total_amount__gt": total_amount_gt,
+ "total_amount__lt": total_amount_lt,
+ "total_amount__gte": total_amount_gte,
+ "total_amount__lte": total_amount_lte,
+ "amount": amount,
+ "amount__gt": amount_gt,
+ "amount__lt": amount_lt,
+ "amount__gte": amount_gte,
+ "amount__lte": amount_lte,
+ "currency": currency,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "search_text": search_text,
+ "due_date": due_date,
+ "due_date__gt": due_date_gt,
+ "due_date__lt": due_date_lt,
+ "due_date__gte": due_date_gte,
+ "due_date__lte": due_date_lte,
+ "document_id": document_id,
+ "document_id__contains": document_id_contains,
+ "document_id__icontains": document_id_icontains,
+ "was_created_by_user_id": was_created_by_user_id,
+ "counterpart_id": counterpart_id,
+ "source_of_payable_data": source_of_payable_data,
+ "ocr_status": ocr_status,
+ "line_item_id": line_item_id,
+ "purchase_order_id": purchase_order_id,
+ "project_id": project_id,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableAggregatedDataResponse,
+ parse_obj_as(
+ type_=PayableAggregatedDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def upload_from_file(
+ self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Upload an incoming invoice (payable) in PDF, PNG, JPEG, or TIFF format and scan its contents. The maximum file size is 10MB.
+
+ Parameters
+ ----------
+ file : core.File
+ See core.File for more documentation
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.upload_from_file()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables/upload_from_file",
+ method="POST",
+ data={},
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_validations(self, *, request_options: typing.Optional[RequestOptions] = None) -> PayableValidationsResource:
+ """
+ Get payable validations.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationsResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.get_validations()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables/validations",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationsResource,
+ parse_obj_as(
+ type_=PayableValidationsResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_validations(
+ self,
+ *,
+ required_fields: typing.Sequence[PayablesFieldsAllowedForValidate],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableValidationsResource:
+ """
+ Update payable validations.
+
+ Parameters
+ ----------
+ required_fields : typing.Sequence[PayablesFieldsAllowedForValidate]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationsResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.update_validations(
+ required_fields=["currency"],
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables/validations",
+ method="PUT",
+ json={
+ "required_fields": required_fields,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationsResource,
+ parse_obj_as(
+ type_=PayableValidationsResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def reset_validations(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableValidationsResource:
+ """
+ Reset payable validations to default ones.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationsResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.reset_validations()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables/validations/reset",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationsResource,
+ parse_obj_as(
+ type_=PayableValidationsResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_variables(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableTemplatesVariablesObjectList:
+ """
+ Get a list of placeholders allowed to insert into an email template for customization
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableTemplatesVariablesObjectList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.get_variables()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payables/variables",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableTemplatesVariablesObjectList,
+ parse_obj_as(
+ type_=PayableTemplatesVariablesObjectList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Retrieves information about a specific payable with the given ID.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.get_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Deletes a specific payable.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.delete_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ payable_id: str,
+ *,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ counterpart_bank_account_id: typing.Optional[str] = OMIT,
+ counterpart_id: typing.Optional[str] = OMIT,
+ counterpart_raw_data: typing.Optional[CounterpartRawDataUpdateRequest] = OMIT,
+ counterpart_vat_id_id: typing.Optional[str] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ document_id: typing.Optional[str] = OMIT,
+ due_date: typing.Optional[str] = OMIT,
+ issued_at: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ payment_terms: typing.Optional[PayablePaymentTermsCreatePayload] = OMIT,
+ project_id: typing.Optional[str] = OMIT,
+ purchase_order_id: typing.Optional[str] = OMIT,
+ sender: typing.Optional[str] = OMIT,
+ subtotal: typing.Optional[int] = OMIT,
+ suggested_payment_term: typing.Optional[SuggestedPaymentTerm] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ tax_amount: typing.Optional[int] = OMIT,
+ total_amount: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableResponseSchema:
+ """
+ Updates the information about a specific payable.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service
+
+ counterpart_bank_account_id : typing.Optional[str]
+ The ID of counterpart bank account object stored in counterparts service
+
+ counterpart_id : typing.Optional[str]
+ The ID of the counterpart object that represents the vendor or supplier.
+
+ counterpart_raw_data : typing.Optional[CounterpartRawDataUpdateRequest]
+ Allows to fix some data in counterpart recognised fields to correct them in order to make autolinking happen.
+
+ counterpart_vat_id_id : typing.Optional[str]
+ The ID of counterpart VAT ID object stored in counterparts service
+
+ currency : typing.Optional[CurrencyEnum]
+ The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.
+
+ description : typing.Optional[str]
+ An arbitrary description of this payable.
+
+ document_id : typing.Optional[str]
+ A unique invoice number assigned by the invoice issuer for payment tracking purposes.
+
+ due_date : typing.Optional[str]
+ The date by which the payable must be paid, in the YYYY-MM-DD format. If the payable specifies payment terms with early payment discounts, this is the final payment date.
+
+ issued_at : typing.Optional[str]
+ The date when the payable was issued, in the YYYY-MM-DD format.
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs
+
+ payment_terms : typing.Optional[PayablePaymentTermsCreatePayload]
+ The number of days to pay with potential discount for options shorter than due_date
+
+ project_id : typing.Optional[str]
+ The project ID of the payable.
+
+ purchase_order_id : typing.Optional[str]
+ The identifier of the purchase order to which this payable belongs.
+
+ sender : typing.Optional[str]
+ The email address from which the invoice was sent to the entity.
+
+ subtotal : typing.Optional[int]
+ The subtotal amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ suggested_payment_term : typing.Optional[SuggestedPaymentTerm]
+ The suggested date and corresponding discount in which payable could be paid. The date is in the YYYY-MM-DD format. The discount is calculated as X * (10^-4) - for example, 100 is 1%, 25 is 0,25%, 10000 is 100 %. Date varies depending on the payment terms and may even be equal to the due date with discount 0.
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this payable. Tags can be used to trigger a specific approval policy for this payable.
+
+ tax : typing.Optional[int]
+ Registered tax percentage applied for a service price in minor units, e.g. 200 means 2%, 1050 means 10.5%.
+
+ tax_amount : typing.Optional[int]
+ Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ total_amount : typing.Optional[int]
+ The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.update_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}",
+ method="PATCH",
+ json={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_bank_account_id": counterpart_bank_account_id,
+ "counterpart_id": counterpart_id,
+ "counterpart_raw_data": convert_and_respect_annotation_metadata(
+ object_=counterpart_raw_data, annotation=CounterpartRawDataUpdateRequest, direction="write"
+ ),
+ "counterpart_vat_id_id": counterpart_vat_id_id,
+ "currency": currency,
+ "description": description,
+ "document_id": document_id,
+ "due_date": due_date,
+ "issued_at": issued_at,
+ "partner_metadata": partner_metadata,
+ "payment_terms": convert_and_respect_annotation_metadata(
+ object_=payment_terms, annotation=PayablePaymentTermsCreatePayload, direction="write"
+ ),
+ "project_id": project_id,
+ "purchase_order_id": purchase_order_id,
+ "sender": sender,
+ "subtotal": subtotal,
+ "suggested_payment_term": convert_and_respect_annotation_metadata(
+ object_=suggested_payment_term, annotation=SuggestedPaymentTerm, direction="write"
+ ),
+ "tag_ids": tag_ids,
+ "tax": tax,
+ "tax_amount": tax_amount,
+ "total_amount": total_amount,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def approve_payment_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Confirms that the payable is ready to be paid.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.approve_payment_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/approve_payment_operation",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def attach_file_by_id(
+ self, payable_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Attach file to payable without existing attachment.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ file : core.File
+ See core.File for more documentation
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.attach_file_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/attach_file",
+ method="POST",
+ data={},
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def cancel_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Cancels the payable that was not confirmed during the review.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.cancel_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def mark_as_paid_by_id(
+ self,
+ payable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableResponseSchema:
+ """
+ Mark a payable as paid.
+
+ Payables can be paid using the payment channels offered by Monite or through external payment channels. In the latter
+ case, the invoice is not automatically marked as paid in the system and needs to be converted to the paid status
+ manually.
+
+ Optionally, it is possible to pass the `comment` field in the request body, to describe how and when the invoice was
+ paid.
+
+ Notes:
+
+ - To use this endpoint with an entity user token, this entity user must have a role that includes the `pay` permission
+ for payables.
+ - The `amount_to_pay` field is automatically calculated based on the `amount_due` less the percentage described
+ in the `payment_terms.discount` value.
+
+ Related guide: [Mark a payable as paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-paid)
+
+ See also:
+
+ [Payables lifecycle](https://docs.monite.com/docs/payables-lifecycle)
+
+ [Payables status transitions](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ comment : typing.Optional[str]
+ An arbitrary comment that describes how and when this payable was paid.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.mark_as_paid_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/mark_as_paid",
+ method="POST",
+ json={
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def mark_as_partially_paid_by_id(
+ self, payable_id: str, *, amount_paid: int, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Mark a payable as partially paid.
+
+ If the payable is partially paid, its status is moved to `partially_paid`. The value of the `amount_paid` field must be
+ the sum of all payments made, not only the last one.
+
+ Notes:
+
+ - This endpoint can be used for payables in the `waiting_to_be_paid` status.
+ - The `amount_paid` must be greater than 0 and less than the total payable amount specified by the `amount` field.
+ - You can use this endpoint multiple times for the same payable to reflect multiple partial payments, always setting the
+ sum of all payments made.
+ - To use this endpoint with an entity user token, this entity user must have a role that includes the `pay`
+ permission for payables.
+ - The `amount_to_pay` field is automatically calculated based on the `amount_due` less the percentage described
+ in the `payment_terms.discount` value.
+
+ Related guide: [Mark a payable as partially paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-partially-paid)
+
+ See also:
+
+ [Payables lifecycle](https://docs.monite.com/docs/payables-lifecycle)
+
+ [Payables status transitions](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+ [Mark a payable as paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-paid)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ amount_paid : int
+ How much was paid on the invoice (in minor units).
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.mark_as_partially_paid_by_id(
+ payable_id="payable_id",
+ amount_paid=1,
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/mark_as_partially_paid",
+ method="POST",
+ json={
+ "amount_paid": amount_paid,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def reject_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Declines the payable when an approver finds any mismatch or discrepancies.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.reject_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/reject",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def reopen_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Reset payable state from rejected to new.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.reopen_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/reopen",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def submit_for_approval_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Starts the approval process once the uploaded payable is validated.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.submit_for_approval_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/submit_for_approval",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def validate_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableValidationResponse:
+ """
+ Check the invoice for compliance with the requirements for movement from draft to new status.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.validate_by_id(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/validate",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationResponse,
+ parse_obj_as(
+ type_=PayableValidationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPayablesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+ self.line_items = AsyncLineItemsClient(client_wrapper=self._client_wrapper)
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PayableCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ status: typing.Optional[PayableStateEnum] = None,
+ status_in: typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ total_amount: typing.Optional[int] = None,
+ total_amount_gt: typing.Optional[int] = None,
+ total_amount_lt: typing.Optional[int] = None,
+ total_amount_gte: typing.Optional[int] = None,
+ total_amount_lte: typing.Optional[int] = None,
+ amount: typing.Optional[int] = None,
+ amount_gt: typing.Optional[int] = None,
+ amount_lt: typing.Optional[int] = None,
+ amount_gte: typing.Optional[int] = None,
+ amount_lte: typing.Optional[int] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ search_text: typing.Optional[str] = None,
+ due_date: typing.Optional[str] = None,
+ due_date_gt: typing.Optional[str] = None,
+ due_date_lt: typing.Optional[str] = None,
+ due_date_gte: typing.Optional[str] = None,
+ due_date_lte: typing.Optional[str] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_contains: typing.Optional[str] = None,
+ document_id_icontains: typing.Optional[str] = None,
+ was_created_by_user_id: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ source_of_payable_data: typing.Optional[SourceOfPayableDataEnum] = None,
+ ocr_status: typing.Optional[OcrStatusEnum] = None,
+ line_item_id: typing.Optional[str] = None,
+ purchase_order_id: typing.Optional[str] = None,
+ project_id: typing.Optional[str] = None,
+ tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayablePaginationResponse:
+ """
+ Lists all payables from the connected entity.
+
+ If you already have the data of the payable (amount in [minor units](https://docs.monite.com/docs/currencies#minor-units), currency, vendor information, and other details)
+ stored somewhere as individual attributes, you can create a payable with these attributes by calling [POST
+ /payables](https://docs.monite.com/reference/post_payables) and providing the [base64-encoded](https://en.wikipedia.org/wiki/Base64) contents of the original invoice file in the field `base64_encoded_file`.
+
+ A payable is a financial document given by an entity`s supplier itemizing the purchase of a good or a service and
+ demanding payment.
+
+ The `file_name` field is optional. If omitted, it defaults to “default_file_name”. If the settings are configured
+ to automatically set `suggested_payment_term`, this object can be omitted from the request body.
+
+ The `id` generated for this payable can be used in other API calls to update the data of this payable or trigger [
+ status transitions](https://docs.monite.com/docs/payable-status-transitions), for example. essential data
+ fields to move from `draft` to `new`
+
+ Related guide: [Create a payable from data](https://docs.monite.com/docs/collect-payables#create-a-payable-from-data)
+
+ See also:
+
+ [Automatic calculation of due date](https://docs.monite.com/docs/collect-payables#automatic-calculation-of-due-date)
+
+ [Suggested payment date](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+ [Attach file](https://docs.monite.com/docs/collect-payables#attach-file)
+
+ [Collect payables by email](https://docs.monite.com/docs/collect-payables#send-payables-by-email)
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PayableCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ status : typing.Optional[PayableStateEnum]
+
+ status_in : typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ total_amount : typing.Optional[int]
+
+ total_amount_gt : typing.Optional[int]
+
+ total_amount_lt : typing.Optional[int]
+
+ total_amount_gte : typing.Optional[int]
+
+ total_amount_lte : typing.Optional[int]
+
+ amount : typing.Optional[int]
+
+ amount_gt : typing.Optional[int]
+
+ amount_lt : typing.Optional[int]
+
+ amount_gte : typing.Optional[int]
+
+ amount_lte : typing.Optional[int]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ search_text : typing.Optional[str]
+
+ due_date : typing.Optional[str]
+
+ due_date_gt : typing.Optional[str]
+
+ due_date_lt : typing.Optional[str]
+
+ due_date_gte : typing.Optional[str]
+
+ due_date_lte : typing.Optional[str]
+
+ document_id : typing.Optional[str]
+
+ document_id_contains : typing.Optional[str]
+
+ document_id_icontains : typing.Optional[str]
+
+ was_created_by_user_id : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ source_of_payable_data : typing.Optional[SourceOfPayableDataEnum]
+
+ ocr_status : typing.Optional[OcrStatusEnum]
+
+ line_item_id : typing.Optional[str]
+ Search for a payable by the identifier of the line item associated with it.
+
+ purchase_order_id : typing.Optional[str]
+ Search for a payable by the identifier of the purchase order associated with it.
+
+ project_id : typing.Optional[str]
+ Search for a payable by the identifier of the project associated with it.
+
+ tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Search for a payable by the identifiers of the tags associated with it.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayablePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "status": status,
+ "status__in": status_in,
+ "id__in": id_in,
+ "total_amount": total_amount,
+ "total_amount__gt": total_amount_gt,
+ "total_amount__lt": total_amount_lt,
+ "total_amount__gte": total_amount_gte,
+ "total_amount__lte": total_amount_lte,
+ "amount": amount,
+ "amount__gt": amount_gt,
+ "amount__lt": amount_lt,
+ "amount__gte": amount_gte,
+ "amount__lte": amount_lte,
+ "currency": currency,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "search_text": search_text,
+ "due_date": due_date,
+ "due_date__gt": due_date_gt,
+ "due_date__lt": due_date_lt,
+ "due_date__gte": due_date_gte,
+ "due_date__lte": due_date_lte,
+ "document_id": document_id,
+ "document_id__contains": document_id_contains,
+ "document_id__icontains": document_id_icontains,
+ "was_created_by_user_id": was_created_by_user_id,
+ "counterpart_id": counterpart_id,
+ "source_of_payable_data": source_of_payable_data,
+ "ocr_status": ocr_status,
+ "line_item_id": line_item_id,
+ "purchase_order_id": purchase_order_id,
+ "project_id": project_id,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayablePaginationResponse,
+ parse_obj_as(
+ type_=PayablePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ base64encoded_file: typing.Optional[str] = OMIT,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ counterpart_bank_account_id: typing.Optional[str] = OMIT,
+ counterpart_id: typing.Optional[str] = OMIT,
+ counterpart_vat_id_id: typing.Optional[str] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ document_id: typing.Optional[str] = OMIT,
+ due_date: typing.Optional[str] = OMIT,
+ file_name: typing.Optional[str] = OMIT,
+ issued_at: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ payment_terms: typing.Optional[PayablePaymentTermsCreatePayload] = OMIT,
+ project_id: typing.Optional[str] = OMIT,
+ purchase_order_id: typing.Optional[str] = OMIT,
+ sender: typing.Optional[str] = OMIT,
+ subtotal: typing.Optional[int] = OMIT,
+ suggested_payment_term: typing.Optional[SuggestedPaymentTerm] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ tax_amount: typing.Optional[int] = OMIT,
+ total_amount: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableResponseSchema:
+ """
+ Add a new payable by providing the amount, currency, vendor name, and other details.
+ You can provide the base64_encoded contents of the original invoice file in the field `base64_encoded_file`.
+
+ You can use this endpoint to bypass the Monite OCR service and provide the data directly
+ (for example, if you already have the data in place).
+
+ A newly created payable has the the `draft` [status](https://docs.monite.com/docs/payables-lifecycle).
+
+ Parameters
+ ----------
+ base64encoded_file : typing.Optional[str]
+ Base64-encoded contents of the original issued payable. The file is provided for reference purposes as the original source of the data.
+
+ Any file formats are allowed. The most common formats are PDF, PNG, JPEG, TIFF.
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service
+
+ counterpart_bank_account_id : typing.Optional[str]
+ The ID of counterpart bank account object stored in counterparts service
+
+ counterpart_id : typing.Optional[str]
+ The ID of the counterpart object that represents the vendor or supplier.
+
+ counterpart_vat_id_id : typing.Optional[str]
+ The ID of counterpart VAT ID object stored in counterparts service
+
+ currency : typing.Optional[CurrencyEnum]
+ The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.
+
+ description : typing.Optional[str]
+ An arbitrary description of this payable.
+
+ document_id : typing.Optional[str]
+ A unique invoice number assigned by the invoice issuer for payment tracking purposes.
+
+ due_date : typing.Optional[str]
+ The date by which the payable must be paid, in the YYYY-MM-DD format. If the payable specifies payment terms with early payment discounts, this is the final payment date.
+
+ file_name : typing.Optional[str]
+ The original file name.
+
+ issued_at : typing.Optional[str]
+ The date when the payable was issued, in the YYYY-MM-DD format.
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs
+
+ payment_terms : typing.Optional[PayablePaymentTermsCreatePayload]
+ The number of days to pay with potential discount for options shorter than due_date
+
+ project_id : typing.Optional[str]
+ The ID of a project
+
+ purchase_order_id : typing.Optional[str]
+ The identifier of the purchase order to which this payable belongs.
+
+ sender : typing.Optional[str]
+ The email address from which the invoice was sent to the entity.
+
+ subtotal : typing.Optional[int]
+ The subtotal amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ suggested_payment_term : typing.Optional[SuggestedPaymentTerm]
+ The suggested date and corresponding discount in which payable could be paid. The date is in the YYYY-MM-DD format. The discount is calculated as X * (10^-4) - for example, 100 is 1%, 25 is 0,25%, 10000 is 100 %. Date varies depending on the payment terms and may even be equal to the due date with discount 0.
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this payable. Tags can be used to trigger a specific approval policy for this payable.
+
+ tax : typing.Optional[int]
+ Registered tax percentage applied for a service price in minor units, e.g. 200 means 2%. 1050 means 10.5%.
+
+ tax_amount : typing.Optional[int]
+ Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ total_amount : typing.Optional[int]
+ The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.create()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables",
+ method="POST",
+ json={
+ "base64_encoded_file": base64encoded_file,
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_bank_account_id": counterpart_bank_account_id,
+ "counterpart_id": counterpart_id,
+ "counterpart_vat_id_id": counterpart_vat_id_id,
+ "currency": currency,
+ "description": description,
+ "document_id": document_id,
+ "due_date": due_date,
+ "file_name": file_name,
+ "issued_at": issued_at,
+ "partner_metadata": partner_metadata,
+ "payment_terms": convert_and_respect_annotation_metadata(
+ object_=payment_terms, annotation=PayablePaymentTermsCreatePayload, direction="write"
+ ),
+ "project_id": project_id,
+ "purchase_order_id": purchase_order_id,
+ "sender": sender,
+ "subtotal": subtotal,
+ "suggested_payment_term": convert_and_respect_annotation_metadata(
+ object_=suggested_payment_term, annotation=SuggestedPaymentTerm, direction="write"
+ ),
+ "tag_ids": tag_ids,
+ "tax": tax,
+ "tax_amount": tax_amount,
+ "total_amount": total_amount,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_analytics(
+ self,
+ *,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ status: typing.Optional[PayableStateEnum] = None,
+ status_in: typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ total_amount: typing.Optional[int] = None,
+ total_amount_gt: typing.Optional[int] = None,
+ total_amount_lt: typing.Optional[int] = None,
+ total_amount_gte: typing.Optional[int] = None,
+ total_amount_lte: typing.Optional[int] = None,
+ amount: typing.Optional[int] = None,
+ amount_gt: typing.Optional[int] = None,
+ amount_lt: typing.Optional[int] = None,
+ amount_gte: typing.Optional[int] = None,
+ amount_lte: typing.Optional[int] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ search_text: typing.Optional[str] = None,
+ due_date: typing.Optional[str] = None,
+ due_date_gt: typing.Optional[str] = None,
+ due_date_lt: typing.Optional[str] = None,
+ due_date_gte: typing.Optional[str] = None,
+ due_date_lte: typing.Optional[str] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_contains: typing.Optional[str] = None,
+ document_id_icontains: typing.Optional[str] = None,
+ was_created_by_user_id: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ source_of_payable_data: typing.Optional[SourceOfPayableDataEnum] = None,
+ ocr_status: typing.Optional[OcrStatusEnum] = None,
+ line_item_id: typing.Optional[str] = None,
+ purchase_order_id: typing.Optional[str] = None,
+ project_id: typing.Optional[str] = None,
+ tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableAggregatedDataResponse:
+ """
+ Retrieve aggregated statistics for payables, including total amount and count, both overall and by status.
+
+ Parameters
+ ----------
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ status : typing.Optional[PayableStateEnum]
+
+ status_in : typing.Optional[typing.Union[PayableStateEnum, typing.Sequence[PayableStateEnum]]]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ total_amount : typing.Optional[int]
+
+ total_amount_gt : typing.Optional[int]
+
+ total_amount_lt : typing.Optional[int]
+
+ total_amount_gte : typing.Optional[int]
+
+ total_amount_lte : typing.Optional[int]
+
+ amount : typing.Optional[int]
+
+ amount_gt : typing.Optional[int]
+
+ amount_lt : typing.Optional[int]
+
+ amount_gte : typing.Optional[int]
+
+ amount_lte : typing.Optional[int]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ search_text : typing.Optional[str]
+
+ due_date : typing.Optional[str]
+
+ due_date_gt : typing.Optional[str]
+
+ due_date_lt : typing.Optional[str]
+
+ due_date_gte : typing.Optional[str]
+
+ due_date_lte : typing.Optional[str]
+
+ document_id : typing.Optional[str]
+
+ document_id_contains : typing.Optional[str]
+
+ document_id_icontains : typing.Optional[str]
+
+ was_created_by_user_id : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ source_of_payable_data : typing.Optional[SourceOfPayableDataEnum]
+
+ ocr_status : typing.Optional[OcrStatusEnum]
+
+ line_item_id : typing.Optional[str]
+ Search for a payable by the identifier of the line item associated with it.
+
+ purchase_order_id : typing.Optional[str]
+ Search for a payable by the identifier of the purchase order associated with it.
+
+ project_id : typing.Optional[str]
+ Search for a payable by the identifier of the project associated with it.
+
+ tag_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Search for a payable by the identifiers of the tags associated with it.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableAggregatedDataResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.get_analytics()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables/analytics",
+ method="GET",
+ params={
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "status": status,
+ "status__in": status_in,
+ "id__in": id_in,
+ "total_amount": total_amount,
+ "total_amount__gt": total_amount_gt,
+ "total_amount__lt": total_amount_lt,
+ "total_amount__gte": total_amount_gte,
+ "total_amount__lte": total_amount_lte,
+ "amount": amount,
+ "amount__gt": amount_gt,
+ "amount__lt": amount_lt,
+ "amount__gte": amount_gte,
+ "amount__lte": amount_lte,
+ "currency": currency,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "search_text": search_text,
+ "due_date": due_date,
+ "due_date__gt": due_date_gt,
+ "due_date__lt": due_date_lt,
+ "due_date__gte": due_date_gte,
+ "due_date__lte": due_date_lte,
+ "document_id": document_id,
+ "document_id__contains": document_id_contains,
+ "document_id__icontains": document_id_icontains,
+ "was_created_by_user_id": was_created_by_user_id,
+ "counterpart_id": counterpart_id,
+ "source_of_payable_data": source_of_payable_data,
+ "ocr_status": ocr_status,
+ "line_item_id": line_item_id,
+ "purchase_order_id": purchase_order_id,
+ "project_id": project_id,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableAggregatedDataResponse,
+ parse_obj_as(
+ type_=PayableAggregatedDataResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def upload_from_file(
+ self, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Upload an incoming invoice (payable) in PDF, PNG, JPEG, or TIFF format and scan its contents. The maximum file size is 10MB.
+
+ Parameters
+ ----------
+ file : core.File
+ See core.File for more documentation
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.upload_from_file()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables/upload_from_file",
+ method="POST",
+ data={},
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_validations(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableValidationsResource:
+ """
+ Get payable validations.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationsResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.get_validations()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables/validations",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationsResource,
+ parse_obj_as(
+ type_=PayableValidationsResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_validations(
+ self,
+ *,
+ required_fields: typing.Sequence[PayablesFieldsAllowedForValidate],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableValidationsResource:
+ """
+ Update payable validations.
+
+ Parameters
+ ----------
+ required_fields : typing.Sequence[PayablesFieldsAllowedForValidate]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationsResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.update_validations(
+ required_fields=["currency"],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables/validations",
+ method="PUT",
+ json={
+ "required_fields": required_fields,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationsResource,
+ parse_obj_as(
+ type_=PayableValidationsResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def reset_validations(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableValidationsResource:
+ """
+ Reset payable validations to default ones.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationsResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.reset_validations()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables/validations/reset",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationsResource,
+ parse_obj_as(
+ type_=PayableValidationsResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_variables(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableTemplatesVariablesObjectList:
+ """
+ Get a list of placeholders allowed to insert into an email template for customization
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableTemplatesVariablesObjectList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.get_variables()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payables/variables",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableTemplatesVariablesObjectList,
+ parse_obj_as(
+ type_=PayableTemplatesVariablesObjectList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Retrieves information about a specific payable with the given ID.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.get_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Deletes a specific payable.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.delete_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ payable_id: str,
+ *,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ counterpart_bank_account_id: typing.Optional[str] = OMIT,
+ counterpart_id: typing.Optional[str] = OMIT,
+ counterpart_raw_data: typing.Optional[CounterpartRawDataUpdateRequest] = OMIT,
+ counterpart_vat_id_id: typing.Optional[str] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ document_id: typing.Optional[str] = OMIT,
+ due_date: typing.Optional[str] = OMIT,
+ issued_at: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ payment_terms: typing.Optional[PayablePaymentTermsCreatePayload] = OMIT,
+ project_id: typing.Optional[str] = OMIT,
+ purchase_order_id: typing.Optional[str] = OMIT,
+ sender: typing.Optional[str] = OMIT,
+ subtotal: typing.Optional[int] = OMIT,
+ suggested_payment_term: typing.Optional[SuggestedPaymentTerm] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ tax_amount: typing.Optional[int] = OMIT,
+ total_amount: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableResponseSchema:
+ """
+ Updates the information about a specific payable.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service
+
+ counterpart_bank_account_id : typing.Optional[str]
+ The ID of counterpart bank account object stored in counterparts service
+
+ counterpart_id : typing.Optional[str]
+ The ID of the counterpart object that represents the vendor or supplier.
+
+ counterpart_raw_data : typing.Optional[CounterpartRawDataUpdateRequest]
+ Allows to fix some data in counterpart recognised fields to correct them in order to make autolinking happen.
+
+ counterpart_vat_id_id : typing.Optional[str]
+ The ID of counterpart VAT ID object stored in counterparts service
+
+ currency : typing.Optional[CurrencyEnum]
+ The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.
+
+ description : typing.Optional[str]
+ An arbitrary description of this payable.
+
+ document_id : typing.Optional[str]
+ A unique invoice number assigned by the invoice issuer for payment tracking purposes.
+
+ due_date : typing.Optional[str]
+ The date by which the payable must be paid, in the YYYY-MM-DD format. If the payable specifies payment terms with early payment discounts, this is the final payment date.
+
+ issued_at : typing.Optional[str]
+ The date when the payable was issued, in the YYYY-MM-DD format.
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Metadata for partner needs
+
+ payment_terms : typing.Optional[PayablePaymentTermsCreatePayload]
+ The number of days to pay with potential discount for options shorter than due_date
+
+ project_id : typing.Optional[str]
+ The project ID of the payable.
+
+ purchase_order_id : typing.Optional[str]
+ The identifier of the purchase order to which this payable belongs.
+
+ sender : typing.Optional[str]
+ The email address from which the invoice was sent to the entity.
+
+ subtotal : typing.Optional[int]
+ The subtotal amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ suggested_payment_term : typing.Optional[SuggestedPaymentTerm]
+ The suggested date and corresponding discount in which payable could be paid. The date is in the YYYY-MM-DD format. The discount is calculated as X * (10^-4) - for example, 100 is 1%, 25 is 0,25%, 10000 is 100 %. Date varies depending on the payment terms and may even be equal to the due date with discount 0.
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this payable. Tags can be used to trigger a specific approval policy for this payable.
+
+ tax : typing.Optional[int]
+ Registered tax percentage applied for a service price in minor units, e.g. 200 means 2%, 1050 means 10.5%.
+
+ tax_amount : typing.Optional[int]
+ Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ total_amount : typing.Optional[int]
+ The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.update_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}",
+ method="PATCH",
+ json={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_bank_account_id": counterpart_bank_account_id,
+ "counterpart_id": counterpart_id,
+ "counterpart_raw_data": convert_and_respect_annotation_metadata(
+ object_=counterpart_raw_data, annotation=CounterpartRawDataUpdateRequest, direction="write"
+ ),
+ "counterpart_vat_id_id": counterpart_vat_id_id,
+ "currency": currency,
+ "description": description,
+ "document_id": document_id,
+ "due_date": due_date,
+ "issued_at": issued_at,
+ "partner_metadata": partner_metadata,
+ "payment_terms": convert_and_respect_annotation_metadata(
+ object_=payment_terms, annotation=PayablePaymentTermsCreatePayload, direction="write"
+ ),
+ "project_id": project_id,
+ "purchase_order_id": purchase_order_id,
+ "sender": sender,
+ "subtotal": subtotal,
+ "suggested_payment_term": convert_and_respect_annotation_metadata(
+ object_=suggested_payment_term, annotation=SuggestedPaymentTerm, direction="write"
+ ),
+ "tag_ids": tag_ids,
+ "tax": tax,
+ "tax_amount": tax_amount,
+ "total_amount": total_amount,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def approve_payment_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Confirms that the payable is ready to be paid.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.approve_payment_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/approve_payment_operation",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def attach_file_by_id(
+ self, payable_id: str, *, file: core.File, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Attach file to payable without existing attachment.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ file : core.File
+ See core.File for more documentation
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.attach_file_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/attach_file",
+ method="POST",
+ data={},
+ files={
+ "file": file,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def cancel_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Cancels the payable that was not confirmed during the review.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.cancel_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def mark_as_paid_by_id(
+ self,
+ payable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PayableResponseSchema:
+ """
+ Mark a payable as paid.
+
+ Payables can be paid using the payment channels offered by Monite or through external payment channels. In the latter
+ case, the invoice is not automatically marked as paid in the system and needs to be converted to the paid status
+ manually.
+
+ Optionally, it is possible to pass the `comment` field in the request body, to describe how and when the invoice was
+ paid.
+
+ Notes:
+
+ - To use this endpoint with an entity user token, this entity user must have a role that includes the `pay` permission
+ for payables.
+ - The `amount_to_pay` field is automatically calculated based on the `amount_due` less the percentage described
+ in the `payment_terms.discount` value.
+
+ Related guide: [Mark a payable as paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-paid)
+
+ See also:
+
+ [Payables lifecycle](https://docs.monite.com/docs/payables-lifecycle)
+
+ [Payables status transitions](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ comment : typing.Optional[str]
+ An arbitrary comment that describes how and when this payable was paid.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.mark_as_paid_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/mark_as_paid",
+ method="POST",
+ json={
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def mark_as_partially_paid_by_id(
+ self, payable_id: str, *, amount_paid: int, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Mark a payable as partially paid.
+
+ If the payable is partially paid, its status is moved to `partially_paid`. The value of the `amount_paid` field must be
+ the sum of all payments made, not only the last one.
+
+ Notes:
+
+ - This endpoint can be used for payables in the `waiting_to_be_paid` status.
+ - The `amount_paid` must be greater than 0 and less than the total payable amount specified by the `amount` field.
+ - You can use this endpoint multiple times for the same payable to reflect multiple partial payments, always setting the
+ sum of all payments made.
+ - To use this endpoint with an entity user token, this entity user must have a role that includes the `pay`
+ permission for payables.
+ - The `amount_to_pay` field is automatically calculated based on the `amount_due` less the percentage described
+ in the `payment_terms.discount` value.
+
+ Related guide: [Mark a payable as partially paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-partially-paid)
+
+ See also:
+
+ [Payables lifecycle](https://docs.monite.com/docs/payables-lifecycle)
+
+ [Payables status transitions](https://docs.monite.com/docs/collect-payables#suggested-payment-date)
+
+ [Mark a payable as paid](https://docs.monite.com/docs/payable-status-transitions#mark-as-paid)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ amount_paid : int
+ How much was paid on the invoice (in minor units).
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.mark_as_partially_paid_by_id(
+ payable_id="payable_id",
+ amount_paid=1,
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/mark_as_partially_paid",
+ method="POST",
+ json={
+ "amount_paid": amount_paid,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def reject_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Declines the payable when an approver finds any mismatch or discrepancies.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.reject_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/reject",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def reopen_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Reset payable state from rejected to new.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.reopen_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/reopen",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def submit_for_approval_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableResponseSchema:
+ """
+ Starts the approval process once the uploaded payable is validated.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.submit_for_approval_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/submit_for_approval",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableResponseSchema,
+ parse_obj_as(
+ type_=PayableResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def validate_by_id(
+ self, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PayableValidationResponse:
+ """
+ Check the invoice for compliance with the requirements for movement from draft to new status.
+
+ Parameters
+ ----------
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PayableValidationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.validate_by_id(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/validate",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PayableValidationResponse,
+ parse_obj_as(
+ type_=PayableValidationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/payables/line_items/__init__.py b/src/monite/payables/line_items/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/payables/line_items/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/payables/line_items/client.py b/src/monite/payables/line_items/client.py
new file mode 100644
index 0000000..b3beca8
--- /dev/null
+++ b/src/monite/payables/line_items/client.py
@@ -0,0 +1,1884 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ...core.client_wrapper import SyncClientWrapper
+from ...types.order_enum import OrderEnum
+from ...types.line_item_cursor_fields import LineItemCursorFields
+from ...core.request_options import RequestOptions
+from ...types.line_item_pagination_response import LineItemPaginationResponse
+from ...core.jsonable_encoder import jsonable_encoder
+from ...core.pydantic_utilities import parse_obj_as
+from ...errors.bad_request_error import BadRequestError
+from ...types.error_schema_response import ErrorSchemaResponse
+from ...errors.unauthorized_error import UnauthorizedError
+from ...errors.forbidden_error import ForbiddenError
+from ...errors.not_acceptable_error import NotAcceptableError
+from ...errors.unprocessable_entity_error import UnprocessableEntityError
+from ...types.http_validation_error import HttpValidationError
+from ...errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ...core.api_error import ApiError
+from ...types.line_item_response import LineItemResponse
+from ...errors.not_found_error import NotFoundError
+from ...types.line_item_internal_request import LineItemInternalRequest
+from ...types.line_items_replace_response import LineItemsReplaceResponse
+from ...core.serialization import convert_and_respect_annotation_metadata
+from ...errors.conflict_error import ConflictError
+from ...core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class LineItemsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ payable_id: str,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[LineItemCursorFields] = None,
+ was_created_by_user_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemPaginationResponse:
+ """
+ Get a list of all line items related to a specific payable.
+ Related guide: [List all payable line items](https://docs.monite.com/docs/manage-line-items#list-all-line-items-of-a-payable)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[LineItemCursorFields]
+ Allowed sort fields
+
+ was_created_by_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.line_items.get(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "was_created_by_user_id": was_created_by_user_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemPaginationResponse,
+ parse_obj_as(
+ type_=LineItemPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ payable_id: str,
+ *,
+ accounting_tax_rate_id: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ quantity: typing.Optional[float] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ unit: typing.Optional[str] = OMIT,
+ unit_price: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemResponse:
+ """
+ Add a new line item to a specific payable.
+
+ The `subtotal` and `total` fields of line items are automatically calculated based on the `unit_price`,
+ `quantity`, and `tax` fields, therefore, are read-only and appear only in the response schema. The field
+ `ledger_account_id` is required **only** for account integration, otherwise, it is optional.
+
+ Related guide: [Add line items to a payable](https://docs.monite.com/docs/manage-line-items#add-line-items-to-a-payable)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ accounting_tax_rate_id : typing.Optional[str]
+ ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+ ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+
+ name : typing.Optional[str]
+ Name of the product.
+
+ quantity : typing.Optional[float]
+ The quantity of each of the goods, materials, or services listed in the payable.
+
+ tax : typing.Optional[int]
+ VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+
+ unit : typing.Optional[str]
+ The unit of the product
+
+ unit_price : typing.Optional[int]
+ The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.line_items.create(
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items",
+ method="POST",
+ json={
+ "accounting_tax_rate_id": accounting_tax_rate_id,
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "name": name,
+ "quantity": quantity,
+ "tax": tax,
+ "unit": unit,
+ "unit_price": unit_price,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemResponse,
+ parse_obj_as(
+ type_=LineItemResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def replace(
+ self,
+ payable_id: str,
+ *,
+ data: typing.Sequence[LineItemInternalRequest],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemsReplaceResponse:
+ """
+ Replaces the information of all line items of a specific payable.
+
+ Related guide: [Replace all line items](https://docs.monite.com/docs/manage-line-items#replace-all-line-items)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ data : typing.Sequence[LineItemInternalRequest]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemsReplaceResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import LineItemInternalRequest, Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.line_items.replace(
+ payable_id="payable_id",
+ data=[LineItemInternalRequest()],
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items",
+ method="PUT",
+ json={
+ "data": convert_and_respect_annotation_metadata(
+ object_=data, annotation=typing.Sequence[LineItemInternalRequest], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemsReplaceResponse,
+ parse_obj_as(
+ type_=LineItemsReplaceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, line_item_id: str, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> LineItemResponse:
+ """
+ Get information about a specific line item with a given ID.
+
+ Related guide: [Retrieve a line item](https://docs.monite.com/docs/manage-line-items#retrieve-a-line-item)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ line_item_id : str
+
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.line_items.get_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items/{jsonable_encoder(line_item_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemResponse,
+ parse_obj_as(
+ type_=LineItemResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, line_item_id: str, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Delete the line item with the given ID.
+
+ Related guide: [Remove a line item](https://docs.monite.com/docs/manage-line-items#remove-a-line-item)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ line_item_id : str
+
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.line_items.delete_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items/{jsonable_encoder(line_item_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ line_item_id: str,
+ payable_id: str,
+ *,
+ accounting_tax_rate_id: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ quantity: typing.Optional[float] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ unit: typing.Optional[str] = OMIT,
+ unit_price: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemResponse:
+ """
+ Edits the information of a specific line item.
+
+ Related guide: [Update a line item](https://docs.monite.com/docs/manage-line-items#update-a-line-item)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ line_item_id : str
+
+ payable_id : str
+
+ accounting_tax_rate_id : typing.Optional[str]
+ ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+ ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+
+ name : typing.Optional[str]
+ Name of the product.
+
+ quantity : typing.Optional[float]
+ The quantity of each of the goods, materials, or services listed in the payable.
+
+ tax : typing.Optional[int]
+ VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+
+ unit : typing.Optional[str]
+ The unit of the product
+
+ unit_price : typing.Optional[int]
+ The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payables.line_items.update_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items/{jsonable_encoder(line_item_id)}",
+ method="PATCH",
+ json={
+ "accounting_tax_rate_id": accounting_tax_rate_id,
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "name": name,
+ "quantity": quantity,
+ "tax": tax,
+ "unit": unit,
+ "unit_price": unit_price,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemResponse,
+ parse_obj_as(
+ type_=LineItemResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncLineItemsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ payable_id: str,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[LineItemCursorFields] = None,
+ was_created_by_user_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemPaginationResponse:
+ """
+ Get a list of all line items related to a specific payable.
+ Related guide: [List all payable line items](https://docs.monite.com/docs/manage-line-items#list-all-line-items-of-a-payable)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[LineItemCursorFields]
+ Allowed sort fields
+
+ was_created_by_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.line_items.get(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "was_created_by_user_id": was_created_by_user_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemPaginationResponse,
+ parse_obj_as(
+ type_=LineItemPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ payable_id: str,
+ *,
+ accounting_tax_rate_id: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ quantity: typing.Optional[float] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ unit: typing.Optional[str] = OMIT,
+ unit_price: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemResponse:
+ """
+ Add a new line item to a specific payable.
+
+ The `subtotal` and `total` fields of line items are automatically calculated based on the `unit_price`,
+ `quantity`, and `tax` fields, therefore, are read-only and appear only in the response schema. The field
+ `ledger_account_id` is required **only** for account integration, otherwise, it is optional.
+
+ Related guide: [Add line items to a payable](https://docs.monite.com/docs/manage-line-items#add-line-items-to-a-payable)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ accounting_tax_rate_id : typing.Optional[str]
+ ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+ ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+
+ name : typing.Optional[str]
+ Name of the product.
+
+ quantity : typing.Optional[float]
+ The quantity of each of the goods, materials, or services listed in the payable.
+
+ tax : typing.Optional[int]
+ VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+
+ unit : typing.Optional[str]
+ The unit of the product
+
+ unit_price : typing.Optional[int]
+ The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.line_items.create(
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items",
+ method="POST",
+ json={
+ "accounting_tax_rate_id": accounting_tax_rate_id,
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "name": name,
+ "quantity": quantity,
+ "tax": tax,
+ "unit": unit,
+ "unit_price": unit_price,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemResponse,
+ parse_obj_as(
+ type_=LineItemResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def replace(
+ self,
+ payable_id: str,
+ *,
+ data: typing.Sequence[LineItemInternalRequest],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemsReplaceResponse:
+ """
+ Replaces the information of all line items of a specific payable.
+
+ Related guide: [Replace all line items](https://docs.monite.com/docs/manage-line-items#replace-all-line-items)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ payable_id : str
+
+ data : typing.Sequence[LineItemInternalRequest]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemsReplaceResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, LineItemInternalRequest
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.line_items.replace(
+ payable_id="payable_id",
+ data=[LineItemInternalRequest()],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items",
+ method="PUT",
+ json={
+ "data": convert_and_respect_annotation_metadata(
+ object_=data, annotation=typing.Sequence[LineItemInternalRequest], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemsReplaceResponse,
+ parse_obj_as(
+ type_=LineItemsReplaceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, line_item_id: str, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> LineItemResponse:
+ """
+ Get information about a specific line item with a given ID.
+
+ Related guide: [Retrieve a line item](https://docs.monite.com/docs/manage-line-items#retrieve-a-line-item)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ line_item_id : str
+
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.line_items.get_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items/{jsonable_encoder(line_item_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemResponse,
+ parse_obj_as(
+ type_=LineItemResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, line_item_id: str, payable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Delete the line item with the given ID.
+
+ Related guide: [Remove a line item](https://docs.monite.com/docs/manage-line-items#remove-a-line-item)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ line_item_id : str
+
+ payable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.line_items.delete_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items/{jsonable_encoder(line_item_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ line_item_id: str,
+ payable_id: str,
+ *,
+ accounting_tax_rate_id: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ quantity: typing.Optional[float] = OMIT,
+ tax: typing.Optional[int] = OMIT,
+ unit: typing.Optional[str] = OMIT,
+ unit_price: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemResponse:
+ """
+ Edits the information of a specific line item.
+
+ Related guide: [Update a line item](https://docs.monite.com/docs/manage-line-items#update-a-line-item)
+
+ See also:
+
+ [Manage line items](https://docs.monite.com/docs/manage-line-items)
+
+ [Collect payables](https://docs.monite.com/docs/collect-payables)
+
+ Parameters
+ ----------
+ line_item_id : str
+
+ payable_id : str
+
+ accounting_tax_rate_id : typing.Optional[str]
+ ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+ ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+
+ name : typing.Optional[str]
+ Name of the product.
+
+ quantity : typing.Optional[float]
+ The quantity of each of the goods, materials, or services listed in the payable.
+
+ tax : typing.Optional[int]
+ VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+
+ unit : typing.Optional[str]
+ The unit of the product
+
+ unit_price : typing.Optional[int]
+ The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payables.line_items.update_by_id(
+ line_item_id="line_item_id",
+ payable_id="payable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payables/{jsonable_encoder(payable_id)}/line_items/{jsonable_encoder(line_item_id)}",
+ method="PATCH",
+ json={
+ "accounting_tax_rate_id": accounting_tax_rate_id,
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "name": name,
+ "quantity": quantity,
+ "tax": tax,
+ "unit": unit,
+ "unit_price": unit_price,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemResponse,
+ parse_obj_as(
+ type_=LineItemResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/payment_intents/__init__.py b/src/monite/payment_intents/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/payment_intents/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/payment_intents/client.py b/src/monite/payment_intents/client.py
new file mode 100644
index 0000000..027a7d8
--- /dev/null
+++ b/src/monite/payment_intents/client.py
@@ -0,0 +1,672 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.payment_intent_cursor_fields import PaymentIntentCursorFields
+from ..core.request_options import RequestOptions
+from ..types.payment_intents_list_response import PaymentIntentsListResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.payment_intent_response import PaymentIntentResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..types.payment_intent_history_response import PaymentIntentHistoryResponse
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PaymentIntentsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PaymentIntentCursorFields] = None,
+ object_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentIntentsListResponse:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PaymentIntentCursorFields]
+ Allowed sort fields
+
+ object_id : typing.Optional[str]
+ ID of a payable or receivable invoice. If provided, returns only payment intents associated with the specified invoice.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentsListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_intents.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_intents",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_id": object_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentsListResponse,
+ parse_obj_as(
+ type_=PaymentIntentsListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, payment_intent_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentIntentResponse:
+ """
+ Parameters
+ ----------
+ payment_intent_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_intents.get_by_id(
+ payment_intent_id="payment_intent_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_intents/{jsonable_encoder(payment_intent_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentResponse,
+ parse_obj_as(
+ type_=PaymentIntentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self, payment_intent_id: str, *, amount: int, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentIntentResponse:
+ """
+ Parameters
+ ----------
+ payment_intent_id : str
+
+ amount : int
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_intents.update_by_id(
+ payment_intent_id="payment_intent_id",
+ amount=1,
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_intents/{jsonable_encoder(payment_intent_id)}",
+ method="PATCH",
+ json={
+ "amount": amount,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentResponse,
+ parse_obj_as(
+ type_=PaymentIntentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_history_by_id(
+ self, payment_intent_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentIntentHistoryResponse:
+ """
+ Parameters
+ ----------
+ payment_intent_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentHistoryResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_intents.get_history_by_id(
+ payment_intent_id="payment_intent_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_intents/{jsonable_encoder(payment_intent_id)}/history",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentHistoryResponse,
+ parse_obj_as(
+ type_=PaymentIntentHistoryResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPaymentIntentsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PaymentIntentCursorFields] = None,
+ object_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentIntentsListResponse:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PaymentIntentCursorFields]
+ Allowed sort fields
+
+ object_id : typing.Optional[str]
+ ID of a payable or receivable invoice. If provided, returns only payment intents associated with the specified invoice.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentsListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_intents.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_intents",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_id": object_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentsListResponse,
+ parse_obj_as(
+ type_=PaymentIntentsListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, payment_intent_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentIntentResponse:
+ """
+ Parameters
+ ----------
+ payment_intent_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_intents.get_by_id(
+ payment_intent_id="payment_intent_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_intents/{jsonable_encoder(payment_intent_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentResponse,
+ parse_obj_as(
+ type_=PaymentIntentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self, payment_intent_id: str, *, amount: int, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentIntentResponse:
+ """
+ Parameters
+ ----------
+ payment_intent_id : str
+
+ amount : int
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_intents.update_by_id(
+ payment_intent_id="payment_intent_id",
+ amount=1,
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_intents/{jsonable_encoder(payment_intent_id)}",
+ method="PATCH",
+ json={
+ "amount": amount,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentResponse,
+ parse_obj_as(
+ type_=PaymentIntentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_history_by_id(
+ self, payment_intent_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentIntentHistoryResponse:
+ """
+ Parameters
+ ----------
+ payment_intent_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentIntentHistoryResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_intents.get_history_by_id(
+ payment_intent_id="payment_intent_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_intents/{jsonable_encoder(payment_intent_id)}/history",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentIntentHistoryResponse,
+ parse_obj_as(
+ type_=PaymentIntentHistoryResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/payment_links/__init__.py b/src/monite/payment_links/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/payment_links/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/payment_links/client.py b/src/monite/payment_links/client.py
new file mode 100644
index 0000000..3a47da0
--- /dev/null
+++ b/src/monite/payment_links/client.py
@@ -0,0 +1,575 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.monite_all_payment_methods_types import MoniteAllPaymentMethodsTypes
+from ..types.payment_account_object import PaymentAccountObject
+from ..types.currency_enum import CurrencyEnum
+import datetime as dt
+from ..types.invoice import Invoice
+from ..types.payment_object import PaymentObject
+from ..core.request_options import RequestOptions
+from ..types.public_payment_link_response import PublicPaymentLinkResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PaymentLinksClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def create(
+ self,
+ *,
+ payment_methods: typing.Sequence[MoniteAllPaymentMethodsTypes],
+ recipient: PaymentAccountObject,
+ amount: typing.Optional[int] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ expires_at: typing.Optional[dt.datetime] = OMIT,
+ invoice: typing.Optional[Invoice] = OMIT,
+ object: typing.Optional[PaymentObject] = OMIT,
+ payment_reference: typing.Optional[str] = OMIT,
+ return_url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PublicPaymentLinkResponse:
+ """
+ Parameters
+ ----------
+ payment_methods : typing.Sequence[MoniteAllPaymentMethodsTypes]
+
+ recipient : PaymentAccountObject
+
+ amount : typing.Optional[int]
+ The payment amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). Required if `object` is not specified.
+
+ currency : typing.Optional[CurrencyEnum]
+ The payment currency. Required if `object` is not specified.
+
+ expires_at : typing.Optional[dt.datetime]
+
+ invoice : typing.Optional[Invoice]
+ An object containing information about the invoice being paid. Used only if `object` is not specified.
+
+ object : typing.Optional[PaymentObject]
+ If the invoice being paid is a payable or receivable stored in Monite, provide the `object` object containing the invoice type and ID. Otherwise, use the `amount`, `currency`, `payment_reference`, and (optionally) `invoice` fields to specify the invoice-related data.
+
+ payment_reference : typing.Optional[str]
+ A payment reference number that the recipient can use to identify the payer or purpose of the transaction. Required if `object` is not specified.
+
+ return_url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PublicPaymentLinkResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite, PaymentAccountObject
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_links.create(
+ payment_methods=["sepa_credit"],
+ recipient=PaymentAccountObject(
+ id="id",
+ type="entity",
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_links",
+ method="POST",
+ json={
+ "amount": amount,
+ "currency": currency,
+ "expires_at": expires_at,
+ "invoice": convert_and_respect_annotation_metadata(
+ object_=invoice, annotation=Invoice, direction="write"
+ ),
+ "object": convert_and_respect_annotation_metadata(
+ object_=object, annotation=PaymentObject, direction="write"
+ ),
+ "payment_methods": payment_methods,
+ "payment_reference": payment_reference,
+ "recipient": convert_and_respect_annotation_metadata(
+ object_=recipient, annotation=PaymentAccountObject, direction="write"
+ ),
+ "return_url": return_url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PublicPaymentLinkResponse,
+ parse_obj_as(
+ type_=PublicPaymentLinkResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, payment_link_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PublicPaymentLinkResponse:
+ """
+ Parameters
+ ----------
+ payment_link_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PublicPaymentLinkResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_links.get_by_id(
+ payment_link_id="payment_link_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_links/{jsonable_encoder(payment_link_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PublicPaymentLinkResponse,
+ parse_obj_as(
+ type_=PublicPaymentLinkResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def expire_by_id(
+ self, payment_link_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PublicPaymentLinkResponse:
+ """
+ Parameters
+ ----------
+ payment_link_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PublicPaymentLinkResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_links.expire_by_id(
+ payment_link_id="payment_link_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_links/{jsonable_encoder(payment_link_id)}/expire",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PublicPaymentLinkResponse,
+ parse_obj_as(
+ type_=PublicPaymentLinkResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPaymentLinksClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def create(
+ self,
+ *,
+ payment_methods: typing.Sequence[MoniteAllPaymentMethodsTypes],
+ recipient: PaymentAccountObject,
+ amount: typing.Optional[int] = OMIT,
+ currency: typing.Optional[CurrencyEnum] = OMIT,
+ expires_at: typing.Optional[dt.datetime] = OMIT,
+ invoice: typing.Optional[Invoice] = OMIT,
+ object: typing.Optional[PaymentObject] = OMIT,
+ payment_reference: typing.Optional[str] = OMIT,
+ return_url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PublicPaymentLinkResponse:
+ """
+ Parameters
+ ----------
+ payment_methods : typing.Sequence[MoniteAllPaymentMethodsTypes]
+
+ recipient : PaymentAccountObject
+
+ amount : typing.Optional[int]
+ The payment amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). Required if `object` is not specified.
+
+ currency : typing.Optional[CurrencyEnum]
+ The payment currency. Required if `object` is not specified.
+
+ expires_at : typing.Optional[dt.datetime]
+
+ invoice : typing.Optional[Invoice]
+ An object containing information about the invoice being paid. Used only if `object` is not specified.
+
+ object : typing.Optional[PaymentObject]
+ If the invoice being paid is a payable or receivable stored in Monite, provide the `object` object containing the invoice type and ID. Otherwise, use the `amount`, `currency`, `payment_reference`, and (optionally) `invoice` fields to specify the invoice-related data.
+
+ payment_reference : typing.Optional[str]
+ A payment reference number that the recipient can use to identify the payer or purpose of the transaction. Required if `object` is not specified.
+
+ return_url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PublicPaymentLinkResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, PaymentAccountObject
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_links.create(
+ payment_methods=["sepa_credit"],
+ recipient=PaymentAccountObject(
+ id="id",
+ type="entity",
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_links",
+ method="POST",
+ json={
+ "amount": amount,
+ "currency": currency,
+ "expires_at": expires_at,
+ "invoice": convert_and_respect_annotation_metadata(
+ object_=invoice, annotation=Invoice, direction="write"
+ ),
+ "object": convert_and_respect_annotation_metadata(
+ object_=object, annotation=PaymentObject, direction="write"
+ ),
+ "payment_methods": payment_methods,
+ "payment_reference": payment_reference,
+ "recipient": convert_and_respect_annotation_metadata(
+ object_=recipient, annotation=PaymentAccountObject, direction="write"
+ ),
+ "return_url": return_url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PublicPaymentLinkResponse,
+ parse_obj_as(
+ type_=PublicPaymentLinkResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, payment_link_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PublicPaymentLinkResponse:
+ """
+ Parameters
+ ----------
+ payment_link_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PublicPaymentLinkResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_links.get_by_id(
+ payment_link_id="payment_link_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_links/{jsonable_encoder(payment_link_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PublicPaymentLinkResponse,
+ parse_obj_as(
+ type_=PublicPaymentLinkResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def expire_by_id(
+ self, payment_link_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PublicPaymentLinkResponse:
+ """
+ Parameters
+ ----------
+ payment_link_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PublicPaymentLinkResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_links.expire_by_id(
+ payment_link_id="payment_link_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_links/{jsonable_encoder(payment_link_id)}/expire",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PublicPaymentLinkResponse,
+ parse_obj_as(
+ type_=PublicPaymentLinkResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/payment_records/__init__.py b/src/monite/payment_records/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/payment_records/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/payment_records/client.py b/src/monite/payment_records/client.py
new file mode 100644
index 0000000..ecd3830
--- /dev/null
+++ b/src/monite/payment_records/client.py
@@ -0,0 +1,1029 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.payment_record_cursor_fields import PaymentRecordCursorFields
+from ..core.request_options import RequestOptions
+from ..types.payment_record_response_list import PaymentRecordResponseList
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_found_error import NotFoundError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.conflict_error import ConflictError
+from ..errors.range_not_satisfiable_error import RangeNotSatisfiableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.currency_enum import CurrencyEnum
+from ..types.payment_record_object_request import PaymentRecordObjectRequest
+import datetime as dt
+from ..types.payment_record_response import PaymentRecordResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PaymentRecordsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PaymentRecordCursorFields] = None,
+ is_external: typing.Optional[bool] = None,
+ object_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentRecordResponseList:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PaymentRecordCursorFields]
+ Allowed sort fields
+
+ is_external : typing.Optional[bool]
+
+ object_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentRecordResponseList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_records.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_records",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "is_external": is_external,
+ "object_id": object_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentRecordResponseList,
+ parse_obj_as(
+ type_=PaymentRecordResponseList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 416:
+ raise RangeNotSatisfiableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ amount: int,
+ currency: CurrencyEnum,
+ object: PaymentRecordObjectRequest,
+ paid_at: dt.datetime,
+ payment_intent_id: str,
+ entity_user_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentRecordResponse:
+ """
+ Parameters
+ ----------
+ amount : int
+
+ currency : CurrencyEnum
+
+ object : PaymentRecordObjectRequest
+
+ paid_at : dt.datetime
+
+ payment_intent_id : str
+
+ entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentRecordResponse
+ Successful Response
+
+ Examples
+ --------
+ import datetime
+
+ from monite import Monite, PaymentRecordObjectRequest
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_records.create(
+ amount=1,
+ currency="AED",
+ object=PaymentRecordObjectRequest(
+ id="id",
+ type="receivable",
+ ),
+ paid_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ payment_intent_id="payment_intent_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_records",
+ method="POST",
+ json={
+ "amount": amount,
+ "currency": currency,
+ "entity_user_id": entity_user_id,
+ "object": convert_and_respect_annotation_metadata(
+ object_=object, annotation=PaymentRecordObjectRequest, direction="write"
+ ),
+ "paid_at": paid_at,
+ "payment_intent_id": payment_intent_id,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentRecordResponse,
+ parse_obj_as(
+ type_=PaymentRecordResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 416:
+ raise RangeNotSatisfiableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, payment_record_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentRecordResponse:
+ """
+ Parameters
+ ----------
+ payment_record_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentRecordResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_records.get_by_id(
+ payment_record_id="payment_record_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_records/{jsonable_encoder(payment_record_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentRecordResponse,
+ parse_obj_as(
+ type_=PaymentRecordResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 416:
+ raise RangeNotSatisfiableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPaymentRecordsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PaymentRecordCursorFields] = None,
+ is_external: typing.Optional[bool] = None,
+ object_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentRecordResponseList:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PaymentRecordCursorFields]
+ Allowed sort fields
+
+ is_external : typing.Optional[bool]
+
+ object_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentRecordResponseList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_records.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_records",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "is_external": is_external,
+ "object_id": object_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentRecordResponseList,
+ parse_obj_as(
+ type_=PaymentRecordResponseList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 416:
+ raise RangeNotSatisfiableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ amount: int,
+ currency: CurrencyEnum,
+ object: PaymentRecordObjectRequest,
+ paid_at: dt.datetime,
+ payment_intent_id: str,
+ entity_user_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentRecordResponse:
+ """
+ Parameters
+ ----------
+ amount : int
+
+ currency : CurrencyEnum
+
+ object : PaymentRecordObjectRequest
+
+ paid_at : dt.datetime
+
+ payment_intent_id : str
+
+ entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentRecordResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+ import datetime
+
+ from monite import AsyncMonite, PaymentRecordObjectRequest
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_records.create(
+ amount=1,
+ currency="AED",
+ object=PaymentRecordObjectRequest(
+ id="id",
+ type="receivable",
+ ),
+ paid_at=datetime.datetime.fromisoformat(
+ "2024-01-15 09:30:00+00:00",
+ ),
+ payment_intent_id="payment_intent_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_records",
+ method="POST",
+ json={
+ "amount": amount,
+ "currency": currency,
+ "entity_user_id": entity_user_id,
+ "object": convert_and_respect_annotation_metadata(
+ object_=object, annotation=PaymentRecordObjectRequest, direction="write"
+ ),
+ "paid_at": paid_at,
+ "payment_intent_id": payment_intent_id,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentRecordResponse,
+ parse_obj_as(
+ type_=PaymentRecordResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 416:
+ raise RangeNotSatisfiableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, payment_record_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentRecordResponse:
+ """
+ Parameters
+ ----------
+ payment_record_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentRecordResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_records.get_by_id(
+ payment_record_id="payment_record_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_records/{jsonable_encoder(payment_record_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentRecordResponse,
+ parse_obj_as(
+ type_=PaymentRecordResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 416:
+ raise RangeNotSatisfiableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/payment_reminders/__init__.py b/src/monite/payment_reminders/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/payment_reminders/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/payment_reminders/client.py b/src/monite/payment_reminders/client.py
new file mode 100644
index 0000000..6c43dae
--- /dev/null
+++ b/src/monite/payment_reminders/client.py
@@ -0,0 +1,1192 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.get_all_payment_reminders import GetAllPaymentReminders
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unauthorized_error import UnauthorizedError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.recipients import Recipients
+from ..types.reminder import Reminder
+from ..types.payment_reminder_response import PaymentReminderResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..errors.bad_request_error import BadRequestError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.not_found_error import NotFoundError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PaymentRemindersClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetAllPaymentReminders:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetAllPaymentReminders
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_reminders.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_reminders",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ GetAllPaymentReminders,
+ parse_obj_as(
+ type_=GetAllPaymentReminders, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ recipients: typing.Optional[Recipients] = OMIT,
+ term1reminder: typing.Optional[Reminder] = OMIT,
+ term2reminder: typing.Optional[Reminder] = OMIT,
+ term_final_reminder: typing.Optional[Reminder] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentReminderResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ recipients : typing.Optional[Recipients]
+
+ term1reminder : typing.Optional[Reminder]
+ Reminder to send for first payment term
+
+ term2reminder : typing.Optional[Reminder]
+ Reminder to send for second payment term
+
+ term_final_reminder : typing.Optional[Reminder]
+ Reminder to send for final payment term
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_reminders.create(
+ name="name",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_reminders",
+ method="POST",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "term_1_reminder": convert_and_respect_annotation_metadata(
+ object_=term1reminder, annotation=Reminder, direction="write"
+ ),
+ "term_2_reminder": convert_and_respect_annotation_metadata(
+ object_=term2reminder, annotation=Reminder, direction="write"
+ ),
+ "term_final_reminder": convert_and_respect_annotation_metadata(
+ object_=term_final_reminder, annotation=Reminder, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentReminderResponse,
+ parse_obj_as(
+ type_=PaymentReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, payment_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentReminderResponse:
+ """
+ Parameters
+ ----------
+ payment_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_reminders.get_by_id(
+ payment_reminder_id="payment_reminder_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_reminders/{jsonable_encoder(payment_reminder_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentReminderResponse,
+ parse_obj_as(
+ type_=PaymentReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, payment_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ payment_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_reminders.delete_by_id(
+ payment_reminder_id="payment_reminder_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_reminders/{jsonable_encoder(payment_reminder_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ payment_reminder_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ recipients: typing.Optional[Recipients] = OMIT,
+ term1reminder: typing.Optional[Reminder] = OMIT,
+ term2reminder: typing.Optional[Reminder] = OMIT,
+ term_final_reminder: typing.Optional[Reminder] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentReminderResponse:
+ """
+ Parameters
+ ----------
+ payment_reminder_id : str
+
+ name : typing.Optional[str]
+
+ recipients : typing.Optional[Recipients]
+
+ term1reminder : typing.Optional[Reminder]
+ Reminder to send for first payment term
+
+ term2reminder : typing.Optional[Reminder]
+ Reminder to send for second payment term
+
+ term_final_reminder : typing.Optional[Reminder]
+ Reminder to send for final payment term
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_reminders.update_by_id(
+ payment_reminder_id="payment_reminder_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_reminders/{jsonable_encoder(payment_reminder_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "term_1_reminder": convert_and_respect_annotation_metadata(
+ object_=term1reminder, annotation=Reminder, direction="write"
+ ),
+ "term_2_reminder": convert_and_respect_annotation_metadata(
+ object_=term2reminder, annotation=Reminder, direction="write"
+ ),
+ "term_final_reminder": convert_and_respect_annotation_metadata(
+ object_=term_final_reminder, annotation=Reminder, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentReminderResponse,
+ parse_obj_as(
+ type_=PaymentReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPaymentRemindersClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetAllPaymentReminders:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetAllPaymentReminders
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_reminders.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_reminders",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ GetAllPaymentReminders,
+ parse_obj_as(
+ type_=GetAllPaymentReminders, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ recipients: typing.Optional[Recipients] = OMIT,
+ term1reminder: typing.Optional[Reminder] = OMIT,
+ term2reminder: typing.Optional[Reminder] = OMIT,
+ term_final_reminder: typing.Optional[Reminder] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentReminderResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ recipients : typing.Optional[Recipients]
+
+ term1reminder : typing.Optional[Reminder]
+ Reminder to send for first payment term
+
+ term2reminder : typing.Optional[Reminder]
+ Reminder to send for second payment term
+
+ term_final_reminder : typing.Optional[Reminder]
+ Reminder to send for final payment term
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_reminders.create(
+ name="name",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_reminders",
+ method="POST",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "term_1_reminder": convert_and_respect_annotation_metadata(
+ object_=term1reminder, annotation=Reminder, direction="write"
+ ),
+ "term_2_reminder": convert_and_respect_annotation_metadata(
+ object_=term2reminder, annotation=Reminder, direction="write"
+ ),
+ "term_final_reminder": convert_and_respect_annotation_metadata(
+ object_=term_final_reminder, annotation=Reminder, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentReminderResponse,
+ parse_obj_as(
+ type_=PaymentReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, payment_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentReminderResponse:
+ """
+ Parameters
+ ----------
+ payment_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_reminders.get_by_id(
+ payment_reminder_id="payment_reminder_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_reminders/{jsonable_encoder(payment_reminder_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentReminderResponse,
+ parse_obj_as(
+ type_=PaymentReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, payment_reminder_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ payment_reminder_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_reminders.delete_by_id(
+ payment_reminder_id="payment_reminder_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_reminders/{jsonable_encoder(payment_reminder_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ payment_reminder_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ recipients: typing.Optional[Recipients] = OMIT,
+ term1reminder: typing.Optional[Reminder] = OMIT,
+ term2reminder: typing.Optional[Reminder] = OMIT,
+ term_final_reminder: typing.Optional[Reminder] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentReminderResponse:
+ """
+ Parameters
+ ----------
+ payment_reminder_id : str
+
+ name : typing.Optional[str]
+
+ recipients : typing.Optional[Recipients]
+
+ term1reminder : typing.Optional[Reminder]
+ Reminder to send for first payment term
+
+ term2reminder : typing.Optional[Reminder]
+ Reminder to send for second payment term
+
+ term_final_reminder : typing.Optional[Reminder]
+ Reminder to send for final payment term
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentReminderResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_reminders.update_by_id(
+ payment_reminder_id="payment_reminder_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_reminders/{jsonable_encoder(payment_reminder_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "term_1_reminder": convert_and_respect_annotation_metadata(
+ object_=term1reminder, annotation=Reminder, direction="write"
+ ),
+ "term_2_reminder": convert_and_respect_annotation_metadata(
+ object_=term2reminder, annotation=Reminder, direction="write"
+ ),
+ "term_final_reminder": convert_and_respect_annotation_metadata(
+ object_=term_final_reminder, annotation=Reminder, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentReminderResponse,
+ parse_obj_as(
+ type_=PaymentReminderResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/payment_terms/__init__.py b/src/monite/payment_terms/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/payment_terms/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/payment_terms/client.py b/src/monite/payment_terms/client.py
new file mode 100644
index 0000000..a331bb7
--- /dev/null
+++ b/src/monite/payment_terms/client.py
@@ -0,0 +1,1188 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.payment_terms_list_response import PaymentTermsListResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unauthorized_error import UnauthorizedError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.payment_term import PaymentTerm
+from ..types.payment_term_discount import PaymentTermDiscount
+from ..types.payment_terms_response import PaymentTermsResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..errors.bad_request_error import BadRequestError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.not_found_error import NotFoundError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PaymentTermsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> PaymentTermsListResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_terms.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_terms",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsListResponse,
+ parse_obj_as(
+ type_=PaymentTermsListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ term_final: PaymentTerm,
+ description: typing.Optional[str] = OMIT,
+ term1: typing.Optional[PaymentTermDiscount] = OMIT,
+ term2: typing.Optional[PaymentTermDiscount] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentTermsResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ term_final : PaymentTerm
+ The final tier of the payment term. Defines the invoice due date.
+
+ description : typing.Optional[str]
+
+ term1 : typing.Optional[PaymentTermDiscount]
+ The first tier of the payment term. Represents the terms of the first early discount.
+
+ term2 : typing.Optional[PaymentTermDiscount]
+ The second tier of the payment term. Defines the terms of the second early discount.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite, PaymentTerm
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_terms.create(
+ name="name",
+ term_final=PaymentTerm(
+ number_of_days=1,
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payment_terms",
+ method="POST",
+ json={
+ "description": description,
+ "name": name,
+ "term_1": convert_and_respect_annotation_metadata(
+ object_=term1, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_2": convert_and_respect_annotation_metadata(
+ object_=term2, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_final": convert_and_respect_annotation_metadata(
+ object_=term_final, annotation=PaymentTerm, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsResponse,
+ parse_obj_as(
+ type_=PaymentTermsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, payment_terms_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentTermsResponse:
+ """
+ Parameters
+ ----------
+ payment_terms_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_terms.get_by_id(
+ payment_terms_id="payment_terms_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_terms/{jsonable_encoder(payment_terms_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsResponse,
+ parse_obj_as(
+ type_=PaymentTermsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, payment_terms_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ payment_terms_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_terms.delete_by_id(
+ payment_terms_id="payment_terms_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_terms/{jsonable_encoder(payment_terms_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ payment_terms_id: str,
+ *,
+ description: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ term1: typing.Optional[PaymentTermDiscount] = OMIT,
+ term2: typing.Optional[PaymentTermDiscount] = OMIT,
+ term_final: typing.Optional[PaymentTerm] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentTermsResponse:
+ """
+ Parameters
+ ----------
+ payment_terms_id : str
+
+ description : typing.Optional[str]
+
+ name : typing.Optional[str]
+
+ term1 : typing.Optional[PaymentTermDiscount]
+ The first tier of the payment term. Represents the terms of the first early discount.
+
+ term2 : typing.Optional[PaymentTermDiscount]
+ The second tier of the payment term. Defines the terms of the second early discount.
+
+ term_final : typing.Optional[PaymentTerm]
+ The final tier of the payment term. Defines the invoice due date.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.payment_terms.update_by_id(
+ payment_terms_id="payment_terms_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payment_terms/{jsonable_encoder(payment_terms_id)}",
+ method="PATCH",
+ json={
+ "description": description,
+ "name": name,
+ "term_1": convert_and_respect_annotation_metadata(
+ object_=term1, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_2": convert_and_respect_annotation_metadata(
+ object_=term2, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_final": convert_and_respect_annotation_metadata(
+ object_=term_final, annotation=PaymentTerm, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsResponse,
+ parse_obj_as(
+ type_=PaymentTermsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPaymentTermsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> PaymentTermsListResponse:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_terms.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_terms",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsListResponse,
+ parse_obj_as(
+ type_=PaymentTermsListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ term_final: PaymentTerm,
+ description: typing.Optional[str] = OMIT,
+ term1: typing.Optional[PaymentTermDiscount] = OMIT,
+ term2: typing.Optional[PaymentTermDiscount] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentTermsResponse:
+ """
+ Parameters
+ ----------
+ name : str
+
+ term_final : PaymentTerm
+ The final tier of the payment term. Defines the invoice due date.
+
+ description : typing.Optional[str]
+
+ term1 : typing.Optional[PaymentTermDiscount]
+ The first tier of the payment term. Represents the terms of the first early discount.
+
+ term2 : typing.Optional[PaymentTermDiscount]
+ The second tier of the payment term. Defines the terms of the second early discount.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, PaymentTerm
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_terms.create(
+ name="name",
+ term_final=PaymentTerm(
+ number_of_days=1,
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payment_terms",
+ method="POST",
+ json={
+ "description": description,
+ "name": name,
+ "term_1": convert_and_respect_annotation_metadata(
+ object_=term1, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_2": convert_and_respect_annotation_metadata(
+ object_=term2, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_final": convert_and_respect_annotation_metadata(
+ object_=term_final, annotation=PaymentTerm, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsResponse,
+ parse_obj_as(
+ type_=PaymentTermsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, payment_terms_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PaymentTermsResponse:
+ """
+ Parameters
+ ----------
+ payment_terms_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_terms.get_by_id(
+ payment_terms_id="payment_terms_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_terms/{jsonable_encoder(payment_terms_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsResponse,
+ parse_obj_as(
+ type_=PaymentTermsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, payment_terms_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ payment_terms_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_terms.delete_by_id(
+ payment_terms_id="payment_terms_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_terms/{jsonable_encoder(payment_terms_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ payment_terms_id: str,
+ *,
+ description: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ term1: typing.Optional[PaymentTermDiscount] = OMIT,
+ term2: typing.Optional[PaymentTermDiscount] = OMIT,
+ term_final: typing.Optional[PaymentTerm] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PaymentTermsResponse:
+ """
+ Parameters
+ ----------
+ payment_terms_id : str
+
+ description : typing.Optional[str]
+
+ name : typing.Optional[str]
+
+ term1 : typing.Optional[PaymentTermDiscount]
+ The first tier of the payment term. Represents the terms of the first early discount.
+
+ term2 : typing.Optional[PaymentTermDiscount]
+ The second tier of the payment term. Defines the terms of the second early discount.
+
+ term_final : typing.Optional[PaymentTerm]
+ The final tier of the payment term. Defines the invoice due date.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PaymentTermsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.payment_terms.update_by_id(
+ payment_terms_id="payment_terms_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payment_terms/{jsonable_encoder(payment_terms_id)}",
+ method="PATCH",
+ json={
+ "description": description,
+ "name": name,
+ "term_1": convert_and_respect_annotation_metadata(
+ object_=term1, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_2": convert_and_respect_annotation_metadata(
+ object_=term2, annotation=PaymentTermDiscount, direction="write"
+ ),
+ "term_final": convert_and_respect_annotation_metadata(
+ object_=term_final, annotation=PaymentTerm, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PaymentTermsResponse,
+ parse_obj_as(
+ type_=PaymentTermsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/pdf_templates/__init__.py b/src/monite/pdf_templates/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/pdf_templates/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/pdf_templates/client.py b/src/monite/pdf_templates/client.py
new file mode 100644
index 0000000..a5ea64d
--- /dev/null
+++ b/src/monite/pdf_templates/client.py
@@ -0,0 +1,728 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.client_wrapper import SyncClientWrapper
+import typing
+from ..core.request_options import RequestOptions
+from ..types.template_list_response import TemplateListResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.template_receivable_response import TemplateReceivableResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+
+class PdfTemplatesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> TemplateListResponse:
+ """
+ This API call returns all supported templates with language codes.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.pdf_templates.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "document_templates",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateListResponse,
+ parse_obj_as(
+ type_=TemplateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_system(self, *, request_options: typing.Optional[RequestOptions] = None) -> TemplateListResponse:
+ """
+ This API call returns all supported system templates with language codes.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.pdf_templates.get_system()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "document_templates/system",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateListResponse,
+ parse_obj_as(
+ type_=TemplateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, document_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TemplateReceivableResponse:
+ """
+ Parameters
+ ----------
+ document_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.pdf_templates.get_by_id(
+ document_template_id="document_template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"document_templates/{jsonable_encoder(document_template_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateReceivableResponse,
+ parse_obj_as(
+ type_=TemplateReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def make_default_by_id(
+ self, document_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TemplateReceivableResponse:
+ """
+ Parameters
+ ----------
+ document_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.pdf_templates.make_default_by_id(
+ document_template_id="document_template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"document_templates/{jsonable_encoder(document_template_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateReceivableResponse,
+ parse_obj_as(
+ type_=TemplateReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def preview_by_id(
+ self, document_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.Iterator[bytes]:
+ """
+ Returns a sample PDF invoice generated using the specified template.
+
+ Parameters
+ ----------
+ document_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Yields
+ ------
+ typing.Iterator[bytes]
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.pdf_templates.preview_by_id(
+ document_template_id="string",
+ )
+ """
+ with self._client_wrapper.httpx_client.stream(
+ f"document_templates/{jsonable_encoder(document_template_id)}/preview",
+ method="GET",
+ request_options=request_options,
+ ) as _response:
+ try:
+ if 200 <= _response.status_code < 300:
+ for _chunk in _response.iter_bytes():
+ yield _chunk
+ return
+ _response.read()
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPdfTemplatesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> TemplateListResponse:
+ """
+ This API call returns all supported templates with language codes.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.pdf_templates.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "document_templates",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateListResponse,
+ parse_obj_as(
+ type_=TemplateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_system(self, *, request_options: typing.Optional[RequestOptions] = None) -> TemplateListResponse:
+ """
+ This API call returns all supported system templates with language codes.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.pdf_templates.get_system()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "document_templates/system",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateListResponse,
+ parse_obj_as(
+ type_=TemplateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, document_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TemplateReceivableResponse:
+ """
+ Parameters
+ ----------
+ document_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.pdf_templates.get_by_id(
+ document_template_id="document_template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"document_templates/{jsonable_encoder(document_template_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateReceivableResponse,
+ parse_obj_as(
+ type_=TemplateReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def make_default_by_id(
+ self, document_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TemplateReceivableResponse:
+ """
+ Parameters
+ ----------
+ document_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TemplateReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.pdf_templates.make_default_by_id(
+ document_template_id="document_template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"document_templates/{jsonable_encoder(document_template_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TemplateReceivableResponse,
+ parse_obj_as(
+ type_=TemplateReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def preview_by_id(
+ self, document_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> typing.AsyncIterator[bytes]:
+ """
+ Returns a sample PDF invoice generated using the specified template.
+
+ Parameters
+ ----------
+ document_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Yields
+ ------
+ typing.AsyncIterator[bytes]
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.pdf_templates.preview_by_id(
+ document_template_id="string",
+ )
+
+
+ asyncio.run(main())
+ """
+ async with self._client_wrapper.httpx_client.stream(
+ f"document_templates/{jsonable_encoder(document_template_id)}/preview",
+ method="GET",
+ request_options=request_options,
+ ) as _response:
+ try:
+ if 200 <= _response.status_code < 300:
+ async for _chunk in _response.aiter_bytes():
+ yield _chunk
+ return
+ await _response.aread()
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/products/__init__.py b/src/monite/products/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/products/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/products/client.py b/src/monite/products/client.py
new file mode 100644
index 0000000..7740bf4
--- /dev/null
+++ b/src/monite/products/client.py
@@ -0,0 +1,1429 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum3 import OrderEnum3
+from ..types.product_cursor_fields import ProductCursorFields
+from ..types.product_service_type_enum import ProductServiceTypeEnum
+from ..types.currency_enum import CurrencyEnum
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.product_service_pagination_response import ProductServicePaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.price import Price
+from ..types.product_service_response import ProductServiceResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.not_found_error import NotFoundError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ProductsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum3] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ProductCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ name: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_icontains: typing.Optional[str] = None,
+ type: typing.Optional[ProductServiceTypeEnum] = None,
+ price: typing.Optional[int] = None,
+ price_gt: typing.Optional[int] = None,
+ price_lt: typing.Optional[int] = None,
+ price_gte: typing.Optional[int] = None,
+ price_lte: typing.Optional[int] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ currency_in: typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]] = None,
+ measure_unit_id: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProductServicePaginationResponse:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum3]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ProductCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ name : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_icontains : typing.Optional[str]
+
+ type : typing.Optional[ProductServiceTypeEnum]
+
+ price : typing.Optional[int]
+
+ price_gt : typing.Optional[int]
+
+ price_lt : typing.Optional[int]
+
+ price_gte : typing.Optional[int]
+
+ price_lte : typing.Optional[int]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ currency_in : typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]]
+
+ measure_unit_id : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServicePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.products.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "products",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "name": name,
+ "name__contains": name_contains,
+ "name__icontains": name_icontains,
+ "type": type,
+ "price": price,
+ "price__gt": price_gt,
+ "price__lt": price_lt,
+ "price__gte": price_gte,
+ "price__lte": price_lte,
+ "currency": currency,
+ "currency__in": currency_in,
+ "measure_unit_id": measure_unit_id,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServicePaginationResponse,
+ parse_obj_as(
+ type_=ProductServicePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ measure_unit_id: typing.Optional[str] = OMIT,
+ price: typing.Optional[Price] = OMIT,
+ smallest_amount: typing.Optional[float] = OMIT,
+ type: typing.Optional[ProductServiceTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProductServiceResponse:
+ """
+ Parameters
+ ----------
+ name : str
+ Name of the product.
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+
+ measure_unit_id : typing.Optional[str]
+ The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+
+ price : typing.Optional[Price]
+
+ smallest_amount : typing.Optional[float]
+ The smallest amount allowed for this product.
+
+ type : typing.Optional[ProductServiceTypeEnum]
+ Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServiceResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.products.create(
+ name="name",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "products",
+ method="POST",
+ json={
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "measure_unit_id": measure_unit_id,
+ "name": name,
+ "price": convert_and_respect_annotation_metadata(object_=price, annotation=Price, direction="write"),
+ "smallest_amount": smallest_amount,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServiceResponse,
+ parse_obj_as(
+ type_=ProductServiceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ProductServiceResponse:
+ """
+ Parameters
+ ----------
+ product_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServiceResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.products.get_by_id(
+ product_id="product_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"products/{jsonable_encoder(product_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServiceResponse,
+ parse_obj_as(
+ type_=ProductServiceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ product_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.products.delete_by_id(
+ product_id="product_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"products/{jsonable_encoder(product_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ product_id: str,
+ *,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ measure_unit_id: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ price: typing.Optional[Price] = OMIT,
+ smallest_amount: typing.Optional[float] = OMIT,
+ type: typing.Optional[ProductServiceTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProductServiceResponse:
+ """
+ Parameters
+ ----------
+ product_id : str
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+
+ measure_unit_id : typing.Optional[str]
+ The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+
+ name : typing.Optional[str]
+ Name of the product.
+
+ price : typing.Optional[Price]
+
+ smallest_amount : typing.Optional[float]
+ The smallest amount allowed for this product.
+
+ type : typing.Optional[ProductServiceTypeEnum]
+ Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServiceResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.products.update_by_id(
+ product_id="product_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"products/{jsonable_encoder(product_id)}",
+ method="PATCH",
+ json={
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "measure_unit_id": measure_unit_id,
+ "name": name,
+ "price": convert_and_respect_annotation_metadata(object_=price, annotation=Price, direction="write"),
+ "smallest_amount": smallest_amount,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServiceResponse,
+ parse_obj_as(
+ type_=ProductServiceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncProductsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum3] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ProductCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ name: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_icontains: typing.Optional[str] = None,
+ type: typing.Optional[ProductServiceTypeEnum] = None,
+ price: typing.Optional[int] = None,
+ price_gt: typing.Optional[int] = None,
+ price_lt: typing.Optional[int] = None,
+ price_gte: typing.Optional[int] = None,
+ price_lte: typing.Optional[int] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ currency_in: typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]] = None,
+ measure_unit_id: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProductServicePaginationResponse:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum3]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ProductCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ name : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_icontains : typing.Optional[str]
+
+ type : typing.Optional[ProductServiceTypeEnum]
+
+ price : typing.Optional[int]
+
+ price_gt : typing.Optional[int]
+
+ price_lt : typing.Optional[int]
+
+ price_gte : typing.Optional[int]
+
+ price_lte : typing.Optional[int]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ currency_in : typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]]
+
+ measure_unit_id : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServicePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.products.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "products",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "name": name,
+ "name__contains": name_contains,
+ "name__icontains": name_icontains,
+ "type": type,
+ "price": price,
+ "price__gt": price_gt,
+ "price__lt": price_lt,
+ "price__gte": price_gte,
+ "price__lte": price_lte,
+ "currency": currency,
+ "currency__in": currency_in,
+ "measure_unit_id": measure_unit_id,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServicePaginationResponse,
+ parse_obj_as(
+ type_=ProductServicePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ measure_unit_id: typing.Optional[str] = OMIT,
+ price: typing.Optional[Price] = OMIT,
+ smallest_amount: typing.Optional[float] = OMIT,
+ type: typing.Optional[ProductServiceTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProductServiceResponse:
+ """
+ Parameters
+ ----------
+ name : str
+ Name of the product.
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+
+ measure_unit_id : typing.Optional[str]
+ The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+
+ price : typing.Optional[Price]
+
+ smallest_amount : typing.Optional[float]
+ The smallest amount allowed for this product.
+
+ type : typing.Optional[ProductServiceTypeEnum]
+ Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServiceResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.products.create(
+ name="name",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "products",
+ method="POST",
+ json={
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "measure_unit_id": measure_unit_id,
+ "name": name,
+ "price": convert_and_respect_annotation_metadata(object_=price, annotation=Price, direction="write"),
+ "smallest_amount": smallest_amount,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServiceResponse,
+ parse_obj_as(
+ type_=ProductServiceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ProductServiceResponse:
+ """
+ Parameters
+ ----------
+ product_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServiceResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.products.get_by_id(
+ product_id="product_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"products/{jsonable_encoder(product_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServiceResponse,
+ parse_obj_as(
+ type_=ProductServiceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ product_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.products.delete_by_id(
+ product_id="product_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"products/{jsonable_encoder(product_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ product_id: str,
+ *,
+ description: typing.Optional[str] = OMIT,
+ ledger_account_id: typing.Optional[str] = OMIT,
+ measure_unit_id: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ price: typing.Optional[Price] = OMIT,
+ smallest_amount: typing.Optional[float] = OMIT,
+ type: typing.Optional[ProductServiceTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProductServiceResponse:
+ """
+ Parameters
+ ----------
+ product_id : str
+
+ description : typing.Optional[str]
+ Description of the product.
+
+ ledger_account_id : typing.Optional[str]
+
+ measure_unit_id : typing.Optional[str]
+ The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+
+ name : typing.Optional[str]
+ Name of the product.
+
+ price : typing.Optional[Price]
+
+ smallest_amount : typing.Optional[float]
+ The smallest amount allowed for this product.
+
+ type : typing.Optional[ProductServiceTypeEnum]
+ Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProductServiceResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.products.update_by_id(
+ product_id="product_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"products/{jsonable_encoder(product_id)}",
+ method="PATCH",
+ json={
+ "description": description,
+ "ledger_account_id": ledger_account_id,
+ "measure_unit_id": measure_unit_id,
+ "name": name,
+ "price": convert_and_respect_annotation_metadata(object_=price, annotation=Price, direction="write"),
+ "smallest_amount": smallest_amount,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProductServiceResponse,
+ parse_obj_as(
+ type_=ProductServiceResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/projects/__init__.py b/src/monite/projects/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/projects/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/projects/client.py b/src/monite/projects/client.py
new file mode 100644
index 0000000..90af132
--- /dev/null
+++ b/src/monite/projects/client.py
@@ -0,0 +1,1556 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.project_cursor_fields import ProjectCursorFields
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.project_pagination_response import ProjectPaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_found_error import NotFoundError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.project_resource import ProjectResource
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ProjectsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ProjectCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ start_date: typing.Optional[str] = None,
+ start_date_gt: typing.Optional[str] = None,
+ start_date_lt: typing.Optional[str] = None,
+ start_date_gte: typing.Optional[str] = None,
+ start_date_lte: typing.Optional[str] = None,
+ end_date: typing.Optional[str] = None,
+ end_date_gt: typing.Optional[str] = None,
+ end_date_lt: typing.Optional[str] = None,
+ end_date_gte: typing.Optional[str] = None,
+ end_date_lte: typing.Optional[str] = None,
+ name: typing.Optional[str] = None,
+ name_iexact: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_icontains: typing.Optional[str] = None,
+ code: typing.Optional[str] = None,
+ created_by_entity_user_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProjectPaginationResponse:
+ """
+ Get all projects for an entity
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ProjectCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ start_date : typing.Optional[str]
+
+ start_date_gt : typing.Optional[str]
+
+ start_date_lt : typing.Optional[str]
+
+ start_date_gte : typing.Optional[str]
+
+ start_date_lte : typing.Optional[str]
+
+ end_date : typing.Optional[str]
+
+ end_date_gt : typing.Optional[str]
+
+ end_date_lt : typing.Optional[str]
+
+ end_date_gte : typing.Optional[str]
+
+ end_date_lte : typing.Optional[str]
+
+ name : typing.Optional[str]
+
+ name_iexact : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_icontains : typing.Optional[str]
+
+ code : typing.Optional[str]
+
+ created_by_entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.projects.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "projects",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "start_date": start_date,
+ "start_date__gt": start_date_gt,
+ "start_date__lt": start_date_lt,
+ "start_date__gte": start_date_gte,
+ "start_date__lte": start_date_lte,
+ "end_date": end_date,
+ "end_date__gt": end_date_gt,
+ "end_date__lt": end_date_lt,
+ "end_date__gte": end_date_gte,
+ "end_date__lte": end_date_lte,
+ "name": name,
+ "name__iexact": name_iexact,
+ "name__contains": name_contains,
+ "name__icontains": name_icontains,
+ "code": code,
+ "created_by_entity_user_id": created_by_entity_user_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectPaginationResponse,
+ parse_obj_as(
+ type_=ProjectPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ code: typing.Optional[str] = OMIT,
+ color: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ end_date: typing.Optional[str] = OMIT,
+ parent_id: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ start_date: typing.Optional[str] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProjectResource:
+ """
+ Create a new project.
+
+ Parameters
+ ----------
+ name : str
+ The project name.
+
+ code : typing.Optional[str]
+ Project code
+
+ color : typing.Optional[str]
+ Project color
+
+ description : typing.Optional[str]
+ Description of project
+
+ end_date : typing.Optional[str]
+ Project end date
+
+ parent_id : typing.Optional[str]
+ Parent project ID
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Project metadata
+
+ start_date : typing.Optional[str]
+ Project start date
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this project.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.projects.create(
+ name="Marketing",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "projects",
+ method="POST",
+ json={
+ "code": code,
+ "color": color,
+ "description": description,
+ "end_date": end_date,
+ "name": name,
+ "parent_id": parent_id,
+ "partner_metadata": partner_metadata,
+ "start_date": start_date,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectResource,
+ parse_obj_as(
+ type_=ProjectResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> ProjectResource:
+ """
+ Get a project with the given ID.
+
+ Parameters
+ ----------
+ project_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.projects.get_by_id(
+ project_id="project_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"projects/{jsonable_encoder(project_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectResource,
+ parse_obj_as(
+ type_=ProjectResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete a project.
+
+ Parameters
+ ----------
+ project_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.projects.delete_by_id(
+ project_id="project_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"projects/{jsonable_encoder(project_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ project_id: str,
+ *,
+ code: typing.Optional[str] = OMIT,
+ color: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ end_date: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ parent_id: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ start_date: typing.Optional[str] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProjectResource:
+ """
+ Update a project.
+
+ Parameters
+ ----------
+ project_id : str
+
+ code : typing.Optional[str]
+ Project code
+
+ color : typing.Optional[str]
+ Project color
+
+ description : typing.Optional[str]
+ Description of project
+
+ end_date : typing.Optional[str]
+ Project end date
+
+ name : typing.Optional[str]
+ The project name.
+
+ parent_id : typing.Optional[str]
+ Parent project ID
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Project metadata
+
+ start_date : typing.Optional[str]
+ Project start date
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this project.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.projects.update_by_id(
+ project_id="project_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"projects/{jsonable_encoder(project_id)}",
+ method="PATCH",
+ json={
+ "code": code,
+ "color": color,
+ "description": description,
+ "end_date": end_date,
+ "name": name,
+ "parent_id": parent_id,
+ "partner_metadata": partner_metadata,
+ "start_date": start_date,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectResource,
+ parse_obj_as(
+ type_=ProjectResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncProjectsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ProjectCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ start_date: typing.Optional[str] = None,
+ start_date_gt: typing.Optional[str] = None,
+ start_date_lt: typing.Optional[str] = None,
+ start_date_gte: typing.Optional[str] = None,
+ start_date_lte: typing.Optional[str] = None,
+ end_date: typing.Optional[str] = None,
+ end_date_gt: typing.Optional[str] = None,
+ end_date_lt: typing.Optional[str] = None,
+ end_date_gte: typing.Optional[str] = None,
+ end_date_lte: typing.Optional[str] = None,
+ name: typing.Optional[str] = None,
+ name_iexact: typing.Optional[str] = None,
+ name_contains: typing.Optional[str] = None,
+ name_icontains: typing.Optional[str] = None,
+ code: typing.Optional[str] = None,
+ created_by_entity_user_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProjectPaginationResponse:
+ """
+ Get all projects for an entity
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ProjectCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ start_date : typing.Optional[str]
+
+ start_date_gt : typing.Optional[str]
+
+ start_date_lt : typing.Optional[str]
+
+ start_date_gte : typing.Optional[str]
+
+ start_date_lte : typing.Optional[str]
+
+ end_date : typing.Optional[str]
+
+ end_date_gt : typing.Optional[str]
+
+ end_date_lt : typing.Optional[str]
+
+ end_date_gte : typing.Optional[str]
+
+ end_date_lte : typing.Optional[str]
+
+ name : typing.Optional[str]
+
+ name_iexact : typing.Optional[str]
+
+ name_contains : typing.Optional[str]
+
+ name_icontains : typing.Optional[str]
+
+ code : typing.Optional[str]
+
+ created_by_entity_user_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.projects.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "projects",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "start_date": start_date,
+ "start_date__gt": start_date_gt,
+ "start_date__lt": start_date_lt,
+ "start_date__gte": start_date_gte,
+ "start_date__lte": start_date_lte,
+ "end_date": end_date,
+ "end_date__gt": end_date_gt,
+ "end_date__lt": end_date_lt,
+ "end_date__gte": end_date_gte,
+ "end_date__lte": end_date_lte,
+ "name": name,
+ "name__iexact": name_iexact,
+ "name__contains": name_contains,
+ "name__icontains": name_icontains,
+ "code": code,
+ "created_by_entity_user_id": created_by_entity_user_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectPaginationResponse,
+ parse_obj_as(
+ type_=ProjectPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ code: typing.Optional[str] = OMIT,
+ color: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ end_date: typing.Optional[str] = OMIT,
+ parent_id: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ start_date: typing.Optional[str] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProjectResource:
+ """
+ Create a new project.
+
+ Parameters
+ ----------
+ name : str
+ The project name.
+
+ code : typing.Optional[str]
+ Project code
+
+ color : typing.Optional[str]
+ Project color
+
+ description : typing.Optional[str]
+ Description of project
+
+ end_date : typing.Optional[str]
+ Project end date
+
+ parent_id : typing.Optional[str]
+ Parent project ID
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Project metadata
+
+ start_date : typing.Optional[str]
+ Project start date
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this project.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.projects.create(
+ name="Marketing",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "projects",
+ method="POST",
+ json={
+ "code": code,
+ "color": color,
+ "description": description,
+ "end_date": end_date,
+ "name": name,
+ "parent_id": parent_id,
+ "partner_metadata": partner_metadata,
+ "start_date": start_date,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectResource,
+ parse_obj_as(
+ type_=ProjectResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ProjectResource:
+ """
+ Get a project with the given ID.
+
+ Parameters
+ ----------
+ project_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.projects.get_by_id(
+ project_id="project_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"projects/{jsonable_encoder(project_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectResource,
+ parse_obj_as(
+ type_=ProjectResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, project_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete a project.
+
+ Parameters
+ ----------
+ project_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.projects.delete_by_id(
+ project_id="project_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"projects/{jsonable_encoder(project_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ project_id: str,
+ *,
+ code: typing.Optional[str] = OMIT,
+ color: typing.Optional[str] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ end_date: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ parent_id: typing.Optional[str] = OMIT,
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
+ start_date: typing.Optional[str] = OMIT,
+ tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ProjectResource:
+ """
+ Update a project.
+
+ Parameters
+ ----------
+ project_id : str
+
+ code : typing.Optional[str]
+ Project code
+
+ color : typing.Optional[str]
+ Project color
+
+ description : typing.Optional[str]
+ Description of project
+
+ end_date : typing.Optional[str]
+ Project end date
+
+ name : typing.Optional[str]
+ The project name.
+
+ parent_id : typing.Optional[str]
+ Parent project ID
+
+ partner_metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
+ Project metadata
+
+ start_date : typing.Optional[str]
+ Project start date
+
+ tag_ids : typing.Optional[typing.Sequence[str]]
+ A list of IDs of user-defined tags (labels) assigned to this project.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ProjectResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.projects.update_by_id(
+ project_id="project_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"projects/{jsonable_encoder(project_id)}",
+ method="PATCH",
+ json={
+ "code": code,
+ "color": color,
+ "description": description,
+ "end_date": end_date,
+ "name": name,
+ "parent_id": parent_id,
+ "partner_metadata": partner_metadata,
+ "start_date": start_date,
+ "tag_ids": tag_ids,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ProjectResource,
+ parse_obj_as(
+ type_=ProjectResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/purchase_orders/__init__.py b/src/monite/purchase_orders/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/purchase_orders/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/purchase_orders/client.py b/src/monite/purchase_orders/client.py
new file mode 100644
index 0000000..314b30b
--- /dev/null
+++ b/src/monite/purchase_orders/client.py
@@ -0,0 +1,2027 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.purchase_order_cursor_fields import PurchaseOrderCursorFields
+import datetime as dt
+from ..types.purchase_order_status_enum import PurchaseOrderStatusEnum
+from ..types.currency_enum import CurrencyEnum
+from ..core.request_options import RequestOptions
+from ..types.purchase_order_pagination_response import PurchaseOrderPaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.not_found_error import NotFoundError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.purchase_order_item import PurchaseOrderItem
+from ..types.purchase_order_response_schema import PurchaseOrderResponseSchema
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..types.variables_object_list import VariablesObjectList
+from ..core.jsonable_encoder import jsonable_encoder
+from ..types.purchase_order_email_preview_response import PurchaseOrderEmailPreviewResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..types.purchase_order_email_sent_response import PurchaseOrderEmailSentResponse
+from ..errors.conflict_error import ConflictError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class PurchaseOrdersClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PurchaseOrderCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ issued_at_gt: typing.Optional[dt.datetime] = None,
+ issued_at_lt: typing.Optional[dt.datetime] = None,
+ issued_at_gte: typing.Optional[dt.datetime] = None,
+ issued_at_lte: typing.Optional[dt.datetime] = None,
+ status: typing.Optional[PurchaseOrderStatusEnum] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ created_by: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ counterpart_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ counterpart_name: typing.Optional[str] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ currency_in: typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderPaginationResponse:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PurchaseOrderCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ issued_at_gt : typing.Optional[dt.datetime]
+
+ issued_at_lt : typing.Optional[dt.datetime]
+
+ issued_at_gte : typing.Optional[dt.datetime]
+
+ issued_at_lte : typing.Optional[dt.datetime]
+
+ status : typing.Optional[PurchaseOrderStatusEnum]
+
+ document_id : typing.Optional[str]
+
+ document_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ created_by : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ counterpart_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ counterpart_name : typing.Optional[str]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ currency_in : typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payable_purchase_orders",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ "issued_at__gt": serialize_datetime(issued_at_gt) if issued_at_gt is not None else None,
+ "issued_at__lt": serialize_datetime(issued_at_lt) if issued_at_lt is not None else None,
+ "issued_at__gte": serialize_datetime(issued_at_gte) if issued_at_gte is not None else None,
+ "issued_at__lte": serialize_datetime(issued_at_lte) if issued_at_lte is not None else None,
+ "status": status,
+ "document_id": document_id,
+ "document_id__in": document_id_in,
+ "created_by": created_by,
+ "counterpart_id": counterpart_id,
+ "counterpart_id__in": counterpart_id_in,
+ "counterpart.name": counterpart_name,
+ "currency": currency,
+ "currency__in": currency_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderPaginationResponse,
+ parse_obj_as(
+ type_=PurchaseOrderPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ counterpart_id: str,
+ currency: CurrencyEnum,
+ items: typing.Sequence[PurchaseOrderItem],
+ message: str,
+ valid_for_days: int,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ entity_vat_id_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderResponseSchema:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+ Counterpart unique ID.
+
+ currency : CurrencyEnum
+ The currency in which the price of the product is set. (all items need to have the same currency)
+
+ items : typing.Sequence[PurchaseOrderItem]
+ List of item to purchase
+
+ message : str
+ Msg which will be send to counterpart for who the purchase order is issued.
+
+ valid_for_days : int
+ Number of days for which purchase order is valid
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service. If not provided, counterpart's default address is used.
+
+ entity_vat_id_id : typing.Optional[str]
+ Entity VAT ID identifier that applied to purchase order
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite, PurchaseOrderItem
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.create(
+ counterpart_id="counterpart_id",
+ currency="AED",
+ items=[
+ PurchaseOrderItem(
+ currency="AED",
+ name="name",
+ price=1,
+ quantity=1,
+ unit="unit",
+ vat_rate=1,
+ )
+ ],
+ message="message",
+ valid_for_days=1,
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payable_purchase_orders",
+ method="POST",
+ json={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_id": counterpart_id,
+ "currency": currency,
+ "entity_vat_id_id": entity_vat_id_id,
+ "items": convert_and_respect_annotation_metadata(
+ object_=items, annotation=typing.Sequence[PurchaseOrderItem], direction="write"
+ ),
+ "message": message,
+ "valid_for_days": valid_for_days,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderResponseSchema,
+ parse_obj_as(
+ type_=PurchaseOrderResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_variables(self, *, request_options: typing.Optional[RequestOptions] = None) -> VariablesObjectList:
+ """
+ Get a list of placeholders allowed to insert into an email template for customization
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VariablesObjectList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.get_variables()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "payable_purchase_orders/variables",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VariablesObjectList,
+ parse_obj_as(
+ type_=VariablesObjectList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, purchase_order_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PurchaseOrderResponseSchema:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.get_by_id(
+ purchase_order_id="purchase_order_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderResponseSchema,
+ parse_obj_as(
+ type_=PurchaseOrderResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, purchase_order_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.delete_by_id(
+ purchase_order_id="purchase_order_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ purchase_order_id: str,
+ *,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ counterpart_id: typing.Optional[str] = OMIT,
+ entity_vat_id_id: typing.Optional[str] = OMIT,
+ items: typing.Optional[typing.Sequence[PurchaseOrderItem]] = OMIT,
+ message: typing.Optional[str] = OMIT,
+ valid_for_days: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderResponseSchema:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service. If not provided, counterpart's default address is used.
+
+ counterpart_id : typing.Optional[str]
+ Counterpart unique ID.
+
+ entity_vat_id_id : typing.Optional[str]
+ Entity VAT ID identifier that applied to purchase order
+
+ items : typing.Optional[typing.Sequence[PurchaseOrderItem]]
+ List of item to purchase
+
+ message : typing.Optional[str]
+ Msg which will be send to counterpart for who the purchase order is issued.
+
+ valid_for_days : typing.Optional[int]
+ Number of days for which purchase order is valid
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.update_by_id(
+ purchase_order_id="purchase_order_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}",
+ method="PATCH",
+ json={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_id": counterpart_id,
+ "entity_vat_id_id": entity_vat_id_id,
+ "items": convert_and_respect_annotation_metadata(
+ object_=items, annotation=typing.Sequence[PurchaseOrderItem], direction="write"
+ ),
+ "message": message,
+ "valid_for_days": valid_for_days,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderResponseSchema,
+ parse_obj_as(
+ type_=PurchaseOrderResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def preview_by_id(
+ self,
+ purchase_order_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderEmailPreviewResponse:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ body_text : str
+
+ subject_text : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderEmailPreviewResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.preview_by_id(
+ purchase_order_id="purchase_order_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}/preview",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "subject_text": subject_text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderEmailPreviewResponse,
+ parse_obj_as(
+ type_=PurchaseOrderEmailPreviewResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def send_by_id(
+ self,
+ purchase_order_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderEmailSentResponse:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ body_text : str
+
+ subject_text : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderEmailSentResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.purchase_orders.send_by_id(
+ purchase_order_id="purchase_order_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}/send",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "subject_text": subject_text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderEmailSentResponse,
+ parse_obj_as(
+ type_=PurchaseOrderEmailSentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncPurchaseOrdersClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[PurchaseOrderCursorFields] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ updated_at_gt: typing.Optional[dt.datetime] = None,
+ updated_at_lt: typing.Optional[dt.datetime] = None,
+ updated_at_gte: typing.Optional[dt.datetime] = None,
+ updated_at_lte: typing.Optional[dt.datetime] = None,
+ issued_at_gt: typing.Optional[dt.datetime] = None,
+ issued_at_lt: typing.Optional[dt.datetime] = None,
+ issued_at_gte: typing.Optional[dt.datetime] = None,
+ issued_at_lte: typing.Optional[dt.datetime] = None,
+ status: typing.Optional[PurchaseOrderStatusEnum] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ created_by: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ counterpart_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ counterpart_name: typing.Optional[str] = None,
+ currency: typing.Optional[CurrencyEnum] = None,
+ currency_in: typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderPaginationResponse:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[PurchaseOrderCursorFields]
+ Allowed sort fields
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ updated_at_gt : typing.Optional[dt.datetime]
+
+ updated_at_lt : typing.Optional[dt.datetime]
+
+ updated_at_gte : typing.Optional[dt.datetime]
+
+ updated_at_lte : typing.Optional[dt.datetime]
+
+ issued_at_gt : typing.Optional[dt.datetime]
+
+ issued_at_lt : typing.Optional[dt.datetime]
+
+ issued_at_gte : typing.Optional[dt.datetime]
+
+ issued_at_lte : typing.Optional[dt.datetime]
+
+ status : typing.Optional[PurchaseOrderStatusEnum]
+
+ document_id : typing.Optional[str]
+
+ document_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ created_by : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ counterpart_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ counterpart_name : typing.Optional[str]
+
+ currency : typing.Optional[CurrencyEnum]
+
+ currency_in : typing.Optional[typing.Union[CurrencyEnum, typing.Sequence[CurrencyEnum]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payable_purchase_orders",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "updated_at__gt": serialize_datetime(updated_at_gt) if updated_at_gt is not None else None,
+ "updated_at__lt": serialize_datetime(updated_at_lt) if updated_at_lt is not None else None,
+ "updated_at__gte": serialize_datetime(updated_at_gte) if updated_at_gte is not None else None,
+ "updated_at__lte": serialize_datetime(updated_at_lte) if updated_at_lte is not None else None,
+ "issued_at__gt": serialize_datetime(issued_at_gt) if issued_at_gt is not None else None,
+ "issued_at__lt": serialize_datetime(issued_at_lt) if issued_at_lt is not None else None,
+ "issued_at__gte": serialize_datetime(issued_at_gte) if issued_at_gte is not None else None,
+ "issued_at__lte": serialize_datetime(issued_at_lte) if issued_at_lte is not None else None,
+ "status": status,
+ "document_id": document_id,
+ "document_id__in": document_id_in,
+ "created_by": created_by,
+ "counterpart_id": counterpart_id,
+ "counterpart_id__in": counterpart_id_in,
+ "counterpart.name": counterpart_name,
+ "currency": currency,
+ "currency__in": currency_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderPaginationResponse,
+ parse_obj_as(
+ type_=PurchaseOrderPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ counterpart_id: str,
+ currency: CurrencyEnum,
+ items: typing.Sequence[PurchaseOrderItem],
+ message: str,
+ valid_for_days: int,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ entity_vat_id_id: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderResponseSchema:
+ """
+ Parameters
+ ----------
+ counterpart_id : str
+ Counterpart unique ID.
+
+ currency : CurrencyEnum
+ The currency in which the price of the product is set. (all items need to have the same currency)
+
+ items : typing.Sequence[PurchaseOrderItem]
+ List of item to purchase
+
+ message : str
+ Msg which will be send to counterpart for who the purchase order is issued.
+
+ valid_for_days : int
+ Number of days for which purchase order is valid
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service. If not provided, counterpart's default address is used.
+
+ entity_vat_id_id : typing.Optional[str]
+ Entity VAT ID identifier that applied to purchase order
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, PurchaseOrderItem
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.create(
+ counterpart_id="counterpart_id",
+ currency="AED",
+ items=[
+ PurchaseOrderItem(
+ currency="AED",
+ name="name",
+ price=1,
+ quantity=1,
+ unit="unit",
+ vat_rate=1,
+ )
+ ],
+ message="message",
+ valid_for_days=1,
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payable_purchase_orders",
+ method="POST",
+ json={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_id": counterpart_id,
+ "currency": currency,
+ "entity_vat_id_id": entity_vat_id_id,
+ "items": convert_and_respect_annotation_metadata(
+ object_=items, annotation=typing.Sequence[PurchaseOrderItem], direction="write"
+ ),
+ "message": message,
+ "valid_for_days": valid_for_days,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderResponseSchema,
+ parse_obj_as(
+ type_=PurchaseOrderResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_variables(self, *, request_options: typing.Optional[RequestOptions] = None) -> VariablesObjectList:
+ """
+ Get a list of placeholders allowed to insert into an email template for customization
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VariablesObjectList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.get_variables()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "payable_purchase_orders/variables",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VariablesObjectList,
+ parse_obj_as(
+ type_=VariablesObjectList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, purchase_order_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> PurchaseOrderResponseSchema:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.get_by_id(
+ purchase_order_id="purchase_order_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderResponseSchema,
+ parse_obj_as(
+ type_=PurchaseOrderResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, purchase_order_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.delete_by_id(
+ purchase_order_id="purchase_order_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ purchase_order_id: str,
+ *,
+ counterpart_address_id: typing.Optional[str] = OMIT,
+ counterpart_id: typing.Optional[str] = OMIT,
+ entity_vat_id_id: typing.Optional[str] = OMIT,
+ items: typing.Optional[typing.Sequence[PurchaseOrderItem]] = OMIT,
+ message: typing.Optional[str] = OMIT,
+ valid_for_days: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderResponseSchema:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ counterpart_address_id : typing.Optional[str]
+ The ID of counterpart address object stored in counterparts service. If not provided, counterpart's default address is used.
+
+ counterpart_id : typing.Optional[str]
+ Counterpart unique ID.
+
+ entity_vat_id_id : typing.Optional[str]
+ Entity VAT ID identifier that applied to purchase order
+
+ items : typing.Optional[typing.Sequence[PurchaseOrderItem]]
+ List of item to purchase
+
+ message : typing.Optional[str]
+ Msg which will be send to counterpart for who the purchase order is issued.
+
+ valid_for_days : typing.Optional[int]
+ Number of days for which purchase order is valid
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderResponseSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.update_by_id(
+ purchase_order_id="purchase_order_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}",
+ method="PATCH",
+ json={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_id": counterpart_id,
+ "entity_vat_id_id": entity_vat_id_id,
+ "items": convert_and_respect_annotation_metadata(
+ object_=items, annotation=typing.Sequence[PurchaseOrderItem], direction="write"
+ ),
+ "message": message,
+ "valid_for_days": valid_for_days,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderResponseSchema,
+ parse_obj_as(
+ type_=PurchaseOrderResponseSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def preview_by_id(
+ self,
+ purchase_order_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderEmailPreviewResponse:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ body_text : str
+
+ subject_text : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderEmailPreviewResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.preview_by_id(
+ purchase_order_id="purchase_order_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}/preview",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "subject_text": subject_text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderEmailPreviewResponse,
+ parse_obj_as(
+ type_=PurchaseOrderEmailPreviewResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def send_by_id(
+ self,
+ purchase_order_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> PurchaseOrderEmailSentResponse:
+ """
+ Parameters
+ ----------
+ purchase_order_id : str
+
+ body_text : str
+
+ subject_text : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ PurchaseOrderEmailSentResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.purchase_orders.send_by_id(
+ purchase_order_id="purchase_order_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"payable_purchase_orders/{jsonable_encoder(purchase_order_id)}/send",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "subject_text": subject_text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ PurchaseOrderEmailSentResponse,
+ parse_obj_as(
+ type_=PurchaseOrderEmailSentResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/py.typed b/src/monite/py.typed
new file mode 100644
index 0000000..e69de29
diff --git a/src/monite/receivables/__init__.py b/src/monite/receivables/__init__.py
new file mode 100644
index 0000000..5330a31
--- /dev/null
+++ b/src/monite/receivables/__init__.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .types import ReceivablesGetRequestStatus, ReceivablesGetRequestStatusInItem
+
+__all__ = ["ReceivablesGetRequestStatus", "ReceivablesGetRequestStatusInItem"]
diff --git a/src/monite/receivables/client.py b/src/monite/receivables/client.py
new file mode 100644
index 0000000..610dc4e
--- /dev/null
+++ b/src/monite/receivables/client.py
@@ -0,0 +1,6750 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum2 import OrderEnum2
+from .types.receivables_get_request_status_in_item import ReceivablesGetRequestStatusInItem
+from ..types.receivable_cursor_fields import ReceivableCursorFields
+from ..types.receivable_type import ReceivableType
+import datetime as dt
+from .types.receivables_get_request_status import ReceivablesGetRequestStatus
+from ..core.request_options import RequestOptions
+from ..types.receivable_pagination_response import ReceivablePaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.conflict_error import ConflictError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.receivable_facade_create_payload import ReceivableFacadeCreatePayload
+from ..types.receivable_response import ReceivableResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.not_found_error import NotFoundError
+from ..types.receivable_templates_variables_object_list import ReceivableTemplatesVariablesObjectList
+from ..core.jsonable_encoder import jsonable_encoder
+from ..types.receivable_update_payload import ReceivableUpdatePayload
+from ..types.signature import Signature
+from ..types.success_result import SuccessResult
+from ..types.order_enum3 import OrderEnum3
+from ..types.receivable_history_cursor_fields import ReceivableHistoryCursorFields
+from ..types.receivable_history_event_type_enum import ReceivableHistoryEventTypeEnum
+from ..types.receivable_history_pagination_response import ReceivableHistoryPaginationResponse
+from ..types.receivable_history_response import ReceivableHistoryResponse
+from ..types.line_item import LineItem
+from ..types.line_items_response import LineItemsResponse
+from ..types.receivable_mail_cursor_fields import ReceivableMailCursorFields
+from ..types.receivable_mail_status_enum import ReceivableMailStatusEnum
+from ..types.receivable_mail_pagination_response import ReceivableMailPaginationResponse
+from ..types.receivable_mail_response import ReceivableMailResponse
+from ..types.receivable_file_url import ReceivableFileUrl
+from ..types.language_code_enum import LanguageCodeEnum
+from ..types.receivables_preview_type_enum import ReceivablesPreviewTypeEnum
+from ..types.receivable_preview_response import ReceivablePreviewResponse
+from ..types.recipients import Recipients
+from ..types.receivable_send_response import ReceivableSendResponse
+from ..types.reminder_type_enum import ReminderTypeEnum
+from ..types.receivables_send_response import ReceivablesSendResponse
+from ..types.receivables_verify_response import ReceivablesVerifyResponse
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class ReceivablesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum2] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ status_in: typing.Optional[
+ typing.Union[ReceivablesGetRequestStatusInItem, typing.Sequence[ReceivablesGetRequestStatusInItem]]
+ ] = None,
+ entity_user_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ sort: typing.Optional[ReceivableCursorFields] = None,
+ tag_ids_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ type: typing.Optional[ReceivableType] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_contains: typing.Optional[str] = None,
+ document_id_icontains: typing.Optional[str] = None,
+ issue_date_gt: typing.Optional[dt.datetime] = None,
+ issue_date_lt: typing.Optional[dt.datetime] = None,
+ issue_date_gte: typing.Optional[dt.datetime] = None,
+ issue_date_lte: typing.Optional[dt.datetime] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ counterpart_id: typing.Optional[str] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ total_amount: typing.Optional[int] = None,
+ total_amount_gt: typing.Optional[int] = None,
+ total_amount_lt: typing.Optional[int] = None,
+ total_amount_gte: typing.Optional[int] = None,
+ total_amount_lte: typing.Optional[int] = None,
+ status: typing.Optional[ReceivablesGetRequestStatus] = None,
+ entity_user_id: typing.Optional[str] = None,
+ based_on: typing.Optional[str] = None,
+ due_date_gt: typing.Optional[str] = None,
+ due_date_lt: typing.Optional[str] = None,
+ due_date_gte: typing.Optional[str] = None,
+ due_date_lte: typing.Optional[str] = None,
+ project_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivablePaginationResponse:
+ """
+ Returns a list of [accounts receivable](https://docs.monite.com/accounts-receivable/index) documents - invoices, quotes, and credit notes - of the specified entity.
+
+ Results can be filtered by amount, counterpart, due date, and other criteria. Multiple filters are combined using logical AND unless specified otherwise. If no documents matching the search criteria are found, the endpoint returns a successful response with an empty `data` array.
+
+ This endpoint supports [pagination](https://docs.monite.com/api/concepts/pagination-sorting-filtering) and sorting. By default, results are sorted by the creation date in ascending order (from oldest to newest).
+
+ #### Examples
+
+ ##### Invoices
+
+ - Get all overdue invoices:
+
+ ```
+ GET /receivables?type=invoice&status=overdue
+ ```
+
+ - Get all invoices created for the counterpart named "Solarwind" (case-insensitive):
+
+ ```
+ GET /receivables?type=invoice?counterpart_name__icontains=Solarwind
+ ```
+
+ - Get invoices whose total amount starts from 500 EUR:
+
+ ```
+ GET /receivables?type=invoice&total_amount__gte=50000
+ ```
+
+ - Get invoices that are due for payment in September 2024:
+
+ ```
+ GET /receivables?type=invoice&due_date__gte=2024-09-01T00:00:00Z&due_date__lt=2024-10-01T00:00:00Z
+ ```
+
+ - Get invoices created on or after September 1, 2024:
+
+ ```
+ GET /receivables?type=invoice&created_at__gte=2024-09-01T00:00:00Z
+ ```
+
+ - Find an invoice created from a specific quote:
+
+ ```
+ GET /receivables?type=invoice?based_on=QUOTE_ID
+ ```
+
+ ##### Quotes
+
+ - Get the latest created quote:
+
+ ```
+ GET /receivables?type=quote&sort=created_at&order=desc&limit=1
+ ```
+
+ - Get the latest issued quote:
+
+ ```
+ GET /receivables?type=quote&sort=issue_date&order=desc&limit=1
+ ```
+
+ ##### Credit notes
+
+ - Find all credit notes created for a specific invoice:
+
+ ```
+ GET /receivables?type=credit_note?based_on=INVOICE_ID
+ ```
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum2]
+ Sort order (ascending by default). Typically used together with the `sort` parameter.
+
+ limit : typing.Optional[int]
+ The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.
+
+ When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`.
+
+ pagination_token : typing.Optional[str]
+ A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query.
+
+ If not specified, the first page of results will be returned.
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Return only receivables with the specified IDs. Valid but nonexistent IDs do not raise errors but produce no results.
+
+ To specify multiple IDs, repeat this parameter for each value:
+ `id__in=&id__in=`
+
+ status_in : typing.Optional[typing.Union[ReceivablesGetRequestStatusInItem, typing.Sequence[ReceivablesGetRequestStatusInItem]]]
+ Return only receivables that have the specified statuses. See the applicable [invoice statuses](https://docs.monite.com/accounts-receivable/invoices/index), [quote statuses](https://docs.monite.com/accounts-receivable/quotes/index), and [credit note statuses](https://docs.monite.com/accounts-receivable/credit-notes#credit-note-lifecycle).
+
+ To specify multiple statuses, repeat this parameter for each value:
+ `status__in=draft&status__in=issued`
+
+ entity_user_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Return only receivables created by the entity users with the specified IDs.To specify multiple user IDs, repeat this parameter for each ID:
+ `entity_user_id__in=&entity_user_id__in=`
+
+ If the request is authenticated using an entity user token, this user must have the `receivable.read.allowed` (rather than `allowed_for_own`) permission to be able to query receivables created by other users.
+
+ IDs of deleted users will still produce results here if those users had associated receivables. Valid but nonexistent user IDs do not raise errors but produce no results.
+
+ sort : typing.Optional[ReceivableCursorFields]
+ The field to sort the results by. Typically used together with the `order` parameter.
+
+ tag_ids_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Return only receivables whose [tags](https://docs.monite.com/common/tags) include at least one of the tags with the specified IDs.
+
+ For example, given receivables with the following tags:
+
+ 1. tagA
+ 2. tagB
+ 3. tagA, tagB
+ 4. tagC
+ 5. tagB, tagC
+
+ `tag_ids__in=&tag_ids__in=` will return receivables 1, 2, 3, and 5.
+
+ Valid but nonexistent tag IDs do not raise errors but produce no results.
+
+ type : typing.Optional[ReceivableType]
+
+ document_id : typing.Optional[str]
+
+ document_id_contains : typing.Optional[str]
+
+ document_id_icontains : typing.Optional[str]
+
+ issue_date_gt : typing.Optional[dt.datetime]
+
+ issue_date_lt : typing.Optional[dt.datetime]
+
+ issue_date_gte : typing.Optional[dt.datetime]
+
+ issue_date_lte : typing.Optional[dt.datetime]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ counterpart_id : typing.Optional[str]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ total_amount : typing.Optional[int]
+
+ total_amount_gt : typing.Optional[int]
+
+ total_amount_lt : typing.Optional[int]
+
+ total_amount_gte : typing.Optional[int]
+
+ total_amount_lte : typing.Optional[int]
+
+ status : typing.Optional[ReceivablesGetRequestStatus]
+
+ entity_user_id : typing.Optional[str]
+
+ based_on : typing.Optional[str]
+
+ due_date_gt : typing.Optional[str]
+
+ due_date_lt : typing.Optional[str]
+
+ due_date_gte : typing.Optional[str]
+
+ due_date_lte : typing.Optional[str]
+
+ project_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "receivables",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "id__in": id_in,
+ "status__in": status_in,
+ "entity_user_id__in": entity_user_id_in,
+ "sort": sort,
+ "tag_ids__in": tag_ids_in,
+ "type": type,
+ "document_id": document_id,
+ "document_id__contains": document_id_contains,
+ "document_id__icontains": document_id_icontains,
+ "issue_date__gt": serialize_datetime(issue_date_gt) if issue_date_gt is not None else None,
+ "issue_date__lt": serialize_datetime(issue_date_lt) if issue_date_lt is not None else None,
+ "issue_date__gte": serialize_datetime(issue_date_gte) if issue_date_gte is not None else None,
+ "issue_date__lte": serialize_datetime(issue_date_lte) if issue_date_lte is not None else None,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "counterpart_id": counterpart_id,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "total_amount": total_amount,
+ "total_amount__gt": total_amount_gt,
+ "total_amount__lt": total_amount_lt,
+ "total_amount__gte": total_amount_gte,
+ "total_amount__lte": total_amount_lte,
+ "status": status,
+ "entity_user_id": entity_user_id,
+ "based_on": based_on,
+ "due_date__gt": due_date_gt,
+ "due_date__lt": due_date_lt,
+ "due_date__gte": due_date_gte,
+ "due_date__lte": due_date_lte,
+ "project_id": project_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablePaginationResponse,
+ parse_obj_as(
+ type_=ReceivablePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self, *, request: ReceivableFacadeCreatePayload, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ request : ReceivableFacadeCreatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import LineItem, Monite, ReceivableFacadeCreateQuotePayload
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.create(
+ request=ReceivableFacadeCreateQuotePayload(
+ counterpart_billing_address_id="counterpart_billing_address_id",
+ counterpart_id="counterpart_id",
+ currency="AED",
+ line_items=[
+ LineItem(
+ quantity=1.1,
+ )
+ ],
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "receivables",
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ReceivableFacadeCreatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_variables(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableTemplatesVariablesObjectList:
+ """
+ Get a list of placeholders that can be used in email templates for customization.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableTemplatesVariablesObjectList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get_variables()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "receivables/variables",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableTemplatesVariablesObjectList,
+ parse_obj_as(
+ type_=ReceivableTemplatesVariablesObjectList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.delete_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ receivable_id: str,
+ *,
+ request: ReceivableUpdatePayload,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request : ReceivableUpdatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite, UpdateQuote, UpdateQuotePayload
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.update_by_id(
+ receivable_id="receivable_id",
+ request=UpdateQuotePayload(
+ quote=UpdateQuote(),
+ ),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}",
+ method="PATCH",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ReceivableUpdatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def accept_by_id(
+ self,
+ receivable_id: str,
+ *,
+ signature: typing.Optional[Signature] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> SuccessResult:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ signature : typing.Optional[Signature]
+ A digital signature, if required for quote acceptance
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SuccessResult
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.accept_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/accept",
+ method="POST",
+ json={
+ "signature": convert_and_respect_annotation_metadata(
+ object_=signature, annotation=Signature, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SuccessResult,
+ parse_obj_as(
+ type_=SuccessResult, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def cancel_by_id(self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.cancel_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def clone_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.clone_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/clone",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def decline_by_id(
+ self,
+ receivable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> SuccessResult:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ comment : typing.Optional[str]
+ Field with a comment on why the client declined this Quote
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SuccessResult
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.decline_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/decline",
+ method="POST",
+ json={
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SuccessResult,
+ parse_obj_as(
+ type_=SuccessResult, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_history(
+ self,
+ receivable_id: str,
+ *,
+ order: typing.Optional[OrderEnum3] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ReceivableHistoryCursorFields] = None,
+ event_type_in: typing.Optional[
+ typing.Union[ReceivableHistoryEventTypeEnum, typing.Sequence[ReceivableHistoryEventTypeEnum]]
+ ] = None,
+ entity_user_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ timestamp_gt: typing.Optional[dt.datetime] = None,
+ timestamp_lt: typing.Optional[dt.datetime] = None,
+ timestamp_gte: typing.Optional[dt.datetime] = None,
+ timestamp_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableHistoryPaginationResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ order : typing.Optional[OrderEnum3]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ReceivableHistoryCursorFields]
+ Allowed sort fields
+
+ event_type_in : typing.Optional[typing.Union[ReceivableHistoryEventTypeEnum, typing.Sequence[ReceivableHistoryEventTypeEnum]]]
+
+ entity_user_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ timestamp_gt : typing.Optional[dt.datetime]
+
+ timestamp_lt : typing.Optional[dt.datetime]
+
+ timestamp_gte : typing.Optional[dt.datetime]
+
+ timestamp_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableHistoryPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get_history(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/history",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "event_type__in": event_type_in,
+ "entity_user_id__in": entity_user_id_in,
+ "timestamp__gt": serialize_datetime(timestamp_gt) if timestamp_gt is not None else None,
+ "timestamp__lt": serialize_datetime(timestamp_lt) if timestamp_lt is not None else None,
+ "timestamp__gte": serialize_datetime(timestamp_gte) if timestamp_gte is not None else None,
+ "timestamp__lte": serialize_datetime(timestamp_lte) if timestamp_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableHistoryPaginationResponse,
+ parse_obj_as(
+ type_=ReceivableHistoryPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_history_by_id(
+ self, receivable_history_id: str, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableHistoryResponse:
+ """
+ Parameters
+ ----------
+ receivable_history_id : str
+
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableHistoryResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get_history_by_id(
+ receivable_history_id="receivable_history_id",
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/history/{jsonable_encoder(receivable_history_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableHistoryResponse,
+ parse_obj_as(
+ type_=ReceivableHistoryResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def issue_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.issue_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/issue",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_line_items_by_id(
+ self,
+ receivable_id: str,
+ *,
+ data: typing.Sequence[LineItem],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemsResponse:
+ """
+ Replace all line items of an existing invoice or quote with a new list of line items.
+
+ Parameters
+ ----------
+ receivable_id : str
+
+ data : typing.Sequence[LineItem]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemsResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import LineItem, Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.update_line_items_by_id(
+ receivable_id="receivable_id",
+ data=[
+ LineItem(
+ quantity=1.1,
+ )
+ ],
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/line_items",
+ method="PUT",
+ json={
+ "data": convert_and_respect_annotation_metadata(
+ object_=data, annotation=typing.Sequence[LineItem], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemsResponse,
+ parse_obj_as(
+ type_=LineItemsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_mails(
+ self,
+ receivable_id: str,
+ *,
+ order: typing.Optional[OrderEnum3] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ReceivableMailCursorFields] = None,
+ status: typing.Optional[ReceivableMailStatusEnum] = None,
+ status_in: typing.Optional[
+ typing.Union[ReceivableMailStatusEnum, typing.Sequence[ReceivableMailStatusEnum]]
+ ] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableMailPaginationResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ order : typing.Optional[OrderEnum3]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ReceivableMailCursorFields]
+ Allowed sort fields
+
+ status : typing.Optional[ReceivableMailStatusEnum]
+
+ status_in : typing.Optional[typing.Union[ReceivableMailStatusEnum, typing.Sequence[ReceivableMailStatusEnum]]]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableMailPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get_mails(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mails",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "status": status,
+ "status__in": status_in,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableMailPaginationResponse,
+ parse_obj_as(
+ type_=ReceivableMailPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_mail_by_id(
+ self, receivable_id: str, mail_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableMailResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ mail_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableMailResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get_mail_by_id(
+ receivable_id="receivable_id",
+ mail_id="mail_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mails/{jsonable_encoder(mail_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableMailResponse,
+ parse_obj_as(
+ type_=ReceivableMailResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def mark_as_paid_by_id(
+ self,
+ receivable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ paid_at: typing.Optional[dt.datetime] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ comment : typing.Optional[str]
+ Optional comment explaining how the payment was made.
+
+ paid_at : typing.Optional[dt.datetime]
+ Date and time when the invoice was paid.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.mark_as_paid_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mark_as_paid",
+ method="POST",
+ json={
+ "comment": comment,
+ "paid_at": paid_at,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def mark_as_partially_paid_by_id(
+ self,
+ receivable_id: str,
+ *,
+ amount_paid: int,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Deprecated. Use `POST /payment_records` to record an invoice payment.
+
+ Parameters
+ ----------
+ receivable_id : str
+
+ amount_paid : int
+ How much has been paid on the invoice (in minor units).
+
+ comment : typing.Optional[str]
+ Optional comment explaining how the payment was made.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.mark_as_partially_paid_by_id(
+ receivable_id="receivable_id",
+ amount_paid=1,
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mark_as_partially_paid",
+ method="POST",
+ json={
+ "amount_paid": amount_paid,
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def mark_as_uncollectible_by_id(
+ self,
+ receivable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ comment : typing.Optional[str]
+ Optional comment explains why the Invoice goes uncollectible.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.mark_as_uncollectible_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mark_as_uncollectible",
+ method="POST",
+ json={
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_pdf_link_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableFileUrl:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableFileUrl
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.get_pdf_link_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/pdf_link",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableFileUrl,
+ parse_obj_as(
+ type_=ReceivableFileUrl, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def preview_by_id(
+ self,
+ receivable_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ type: typing.Optional[ReceivablesPreviewTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivablePreviewResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ body_text : str
+ Body text of the content
+
+ subject_text : str
+ Subject text of the content
+
+ language : typing.Optional[LanguageCodeEnum]
+ Language code for localization purposes
+
+ type : typing.Optional[ReceivablesPreviewTypeEnum]
+ The type of the preview document.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablePreviewResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.preview_by_id(
+ receivable_id="receivable_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/preview",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "language": language,
+ "subject_text": subject_text,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablePreviewResponse,
+ parse_obj_as(
+ type_=ReceivablePreviewResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def send_by_id(
+ self,
+ receivable_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ language: typing.Optional[str] = OMIT,
+ recipients: typing.Optional[Recipients] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableSendResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ body_text : str
+ Body text of the content
+
+ subject_text : str
+ Subject text of the content
+
+ language : typing.Optional[str]
+ Lowercase ISO code of language
+
+ recipients : typing.Optional[Recipients]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableSendResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.send_by_id(
+ receivable_id="receivable_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/send",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "language": language,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "subject_text": subject_text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableSendResponse,
+ parse_obj_as(
+ type_=ReceivableSendResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def send_test_reminder_by_id(
+ self,
+ receivable_id: str,
+ *,
+ reminder_type: ReminderTypeEnum,
+ recipients: typing.Optional[Recipients] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivablesSendResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ reminder_type : ReminderTypeEnum
+ The type of the reminder to be sent.
+
+ recipients : typing.Optional[Recipients]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablesSendResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.send_test_reminder_by_id(
+ receivable_id="receivable_id",
+ reminder_type="term_1",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/send_test_reminder",
+ method="POST",
+ json={
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "reminder_type": reminder_type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablesSendResponse,
+ parse_obj_as(
+ type_=ReceivablesSendResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def verify_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivablesVerifyResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablesVerifyResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.receivables.verify_by_id(
+ receivable_id="receivable_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/verify",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablesVerifyResponse,
+ parse_obj_as(
+ type_=ReceivablesVerifyResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncReceivablesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum2] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ status_in: typing.Optional[
+ typing.Union[ReceivablesGetRequestStatusInItem, typing.Sequence[ReceivablesGetRequestStatusInItem]]
+ ] = None,
+ entity_user_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ sort: typing.Optional[ReceivableCursorFields] = None,
+ tag_ids_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ type: typing.Optional[ReceivableType] = None,
+ document_id: typing.Optional[str] = None,
+ document_id_contains: typing.Optional[str] = None,
+ document_id_icontains: typing.Optional[str] = None,
+ issue_date_gt: typing.Optional[dt.datetime] = None,
+ issue_date_lt: typing.Optional[dt.datetime] = None,
+ issue_date_gte: typing.Optional[dt.datetime] = None,
+ issue_date_lte: typing.Optional[dt.datetime] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ counterpart_id: typing.Optional[str] = None,
+ counterpart_name: typing.Optional[str] = None,
+ counterpart_name_contains: typing.Optional[str] = None,
+ counterpart_name_icontains: typing.Optional[str] = None,
+ total_amount: typing.Optional[int] = None,
+ total_amount_gt: typing.Optional[int] = None,
+ total_amount_lt: typing.Optional[int] = None,
+ total_amount_gte: typing.Optional[int] = None,
+ total_amount_lte: typing.Optional[int] = None,
+ status: typing.Optional[ReceivablesGetRequestStatus] = None,
+ entity_user_id: typing.Optional[str] = None,
+ based_on: typing.Optional[str] = None,
+ due_date_gt: typing.Optional[str] = None,
+ due_date_lt: typing.Optional[str] = None,
+ due_date_gte: typing.Optional[str] = None,
+ due_date_lte: typing.Optional[str] = None,
+ project_id: typing.Optional[str] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivablePaginationResponse:
+ """
+ Returns a list of [accounts receivable](https://docs.monite.com/accounts-receivable/index) documents - invoices, quotes, and credit notes - of the specified entity.
+
+ Results can be filtered by amount, counterpart, due date, and other criteria. Multiple filters are combined using logical AND unless specified otherwise. If no documents matching the search criteria are found, the endpoint returns a successful response with an empty `data` array.
+
+ This endpoint supports [pagination](https://docs.monite.com/api/concepts/pagination-sorting-filtering) and sorting. By default, results are sorted by the creation date in ascending order (from oldest to newest).
+
+ #### Examples
+
+ ##### Invoices
+
+ - Get all overdue invoices:
+
+ ```
+ GET /receivables?type=invoice&status=overdue
+ ```
+
+ - Get all invoices created for the counterpart named "Solarwind" (case-insensitive):
+
+ ```
+ GET /receivables?type=invoice?counterpart_name__icontains=Solarwind
+ ```
+
+ - Get invoices whose total amount starts from 500 EUR:
+
+ ```
+ GET /receivables?type=invoice&total_amount__gte=50000
+ ```
+
+ - Get invoices that are due for payment in September 2024:
+
+ ```
+ GET /receivables?type=invoice&due_date__gte=2024-09-01T00:00:00Z&due_date__lt=2024-10-01T00:00:00Z
+ ```
+
+ - Get invoices created on or after September 1, 2024:
+
+ ```
+ GET /receivables?type=invoice&created_at__gte=2024-09-01T00:00:00Z
+ ```
+
+ - Find an invoice created from a specific quote:
+
+ ```
+ GET /receivables?type=invoice?based_on=QUOTE_ID
+ ```
+
+ ##### Quotes
+
+ - Get the latest created quote:
+
+ ```
+ GET /receivables?type=quote&sort=created_at&order=desc&limit=1
+ ```
+
+ - Get the latest issued quote:
+
+ ```
+ GET /receivables?type=quote&sort=issue_date&order=desc&limit=1
+ ```
+
+ ##### Credit notes
+
+ - Find all credit notes created for a specific invoice:
+
+ ```
+ GET /receivables?type=credit_note?based_on=INVOICE_ID
+ ```
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum2]
+ Sort order (ascending by default). Typically used together with the `sort` parameter.
+
+ limit : typing.Optional[int]
+ The number of items (0 .. 100) to return in a single page of the response. The response may contain fewer items if it is the last or only page.
+
+ When using pagination with a non-default `limit`, you must provide the `limit` value alongside `pagination_token` in all subsequent pagination requests. Unlike other query parameters, `limit` is not inferred from `pagination_token`.
+
+ pagination_token : typing.Optional[str]
+ A pagination token obtained from a previous call to this endpoint. Use it to get the next or previous page of results for your initial query. If `pagination_token` is specified, all other query parameters except `limit` are ignored and inferred from the initial query.
+
+ If not specified, the first page of results will be returned.
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Return only receivables with the specified IDs. Valid but nonexistent IDs do not raise errors but produce no results.
+
+ To specify multiple IDs, repeat this parameter for each value:
+ `id__in=&id__in=`
+
+ status_in : typing.Optional[typing.Union[ReceivablesGetRequestStatusInItem, typing.Sequence[ReceivablesGetRequestStatusInItem]]]
+ Return only receivables that have the specified statuses. See the applicable [invoice statuses](https://docs.monite.com/accounts-receivable/invoices/index), [quote statuses](https://docs.monite.com/accounts-receivable/quotes/index), and [credit note statuses](https://docs.monite.com/accounts-receivable/credit-notes#credit-note-lifecycle).
+
+ To specify multiple statuses, repeat this parameter for each value:
+ `status__in=draft&status__in=issued`
+
+ entity_user_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Return only receivables created by the entity users with the specified IDs.To specify multiple user IDs, repeat this parameter for each ID:
+ `entity_user_id__in=&entity_user_id__in=`
+
+ If the request is authenticated using an entity user token, this user must have the `receivable.read.allowed` (rather than `allowed_for_own`) permission to be able to query receivables created by other users.
+
+ IDs of deleted users will still produce results here if those users had associated receivables. Valid but nonexistent user IDs do not raise errors but produce no results.
+
+ sort : typing.Optional[ReceivableCursorFields]
+ The field to sort the results by. Typically used together with the `order` parameter.
+
+ tag_ids_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+ Return only receivables whose [tags](https://docs.monite.com/common/tags) include at least one of the tags with the specified IDs.
+
+ For example, given receivables with the following tags:
+
+ 1. tagA
+ 2. tagB
+ 3. tagA, tagB
+ 4. tagC
+ 5. tagB, tagC
+
+ `tag_ids__in=&tag_ids__in=` will return receivables 1, 2, 3, and 5.
+
+ Valid but nonexistent tag IDs do not raise errors but produce no results.
+
+ type : typing.Optional[ReceivableType]
+
+ document_id : typing.Optional[str]
+
+ document_id_contains : typing.Optional[str]
+
+ document_id_icontains : typing.Optional[str]
+
+ issue_date_gt : typing.Optional[dt.datetime]
+
+ issue_date_lt : typing.Optional[dt.datetime]
+
+ issue_date_gte : typing.Optional[dt.datetime]
+
+ issue_date_lte : typing.Optional[dt.datetime]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ counterpart_id : typing.Optional[str]
+
+ counterpart_name : typing.Optional[str]
+
+ counterpart_name_contains : typing.Optional[str]
+
+ counterpart_name_icontains : typing.Optional[str]
+
+ total_amount : typing.Optional[int]
+
+ total_amount_gt : typing.Optional[int]
+
+ total_amount_lt : typing.Optional[int]
+
+ total_amount_gte : typing.Optional[int]
+
+ total_amount_lte : typing.Optional[int]
+
+ status : typing.Optional[ReceivablesGetRequestStatus]
+
+ entity_user_id : typing.Optional[str]
+
+ based_on : typing.Optional[str]
+
+ due_date_gt : typing.Optional[str]
+
+ due_date_lt : typing.Optional[str]
+
+ due_date_gte : typing.Optional[str]
+
+ due_date_lte : typing.Optional[str]
+
+ project_id : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "receivables",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "id__in": id_in,
+ "status__in": status_in,
+ "entity_user_id__in": entity_user_id_in,
+ "sort": sort,
+ "tag_ids__in": tag_ids_in,
+ "type": type,
+ "document_id": document_id,
+ "document_id__contains": document_id_contains,
+ "document_id__icontains": document_id_icontains,
+ "issue_date__gt": serialize_datetime(issue_date_gt) if issue_date_gt is not None else None,
+ "issue_date__lt": serialize_datetime(issue_date_lt) if issue_date_lt is not None else None,
+ "issue_date__gte": serialize_datetime(issue_date_gte) if issue_date_gte is not None else None,
+ "issue_date__lte": serialize_datetime(issue_date_lte) if issue_date_lte is not None else None,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ "counterpart_id": counterpart_id,
+ "counterpart_name": counterpart_name,
+ "counterpart_name__contains": counterpart_name_contains,
+ "counterpart_name__icontains": counterpart_name_icontains,
+ "total_amount": total_amount,
+ "total_amount__gt": total_amount_gt,
+ "total_amount__lt": total_amount_lt,
+ "total_amount__gte": total_amount_gte,
+ "total_amount__lte": total_amount_lte,
+ "status": status,
+ "entity_user_id": entity_user_id,
+ "based_on": based_on,
+ "due_date__gt": due_date_gt,
+ "due_date__lt": due_date_lt,
+ "due_date__gte": due_date_gte,
+ "due_date__lte": due_date_lte,
+ "project_id": project_id,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablePaginationResponse,
+ parse_obj_as(
+ type_=ReceivablePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self, *, request: ReceivableFacadeCreatePayload, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ request : ReceivableFacadeCreatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, LineItem, ReceivableFacadeCreateQuotePayload
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.create(
+ request=ReceivableFacadeCreateQuotePayload(
+ counterpart_billing_address_id="counterpart_billing_address_id",
+ counterpart_id="counterpart_id",
+ currency="AED",
+ line_items=[
+ LineItem(
+ quantity=1.1,
+ )
+ ],
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "receivables",
+ method="POST",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ReceivableFacadeCreatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_variables(
+ self, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableTemplatesVariablesObjectList:
+ """
+ Get a list of placeholders that can be used in email templates for customization.
+
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableTemplatesVariablesObjectList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get_variables()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "receivables/variables",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableTemplatesVariablesObjectList,
+ parse_obj_as(
+ type_=ReceivableTemplatesVariablesObjectList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.delete_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ receivable_id: str,
+ *,
+ request: ReceivableUpdatePayload,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request : ReceivableUpdatePayload
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, UpdateQuote, UpdateQuotePayload
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.update_by_id(
+ receivable_id="receivable_id",
+ request=UpdateQuotePayload(
+ quote=UpdateQuote(),
+ ),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}",
+ method="PATCH",
+ json=convert_and_respect_annotation_metadata(
+ object_=request, annotation=ReceivableUpdatePayload, direction="write"
+ ),
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def accept_by_id(
+ self,
+ receivable_id: str,
+ *,
+ signature: typing.Optional[Signature] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> SuccessResult:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ signature : typing.Optional[Signature]
+ A digital signature, if required for quote acceptance
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SuccessResult
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.accept_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/accept",
+ method="POST",
+ json={
+ "signature": convert_and_respect_annotation_metadata(
+ object_=signature, annotation=Signature, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SuccessResult,
+ parse_obj_as(
+ type_=SuccessResult, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def cancel_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.cancel_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def clone_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.clone_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/clone",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def decline_by_id(
+ self,
+ receivable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> SuccessResult:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ comment : typing.Optional[str]
+ Field with a comment on why the client declined this Quote
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ SuccessResult
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.decline_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/decline",
+ method="POST",
+ json={
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ SuccessResult,
+ parse_obj_as(
+ type_=SuccessResult, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_history(
+ self,
+ receivable_id: str,
+ *,
+ order: typing.Optional[OrderEnum3] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ReceivableHistoryCursorFields] = None,
+ event_type_in: typing.Optional[
+ typing.Union[ReceivableHistoryEventTypeEnum, typing.Sequence[ReceivableHistoryEventTypeEnum]]
+ ] = None,
+ entity_user_id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ timestamp_gt: typing.Optional[dt.datetime] = None,
+ timestamp_lt: typing.Optional[dt.datetime] = None,
+ timestamp_gte: typing.Optional[dt.datetime] = None,
+ timestamp_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableHistoryPaginationResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ order : typing.Optional[OrderEnum3]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ReceivableHistoryCursorFields]
+ Allowed sort fields
+
+ event_type_in : typing.Optional[typing.Union[ReceivableHistoryEventTypeEnum, typing.Sequence[ReceivableHistoryEventTypeEnum]]]
+
+ entity_user_id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ timestamp_gt : typing.Optional[dt.datetime]
+
+ timestamp_lt : typing.Optional[dt.datetime]
+
+ timestamp_gte : typing.Optional[dt.datetime]
+
+ timestamp_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableHistoryPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get_history(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/history",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "event_type__in": event_type_in,
+ "entity_user_id__in": entity_user_id_in,
+ "timestamp__gt": serialize_datetime(timestamp_gt) if timestamp_gt is not None else None,
+ "timestamp__lt": serialize_datetime(timestamp_lt) if timestamp_lt is not None else None,
+ "timestamp__gte": serialize_datetime(timestamp_gte) if timestamp_gte is not None else None,
+ "timestamp__lte": serialize_datetime(timestamp_lte) if timestamp_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableHistoryPaginationResponse,
+ parse_obj_as(
+ type_=ReceivableHistoryPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_history_by_id(
+ self, receivable_history_id: str, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableHistoryResponse:
+ """
+ Parameters
+ ----------
+ receivable_history_id : str
+
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableHistoryResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get_history_by_id(
+ receivable_history_id="receivable_history_id",
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/history/{jsonable_encoder(receivable_history_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableHistoryResponse,
+ parse_obj_as(
+ type_=ReceivableHistoryResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def issue_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.issue_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/issue",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_line_items_by_id(
+ self,
+ receivable_id: str,
+ *,
+ data: typing.Sequence[LineItem],
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> LineItemsResponse:
+ """
+ Replace all line items of an existing invoice or quote with a new list of line items.
+
+ Parameters
+ ----------
+ receivable_id : str
+
+ data : typing.Sequence[LineItem]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ LineItemsResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, LineItem
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.update_line_items_by_id(
+ receivable_id="receivable_id",
+ data=[
+ LineItem(
+ quantity=1.1,
+ )
+ ],
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/line_items",
+ method="PUT",
+ json={
+ "data": convert_and_respect_annotation_metadata(
+ object_=data, annotation=typing.Sequence[LineItem], direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ LineItemsResponse,
+ parse_obj_as(
+ type_=LineItemsResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_mails(
+ self,
+ receivable_id: str,
+ *,
+ order: typing.Optional[OrderEnum3] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[ReceivableMailCursorFields] = None,
+ status: typing.Optional[ReceivableMailStatusEnum] = None,
+ status_in: typing.Optional[
+ typing.Union[ReceivableMailStatusEnum, typing.Sequence[ReceivableMailStatusEnum]]
+ ] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableMailPaginationResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ order : typing.Optional[OrderEnum3]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[ReceivableMailCursorFields]
+ Allowed sort fields
+
+ status : typing.Optional[ReceivableMailStatusEnum]
+
+ status_in : typing.Optional[typing.Union[ReceivableMailStatusEnum, typing.Sequence[ReceivableMailStatusEnum]]]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableMailPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get_mails(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mails",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "status": status,
+ "status__in": status_in,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableMailPaginationResponse,
+ parse_obj_as(
+ type_=ReceivableMailPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_mail_by_id(
+ self, receivable_id: str, mail_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableMailResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ mail_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableMailResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get_mail_by_id(
+ receivable_id="receivable_id",
+ mail_id="mail_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mails/{jsonable_encoder(mail_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableMailResponse,
+ parse_obj_as(
+ type_=ReceivableMailResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def mark_as_paid_by_id(
+ self,
+ receivable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ paid_at: typing.Optional[dt.datetime] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ comment : typing.Optional[str]
+ Optional comment explaining how the payment was made.
+
+ paid_at : typing.Optional[dt.datetime]
+ Date and time when the invoice was paid.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.mark_as_paid_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mark_as_paid",
+ method="POST",
+ json={
+ "comment": comment,
+ "paid_at": paid_at,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def mark_as_partially_paid_by_id(
+ self,
+ receivable_id: str,
+ *,
+ amount_paid: int,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Deprecated. Use `POST /payment_records` to record an invoice payment.
+
+ Parameters
+ ----------
+ receivable_id : str
+
+ amount_paid : int
+ How much has been paid on the invoice (in minor units).
+
+ comment : typing.Optional[str]
+ Optional comment explaining how the payment was made.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.mark_as_partially_paid_by_id(
+ receivable_id="receivable_id",
+ amount_paid=1,
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mark_as_partially_paid",
+ method="POST",
+ json={
+ "amount_paid": amount_paid,
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def mark_as_uncollectible_by_id(
+ self,
+ receivable_id: str,
+ *,
+ comment: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ comment : typing.Optional[str]
+ Optional comment explains why the Invoice goes uncollectible.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.mark_as_uncollectible_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/mark_as_uncollectible",
+ method="POST",
+ json={
+ "comment": comment,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableResponse,
+ parse_obj_as(
+ type_=ReceivableResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_pdf_link_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivableFileUrl:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableFileUrl
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.get_pdf_link_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/pdf_link",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableFileUrl,
+ parse_obj_as(
+ type_=ReceivableFileUrl, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def preview_by_id(
+ self,
+ receivable_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ language: typing.Optional[LanguageCodeEnum] = OMIT,
+ type: typing.Optional[ReceivablesPreviewTypeEnum] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivablePreviewResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ body_text : str
+ Body text of the content
+
+ subject_text : str
+ Subject text of the content
+
+ language : typing.Optional[LanguageCodeEnum]
+ Language code for localization purposes
+
+ type : typing.Optional[ReceivablesPreviewTypeEnum]
+ The type of the preview document.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablePreviewResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.preview_by_id(
+ receivable_id="receivable_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/preview",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "language": language,
+ "subject_text": subject_text,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablePreviewResponse,
+ parse_obj_as(
+ type_=ReceivablePreviewResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def send_by_id(
+ self,
+ receivable_id: str,
+ *,
+ body_text: str,
+ subject_text: str,
+ language: typing.Optional[str] = OMIT,
+ recipients: typing.Optional[Recipients] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivableSendResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ body_text : str
+ Body text of the content
+
+ subject_text : str
+ Subject text of the content
+
+ language : typing.Optional[str]
+ Lowercase ISO code of language
+
+ recipients : typing.Optional[Recipients]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivableSendResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.send_by_id(
+ receivable_id="receivable_id",
+ body_text="body_text",
+ subject_text="subject_text",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/send",
+ method="POST",
+ json={
+ "body_text": body_text,
+ "language": language,
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "subject_text": subject_text,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivableSendResponse,
+ parse_obj_as(
+ type_=ReceivableSendResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def send_test_reminder_by_id(
+ self,
+ receivable_id: str,
+ *,
+ reminder_type: ReminderTypeEnum,
+ recipients: typing.Optional[Recipients] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> ReceivablesSendResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ reminder_type : ReminderTypeEnum
+ The type of the reminder to be sent.
+
+ recipients : typing.Optional[Recipients]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablesSendResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.send_test_reminder_by_id(
+ receivable_id="receivable_id",
+ reminder_type="term_1",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/send_test_reminder",
+ method="POST",
+ json={
+ "recipients": convert_and_respect_annotation_metadata(
+ object_=recipients, annotation=Recipients, direction="write"
+ ),
+ "reminder_type": reminder_type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablesSendResponse,
+ parse_obj_as(
+ type_=ReceivablesSendResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def verify_by_id(
+ self, receivable_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> ReceivablesVerifyResponse:
+ """
+ Parameters
+ ----------
+ receivable_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ ReceivablesVerifyResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.receivables.verify_by_id(
+ receivable_id="receivable_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"receivables/{jsonable_encoder(receivable_id)}/verify",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ ReceivablesVerifyResponse,
+ parse_obj_as(
+ type_=ReceivablesVerifyResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/receivables/types/__init__.py b/src/monite/receivables/types/__init__.py
new file mode 100644
index 0000000..103a070
--- /dev/null
+++ b/src/monite/receivables/types/__init__.py
@@ -0,0 +1,6 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .receivables_get_request_status import ReceivablesGetRequestStatus
+from .receivables_get_request_status_in_item import ReceivablesGetRequestStatusInItem
+
+__all__ = ["ReceivablesGetRequestStatus", "ReceivablesGetRequestStatusInItem"]
diff --git a/src/monite/receivables/types/receivables_get_request_status.py b/src/monite/receivables/types/receivables_get_request_status.py
new file mode 100644
index 0000000..6d0f586
--- /dev/null
+++ b/src/monite/receivables/types/receivables_get_request_status.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivablesGetRequestStatus = typing.Union[
+ typing.Literal[
+ "draft",
+ "issued",
+ "accepted",
+ "expired",
+ "declined",
+ "recurring",
+ "partially_paid",
+ "paid",
+ "overdue",
+ "uncollectible",
+ "canceled",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/receivables/types/receivables_get_request_status_in_item.py b/src/monite/receivables/types/receivables_get_request_status_in_item.py
new file mode 100644
index 0000000..039010b
--- /dev/null
+++ b/src/monite/receivables/types/receivables_get_request_status_in_item.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivablesGetRequestStatusInItem = typing.Union[
+ typing.Literal[
+ "draft",
+ "issued",
+ "accepted",
+ "expired",
+ "declined",
+ "recurring",
+ "partially_paid",
+ "paid",
+ "overdue",
+ "uncollectible",
+ "canceled",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/recurrences/__init__.py b/src/monite/recurrences/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/recurrences/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/recurrences/client.py b/src/monite/recurrences/client.py
new file mode 100644
index 0000000..0942b41
--- /dev/null
+++ b/src/monite/recurrences/client.py
@@ -0,0 +1,1245 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..core.request_options import RequestOptions
+from ..types.get_all_recurrences import GetAllRecurrences
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_found_error import NotFoundError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.day_of_month import DayOfMonth
+from ..types.recurrence import Recurrence
+from ..core.jsonable_encoder import jsonable_encoder
+from ..errors.conflict_error import ConflictError
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class RecurrencesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetAllRecurrences:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetAllRecurrences
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.recurrences.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "recurrences",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ GetAllRecurrences,
+ parse_obj_as(
+ type_=GetAllRecurrences, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ day_of_month: DayOfMonth,
+ end_month: int,
+ end_year: int,
+ invoice_id: str,
+ start_month: int,
+ start_year: int,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> Recurrence:
+ """
+ Parameters
+ ----------
+ day_of_month : DayOfMonth
+
+ end_month : int
+
+ end_year : int
+
+ invoice_id : str
+
+ start_month : int
+
+ start_year : int
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Recurrence
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.recurrences.create(
+ day_of_month="first_day",
+ end_month=1,
+ end_year=1,
+ invoice_id="invoice_id",
+ start_month=1,
+ start_year=1,
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "recurrences",
+ method="POST",
+ json={
+ "day_of_month": day_of_month,
+ "end_month": end_month,
+ "end_year": end_year,
+ "invoice_id": invoice_id,
+ "start_month": start_month,
+ "start_year": start_year,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ Recurrence,
+ parse_obj_as(
+ type_=Recurrence, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, recurrence_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Recurrence:
+ """
+ Parameters
+ ----------
+ recurrence_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Recurrence
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.recurrences.get_by_id(
+ recurrence_id="recurrence_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"recurrences/{jsonable_encoder(recurrence_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ Recurrence,
+ parse_obj_as(
+ type_=Recurrence, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ recurrence_id: str,
+ *,
+ day_of_month: typing.Optional[DayOfMonth] = OMIT,
+ end_month: typing.Optional[int] = OMIT,
+ end_year: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> Recurrence:
+ """
+ Parameters
+ ----------
+ recurrence_id : str
+
+ day_of_month : typing.Optional[DayOfMonth]
+
+ end_month : typing.Optional[int]
+
+ end_year : typing.Optional[int]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Recurrence
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.recurrences.update_by_id(
+ recurrence_id="recurrence_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"recurrences/{jsonable_encoder(recurrence_id)}",
+ method="PATCH",
+ json={
+ "day_of_month": day_of_month,
+ "end_month": end_month,
+ "end_year": end_year,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ Recurrence,
+ parse_obj_as(
+ type_=Recurrence, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def cancel_by_id(self, recurrence_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Parameters
+ ----------
+ recurrence_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.recurrences.cancel_by_id(
+ recurrence_id="recurrence_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"recurrences/{jsonable_encoder(recurrence_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncRecurrencesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> GetAllRecurrences:
+ """
+ Parameters
+ ----------
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ GetAllRecurrences
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.recurrences.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "recurrences",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ GetAllRecurrences,
+ parse_obj_as(
+ type_=GetAllRecurrences, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ day_of_month: DayOfMonth,
+ end_month: int,
+ end_year: int,
+ invoice_id: str,
+ start_month: int,
+ start_year: int,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> Recurrence:
+ """
+ Parameters
+ ----------
+ day_of_month : DayOfMonth
+
+ end_month : int
+
+ end_year : int
+
+ invoice_id : str
+
+ start_month : int
+
+ start_year : int
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Recurrence
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.recurrences.create(
+ day_of_month="first_day",
+ end_month=1,
+ end_year=1,
+ invoice_id="invoice_id",
+ start_month=1,
+ start_year=1,
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "recurrences",
+ method="POST",
+ json={
+ "day_of_month": day_of_month,
+ "end_month": end_month,
+ "end_year": end_year,
+ "invoice_id": invoice_id,
+ "start_month": start_month,
+ "start_year": start_year,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ Recurrence,
+ parse_obj_as(
+ type_=Recurrence, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, recurrence_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> Recurrence:
+ """
+ Parameters
+ ----------
+ recurrence_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Recurrence
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.recurrences.get_by_id(
+ recurrence_id="recurrence_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"recurrences/{jsonable_encoder(recurrence_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ Recurrence,
+ parse_obj_as(
+ type_=Recurrence, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ recurrence_id: str,
+ *,
+ day_of_month: typing.Optional[DayOfMonth] = OMIT,
+ end_month: typing.Optional[int] = OMIT,
+ end_year: typing.Optional[int] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> Recurrence:
+ """
+ Parameters
+ ----------
+ recurrence_id : str
+
+ day_of_month : typing.Optional[DayOfMonth]
+
+ end_month : typing.Optional[int]
+
+ end_year : typing.Optional[int]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ Recurrence
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.recurrences.update_by_id(
+ recurrence_id="recurrence_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"recurrences/{jsonable_encoder(recurrence_id)}",
+ method="PATCH",
+ json={
+ "day_of_month": day_of_month,
+ "end_month": end_month,
+ "end_year": end_year,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ Recurrence,
+ parse_obj_as(
+ type_=Recurrence, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def cancel_by_id(
+ self, recurrence_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ recurrence_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.recurrences.cancel_by_id(
+ recurrence_id="recurrence_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"recurrences/{jsonable_encoder(recurrence_id)}/cancel",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 409:
+ raise ConflictError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/roles/__init__.py b/src/monite/roles/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/roles/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/roles/client.py b/src/monite/roles/client.py
new file mode 100644
index 0000000..e0a4690
--- /dev/null
+++ b/src/monite/roles/client.py
@@ -0,0 +1,919 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.role_cursor_fields import RoleCursorFields
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.role_pagination_response import RolePaginationResponse
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.biz_objects_schema import BizObjectsSchema
+from ..types.role_response import RoleResponse
+from ..core.serialization import convert_and_respect_annotation_metadata
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class RolesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[RoleCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ name: typing.Optional[str] = None,
+ created_at: typing.Optional[dt.datetime] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> RolePaginationResponse:
+ """
+ Find all roles that match the search criteria.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[RoleCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ name : typing.Optional[str]
+
+ created_at : typing.Optional[dt.datetime]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RolePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.roles.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "roles",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "name": name,
+ "created_at": serialize_datetime(created_at) if created_at is not None else None,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RolePaginationResponse,
+ parse_obj_as(
+ type_=RolePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self, *, name: str, permissions: BizObjectsSchema, request_options: typing.Optional[RequestOptions] = None
+ ) -> RoleResponse:
+ """
+ Create a new role from the specified values.
+
+ Parameters
+ ----------
+ name : str
+ Role name
+
+ permissions : BizObjectsSchema
+ Access permissions
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import BizObjectsSchema, Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.roles.create(
+ name="name",
+ permissions=BizObjectsSchema(),
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "roles",
+ method="POST",
+ json={
+ "name": name,
+ "permissions": convert_and_respect_annotation_metadata(
+ object_=permissions, annotation=BizObjectsSchema, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, role_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> RoleResponse:
+ """
+ Parameters
+ ----------
+ role_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.roles.get_by_id(
+ role_id="role_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"roles/{jsonable_encoder(role_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ role_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ permissions: typing.Optional[BizObjectsSchema] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> RoleResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ role_id : str
+
+ name : typing.Optional[str]
+ Role name
+
+ permissions : typing.Optional[BizObjectsSchema]
+ Access permissions
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.roles.update_by_id(
+ role_id="role_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"roles/{jsonable_encoder(role_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "permissions": convert_and_respect_annotation_metadata(
+ object_=permissions, annotation=BizObjectsSchema, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncRolesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[RoleCursorFields] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ name: typing.Optional[str] = None,
+ created_at: typing.Optional[dt.datetime] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> RolePaginationResponse:
+ """
+ Find all roles that match the search criteria.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[RoleCursorFields]
+ Allowed sort fields
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ name : typing.Optional[str]
+
+ created_at : typing.Optional[dt.datetime]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RolePaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.roles.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "roles",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "id__in": id_in,
+ "name": name,
+ "created_at": serialize_datetime(created_at) if created_at is not None else None,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RolePaginationResponse,
+ parse_obj_as(
+ type_=RolePaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self, *, name: str, permissions: BizObjectsSchema, request_options: typing.Optional[RequestOptions] = None
+ ) -> RoleResponse:
+ """
+ Create a new role from the specified values.
+
+ Parameters
+ ----------
+ name : str
+ Role name
+
+ permissions : BizObjectsSchema
+ Access permissions
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite, BizObjectsSchema
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.roles.create(
+ name="name",
+ permissions=BizObjectsSchema(),
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "roles",
+ method="POST",
+ json={
+ "name": name,
+ "permissions": convert_and_respect_annotation_metadata(
+ object_=permissions, annotation=BizObjectsSchema, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(self, role_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> RoleResponse:
+ """
+ Parameters
+ ----------
+ role_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.roles.get_by_id(
+ role_id="role_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"roles/{jsonable_encoder(role_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ role_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ permissions: typing.Optional[BizObjectsSchema] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> RoleResponse:
+ """
+ Change the specified fields with the provided values.
+
+ Parameters
+ ----------
+ role_id : str
+
+ name : typing.Optional[str]
+ Role name
+
+ permissions : typing.Optional[BizObjectsSchema]
+ Access permissions
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ RoleResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.roles.update_by_id(
+ role_id="role_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"roles/{jsonable_encoder(role_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "permissions": convert_and_respect_annotation_metadata(
+ object_=permissions, annotation=BizObjectsSchema, direction="write"
+ ),
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ RoleResponse,
+ parse_obj_as(
+ type_=RoleResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/tags/__init__.py b/src/monite/tags/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/tags/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/tags/client.py b/src/monite/tags/client.py
new file mode 100644
index 0000000..7e02955
--- /dev/null
+++ b/src/monite/tags/client.py
@@ -0,0 +1,1369 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.tag_cursor_fields import TagCursorFields
+from ..core.request_options import RequestOptions
+from ..types.tags_pagination_response import TagsPaginationResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_acceptable_error import NotAcceptableError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.tag_category import TagCategory
+from ..types.tag_read_schema import TagReadSchema
+from ..errors.not_found_error import NotFoundError
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class TagsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[TagCursorFields] = None,
+ created_by_entity_user_id: typing.Optional[str] = None,
+ name_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TagsPaginationResponse:
+ """
+ Get a list of all tags. Tags can be assigned to resources to assist with searching and filtering.
+ Tags can also be used as trigger conditions in payable approval policies.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[TagCursorFields]
+ Allowed sort fields
+
+ created_by_entity_user_id : typing.Optional[str]
+
+ name_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagsPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.tags.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "tags",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_by_entity_user_id": created_by_entity_user_id,
+ "name__in": name_in,
+ "id__in": id_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagsPaginationResponse,
+ parse_obj_as(
+ type_=TagsPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ name: str,
+ category: typing.Optional[TagCategory] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TagReadSchema:
+ """
+ Create a new tag. The tag name must be unique.
+ Tag names are case-sensitive, that is `Marketing` and `marketing` are two different tags.
+
+ The response returns an auto-generated ID assigned to this tag.
+ To assign this tag to a resource, send the tag ID in the `tag_ids` list when creating or updating a resource.
+
+ Parameters
+ ----------
+ name : str
+ The tag name. Must be unique.
+
+ category : typing.Optional[TagCategory]
+ The tag category.
+
+ description : typing.Optional[str]
+ The tag description.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagReadSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.tags.create(
+ name="Marketing",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "tags",
+ method="POST",
+ json={
+ "category": category,
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagReadSchema,
+ parse_obj_as(
+ type_=TagReadSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TagReadSchema:
+ """
+ Get information about a tag with the given ID.
+
+ Parameters
+ ----------
+ tag_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagReadSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.tags.get_by_id(
+ tag_id="tag_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"tags/{jsonable_encoder(tag_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagReadSchema,
+ parse_obj_as(
+ type_=TagReadSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete a tag with the given ID. This tag will be automatically deleted from all resources where it was used.
+
+ Parameters
+ ----------
+ tag_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.tags.delete_by_id(
+ tag_id="tag_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"tags/{jsonable_encoder(tag_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ tag_id: str,
+ *,
+ category: typing.Optional[TagCategory] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TagReadSchema:
+ """
+ Change the tag name. The new name must be unique among existing tags.
+ Tag names are case-sensitive, that is `Marketing` and `marketing` are two different tags.
+
+ Parameters
+ ----------
+ tag_id : str
+
+ category : typing.Optional[TagCategory]
+ The tag category.
+
+ description : typing.Optional[str]
+ The tag description.
+
+ name : typing.Optional[str]
+ The tag name. Must be unique.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagReadSchema
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.tags.update_by_id(
+ tag_id="tag_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"tags/{jsonable_encoder(tag_id)}",
+ method="PATCH",
+ json={
+ "category": category,
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagReadSchema,
+ parse_obj_as(
+ type_=TagReadSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncTagsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[TagCursorFields] = None,
+ created_by_entity_user_id: typing.Optional[str] = None,
+ name_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ id_in: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TagsPaginationResponse:
+ """
+ Get a list of all tags. Tags can be assigned to resources to assist with searching and filtering.
+ Tags can also be used as trigger conditions in payable approval policies.
+
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[TagCursorFields]
+ Allowed sort fields
+
+ created_by_entity_user_id : typing.Optional[str]
+
+ name_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ id_in : typing.Optional[typing.Union[str, typing.Sequence[str]]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagsPaginationResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.tags.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "tags",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "created_by_entity_user_id": created_by_entity_user_id,
+ "name__in": name_in,
+ "id__in": id_in,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagsPaginationResponse,
+ parse_obj_as(
+ type_=TagsPaginationResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ name: str,
+ category: typing.Optional[TagCategory] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TagReadSchema:
+ """
+ Create a new tag. The tag name must be unique.
+ Tag names are case-sensitive, that is `Marketing` and `marketing` are two different tags.
+
+ The response returns an auto-generated ID assigned to this tag.
+ To assign this tag to a resource, send the tag ID in the `tag_ids` list when creating or updating a resource.
+
+ Parameters
+ ----------
+ name : str
+ The tag name. Must be unique.
+
+ category : typing.Optional[TagCategory]
+ The tag category.
+
+ description : typing.Optional[str]
+ The tag description.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagReadSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.tags.create(
+ name="Marketing",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "tags",
+ method="POST",
+ json={
+ "category": category,
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagReadSchema,
+ parse_obj_as(
+ type_=TagReadSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> TagReadSchema:
+ """
+ Get information about a tag with the given ID.
+
+ Parameters
+ ----------
+ tag_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagReadSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.tags.get_by_id(
+ tag_id="tag_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"tags/{jsonable_encoder(tag_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagReadSchema,
+ parse_obj_as(
+ type_=TagReadSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(self, tag_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete a tag with the given ID. This tag will be automatically deleted from all resources where it was used.
+
+ Parameters
+ ----------
+ tag_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.tags.delete_by_id(
+ tag_id="tag_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"tags/{jsonable_encoder(tag_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ tag_id: str,
+ *,
+ category: typing.Optional[TagCategory] = OMIT,
+ description: typing.Optional[str] = OMIT,
+ name: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TagReadSchema:
+ """
+ Change the tag name. The new name must be unique among existing tags.
+ Tag names are case-sensitive, that is `Marketing` and `marketing` are two different tags.
+
+ Parameters
+ ----------
+ tag_id : str
+
+ category : typing.Optional[TagCategory]
+ The tag category.
+
+ description : typing.Optional[str]
+ The tag description.
+
+ name : typing.Optional[str]
+ The tag name. Must be unique.
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TagReadSchema
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.tags.update_by_id(
+ tag_id="tag_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"tags/{jsonable_encoder(tag_id)}",
+ method="PATCH",
+ json={
+ "category": category,
+ "description": description,
+ "name": name,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TagReadSchema,
+ parse_obj_as(
+ type_=TagReadSchema, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 406:
+ raise NotAcceptableError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/text_templates/__init__.py b/src/monite/text_templates/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/text_templates/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/text_templates/client.py b/src/monite/text_templates/client.py
new file mode 100644
index 0000000..2be0112
--- /dev/null
+++ b/src/monite/text_templates/client.py
@@ -0,0 +1,1005 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.text_template_type import TextTemplateType
+from ..types.document_type_enum import DocumentTypeEnum
+from ..core.request_options import RequestOptions
+from ..types.text_template_response_list import TextTemplateResponseList
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.text_template_response import TextTemplateResponse
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class TextTemplatesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ type: typing.Optional[TextTemplateType] = None,
+ document_type: typing.Optional[DocumentTypeEnum] = None,
+ is_default: typing.Optional[bool] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TextTemplateResponseList:
+ """
+ Get text templates
+
+ Parameters
+ ----------
+ type : typing.Optional[TextTemplateType]
+
+ document_type : typing.Optional[DocumentTypeEnum]
+
+ is_default : typing.Optional[bool]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponseList
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.text_templates.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "text_templates",
+ method="GET",
+ params={
+ "type": type,
+ "document_type": document_type,
+ "is_default": is_default,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponseList,
+ parse_obj_as(
+ type_=TextTemplateResponseList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ document_type: DocumentTypeEnum,
+ name: str,
+ template: str,
+ type: TextTemplateType,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TextTemplateResponse:
+ """
+ Create a text template
+
+ Parameters
+ ----------
+ document_type : DocumentTypeEnum
+
+ name : str
+
+ template : str
+
+ type : TextTemplateType
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.text_templates.create(
+ document_type="quote",
+ name="name",
+ template="template",
+ type="email_header",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "text_templates",
+ method="POST",
+ json={
+ "document_type": document_type,
+ "name": name,
+ "template": template,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, text_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TextTemplateResponse:
+ """
+ Get all custom contents
+
+ Parameters
+ ----------
+ text_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.text_templates.get_by_id(
+ text_template_id="text_template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(self, text_template_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
+ """
+ Delete custom content by ID
+
+ Parameters
+ ----------
+ text_template_id : str
+ UUID text_template ID
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.text_templates.delete_by_id(
+ text_template_id="text_template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ text_template_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ template: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TextTemplateResponse:
+ """
+ Update custom content by ID
+
+ Parameters
+ ----------
+ text_template_id : str
+ UUID text_template ID
+
+ name : typing.Optional[str]
+
+ template : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.text_templates.update_by_id(
+ text_template_id="text_template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "template": template,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def make_default_by_id(
+ self, text_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TextTemplateResponse:
+ """
+ Make text template default
+
+ Parameters
+ ----------
+ text_template_id : str
+ UUID text_template ID
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.text_templates.make_default_by_id(
+ text_template_id="text_template_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncTextTemplatesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ type: typing.Optional[TextTemplateType] = None,
+ document_type: typing.Optional[DocumentTypeEnum] = None,
+ is_default: typing.Optional[bool] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TextTemplateResponseList:
+ """
+ Get text templates
+
+ Parameters
+ ----------
+ type : typing.Optional[TextTemplateType]
+
+ document_type : typing.Optional[DocumentTypeEnum]
+
+ is_default : typing.Optional[bool]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponseList
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.text_templates.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "text_templates",
+ method="GET",
+ params={
+ "type": type,
+ "document_type": document_type,
+ "is_default": is_default,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponseList,
+ parse_obj_as(
+ type_=TextTemplateResponseList, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ document_type: DocumentTypeEnum,
+ name: str,
+ template: str,
+ type: TextTemplateType,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TextTemplateResponse:
+ """
+ Create a text template
+
+ Parameters
+ ----------
+ document_type : DocumentTypeEnum
+
+ name : str
+
+ template : str
+
+ type : TextTemplateType
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.text_templates.create(
+ document_type="quote",
+ name="name",
+ template="template",
+ type="email_header",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "text_templates",
+ method="POST",
+ json={
+ "document_type": document_type,
+ "name": name,
+ "template": template,
+ "type": type,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, text_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TextTemplateResponse:
+ """
+ Get all custom contents
+
+ Parameters
+ ----------
+ text_template_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.text_templates.get_by_id(
+ text_template_id="text_template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, text_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Delete custom content by ID
+
+ Parameters
+ ----------
+ text_template_id : str
+ UUID text_template ID
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.text_templates.delete_by_id(
+ text_template_id="text_template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ text_template_id: str,
+ *,
+ name: typing.Optional[str] = OMIT,
+ template: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> TextTemplateResponse:
+ """
+ Update custom content by ID
+
+ Parameters
+ ----------
+ text_template_id : str
+ UUID text_template ID
+
+ name : typing.Optional[str]
+
+ template : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.text_templates.update_by_id(
+ text_template_id="text_template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}",
+ method="PATCH",
+ json={
+ "name": name,
+ "template": template,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def make_default_by_id(
+ self, text_template_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> TextTemplateResponse:
+ """
+ Make text template default
+
+ Parameters
+ ----------
+ text_template_id : str
+ UUID text_template ID
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ TextTemplateResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.text_templates.make_default_by_id(
+ text_template_id="text_template_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"text_templates/{jsonable_encoder(text_template_id)}/make_default",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ TextTemplateResponse,
+ parse_obj_as(
+ type_=TextTemplateResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/types/__init__.py b/src/monite/types/__init__.py
new file mode 100644
index 0000000..4791ae1
--- /dev/null
+++ b/src/monite/types/__init__.py
@@ -0,0 +1,1149 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from .access_token_response import AccessTokenResponse
+from .account_disabled_reason import AccountDisabledReason
+from .account_response import AccountResponse
+from .accounting_connection_list import AccountingConnectionList
+from .accounting_connection_response import AccountingConnectionResponse
+from .accounting_customer_ref_object import AccountingCustomerRefObject
+from .accounting_line_item import AccountingLineItem
+from .accounting_message_response import AccountingMessageResponse
+from .accounting_payable import AccountingPayable
+from .accounting_payable_due_date import AccountingPayableDueDate
+from .accounting_payable_list import AccountingPayableList
+from .accounting_purchase_order_ref import AccountingPurchaseOrderRef
+from .accounting_receivable import AccountingReceivable
+from .accounting_receivable_due_date import AccountingReceivableDueDate
+from .accounting_receivable_list import AccountingReceivableList
+from .accounting_ref_object import AccountingRefObject
+from .accounting_settings_payload import AccountingSettingsPayload
+from .accounting_settings_response import AccountingSettingsResponse
+from .accounting_tax_rate_list_response import AccountingTaxRateListResponse
+from .accounting_tax_rate_response import AccountingTaxRateResponse
+from .accounting_vendor_ref_object import AccountingVendorRefObject
+from .action_enum import ActionEnum
+from .action_schema import ActionSchema
+from .airwallex_mandate import AirwallexMandate
+from .airwallex_mandate_type import AirwallexMandateType
+from .airwallex_mandate_version import AirwallexMandateVersion
+from .airwallex_plaid_account import AirwallexPlaidAccount
+from .airwallex_plaid_bank_account_verification_status import AirwallexPlaidBankAccountVerificationStatus
+from .airwallex_plaid_institution import AirwallexPlaidInstitution
+from .airwallex_plaid_verification import AirwallexPlaidVerification
+from .all_document_export_response_schema import AllDocumentExportResponseSchema
+from .all_overdue_reminders_response import AllOverdueRemindersResponse
+from .allowed_countries import AllowedCountries
+from .allowed_file_types import AllowedFileTypes
+from .api_version import ApiVersion
+from .approval_policy_cursor_fields import ApprovalPolicyCursorFields
+from .approval_policy_resource import ApprovalPolicyResource
+from .approval_policy_resource_list import ApprovalPolicyResourceList
+from .approval_policy_resource_script_item import ApprovalPolicyResourceScriptItem
+from .approval_policy_resource_status import ApprovalPolicyResourceStatus
+from .approval_policy_resource_trigger import ApprovalPolicyResourceTrigger
+from .approval_policy_status import ApprovalPolicyStatus
+from .approval_process_resource_list import ApprovalProcessResourceList
+from .approval_process_step_resource import ApprovalProcessStepResource
+from .approval_process_step_resource_list import ApprovalProcessStepResourceList
+from .approval_process_step_status import ApprovalProcessStepStatus
+from .approval_request_create_by_role_request import ApprovalRequestCreateByRoleRequest
+from .approval_request_create_by_user_request import ApprovalRequestCreateByUserRequest
+from .approval_request_create_request import ApprovalRequestCreateRequest
+from .approval_request_cursor_fields import ApprovalRequestCursorFields
+from .approval_request_resource_list import ApprovalRequestResourceList
+from .approval_request_resource_with_metadata import ApprovalRequestResourceWithMetadata
+from .approval_request_status import ApprovalRequestStatus
+from .bank_account import BankAccount
+from .bank_account_verification_type import BankAccountVerificationType
+from .bank_account_verifications import BankAccountVerifications
+from .based_on_receivable_created_event_data import BasedOnReceivableCreatedEventData
+from .based_on_transition_type import BasedOnTransitionType
+from .biz_objects_schema import BizObjectsSchema
+from .business_profile import BusinessProfile
+from .button_theme_payload import ButtonThemePayload
+from .button_theme_response import ButtonThemeResponse
+from .card_theme_payload import CardThemePayload
+from .card_theme_response import CardThemeResponse
+from .comment_cursor_fields import CommentCursorFields
+from .comment_resource import CommentResource
+from .comment_resource_list import CommentResourceList
+from .common_schema import CommonSchema
+from .complete_refresh_verification_response import CompleteRefreshVerificationResponse
+from .complete_verification_airwallex_plaid_request import CompleteVerificationAirwallexPlaidRequest
+from .complete_verification_response import CompleteVerificationResponse
+from .connection_status import ConnectionStatus
+from .counterpart_address import CounterpartAddress
+from .counterpart_address_resource_list import CounterpartAddressResourceList
+from .counterpart_address_response_with_counterpart_id import CounterpartAddressResponseWithCounterpartId
+from .counterpart_bank_account_resource_list import CounterpartBankAccountResourceList
+from .counterpart_bank_account_response import CounterpartBankAccountResponse
+from .counterpart_contact_response import CounterpartContactResponse
+from .counterpart_contacts_resource_list import CounterpartContactsResourceList
+from .counterpart_create_payload import (
+ CounterpartCreatePayload,
+ CounterpartCreatePayload_Individual,
+ CounterpartCreatePayload_Organization,
+)
+from .counterpart_cursor_fields import CounterpartCursorFields
+from .counterpart_individual_create_payload import CounterpartIndividualCreatePayload
+from .counterpart_individual_response import CounterpartIndividualResponse
+from .counterpart_individual_root_create_payload import CounterpartIndividualRootCreatePayload
+from .counterpart_individual_root_response import CounterpartIndividualRootResponse
+from .counterpart_individual_root_update_payload import CounterpartIndividualRootUpdatePayload
+from .counterpart_individual_update_payload import CounterpartIndividualUpdatePayload
+from .counterpart_organization_create_payload import CounterpartOrganizationCreatePayload
+from .counterpart_organization_response import CounterpartOrganizationResponse
+from .counterpart_organization_root_create_payload import CounterpartOrganizationRootCreatePayload
+from .counterpart_organization_root_response import CounterpartOrganizationRootResponse
+from .counterpart_organization_root_update_payload import CounterpartOrganizationRootUpdatePayload
+from .counterpart_organization_update_payload import CounterpartOrganizationUpdatePayload
+from .counterpart_pagination_response import CounterpartPaginationResponse
+from .counterpart_raw_address import CounterpartRawAddress
+from .counterpart_raw_address_update_request import CounterpartRawAddressUpdateRequest
+from .counterpart_raw_bank_account import CounterpartRawBankAccount
+from .counterpart_raw_bank_account_update_request import CounterpartRawBankAccountUpdateRequest
+from .counterpart_raw_data import CounterpartRawData
+from .counterpart_raw_data_update_request import CounterpartRawDataUpdateRequest
+from .counterpart_raw_vat_id import CounterpartRawVatId
+from .counterpart_raw_vat_id_update_request import CounterpartRawVatIdUpdateRequest
+from .counterpart_response import CounterpartResponse
+from .counterpart_tag_category import CounterpartTagCategory
+from .counterpart_tag_schema import CounterpartTagSchema
+from .counterpart_type import CounterpartType
+from .counterpart_update_payload import CounterpartUpdatePayload
+from .counterpart_vat_id_resource_list import CounterpartVatIdResourceList
+from .counterpart_vat_id_response import CounterpartVatIdResponse
+from .create_export_task_response_schema import CreateExportTaskResponseSchema
+from .create_onboarding_link_request import CreateOnboardingLinkRequest
+from .credit_note_response_payload import CreditNoteResponsePayload
+from .credit_note_response_payload_entity import (
+ CreditNoteResponsePayloadEntity,
+ CreditNoteResponsePayloadEntity_Individual,
+ CreditNoteResponsePayloadEntity_Organization,
+)
+from .credit_note_state_enum import CreditNoteStateEnum
+from .currency_enum import CurrencyEnum
+from .currency_exchange_schema import CurrencyExchangeSchema
+from .currency_settings import CurrencySettings
+from .custom_template_data_schema import CustomTemplateDataSchema
+from .custom_templates_cursor_fields import CustomTemplatesCursorFields
+from .custom_templates_pagination_response import CustomTemplatesPaginationResponse
+from .data_export_cursor_fields import DataExportCursorFields
+from .day_of_month import DayOfMonth
+from .discount import Discount
+from .discount_type import DiscountType
+from .dns_record import DnsRecord
+from .dns_record_purpose import DnsRecordPurpose
+from .dns_record_type import DnsRecordType
+from .dns_records import DnsRecords
+from .document_export_response_schema import DocumentExportResponseSchema
+from .document_i_ds_settings import DocumentIDsSettings
+from .document_i_ds_settings_next_number import DocumentIDsSettingsNextNumber
+from .document_i_ds_settings_request import DocumentIDsSettingsRequest
+from .document_id_separators import DocumentIdSeparators
+from .document_object_type_request_enum import DocumentObjectTypeRequestEnum
+from .document_type_enum import DocumentTypeEnum
+from .document_type_prefix import DocumentTypePrefix
+from .domain_list_response import DomainListResponse
+from .domain_response import DomainResponse
+from .domain_response_dns_records import DomainResponseDnsRecords
+from .e_invoicing_provider_enum import EInvoicingProviderEnum
+from .e_invoicing_settings_payload import EInvoicingSettingsPayload
+from .e_invoicing_settings_response import EInvoicingSettingsResponse
+from .entity_address_response_schema import EntityAddressResponseSchema
+from .entity_address_schema import EntityAddressSchema
+from .entity_bank_account_pagination_response import EntityBankAccountPaginationResponse
+from .entity_bank_account_response import EntityBankAccountResponse
+from .entity_business_structure import EntityBusinessStructure
+from .entity_cursor_fields import EntityCursorFields
+from .entity_individual_response import EntityIndividualResponse
+from .entity_onboarding_data_response import EntityOnboardingDataResponse
+from .entity_onboarding_documents import EntityOnboardingDocuments
+from .entity_organization_response import EntityOrganizationResponse
+from .entity_pagination_response import EntityPaginationResponse
+from .entity_response import EntityResponse, EntityResponse_Individual, EntityResponse_Organization
+from .entity_type_enum import EntityTypeEnum
+from .entity_user_cursor_fields import EntityUserCursorFields
+from .entity_user_pagination_response import EntityUserPaginationResponse
+from .entity_user_response import EntityUserResponse
+from .entity_vat_id_resource_list import EntityVatIdResourceList
+from .entity_vat_id_response import EntityVatIdResponse
+from .error_schema import ErrorSchema
+from .error_schema_response import ErrorSchemaResponse
+from .estimated_monthly_revenue import EstimatedMonthlyRevenue
+from .event_cursor_fields import EventCursorFields
+from .event_pagination_resource import EventPaginationResource
+from .event_resource import EventResource
+from .event_resource_for_webhook_client import EventResourceForWebhookClient
+from .exchange_rate import ExchangeRate
+from .export_format import ExportFormat
+from .export_object_schema import ExportObjectSchema, ExportObjectSchema_Payable, ExportObjectSchema_Receivable
+from .export_payable_schema import ExportPayableSchema
+from .export_receivable_schema import ExportReceivableSchema
+from .export_setting_cursor_fields import ExportSettingCursorFields
+from .extra_data_resource import ExtraDataResource
+from .extra_data_resource_list import ExtraDataResourceList
+from .file_response import FileResponse
+from .file_schema import FileSchema
+from .file_schema2 import FileSchema2
+from .file_schema3 import FileSchema3
+from .file_schema4 import FileSchema4
+from .files_response import FilesResponse
+from .get_all_payment_reminders import GetAllPaymentReminders
+from .get_all_recurrences import GetAllRecurrences
+from .get_onboarding_requirements_response import GetOnboardingRequirementsResponse
+from .grant_type import GrantType
+from .http_validation_error import HttpValidationError
+from .individual_response_schema import IndividualResponseSchema
+from .individual_schema import IndividualSchema
+from .invoice import Invoice
+from .invoice_file import InvoiceFile
+from .invoice_response_payload import InvoiceResponsePayload
+from .invoice_response_payload_entity import (
+ InvoiceResponsePayloadEntity,
+ InvoiceResponsePayloadEntity_Individual,
+ InvoiceResponsePayloadEntity_Organization,
+)
+from .item import Item
+from .iteration_status import IterationStatus
+from .label_n_value import LabelNValue
+from .language_code_enum import LanguageCodeEnum
+from .ledger_account_cursor_fields import LedgerAccountCursorFields
+from .ledger_account_list_response import LedgerAccountListResponse
+from .ledger_account_response import LedgerAccountResponse
+from .line_item import LineItem
+from .line_item_cursor_fields import LineItemCursorFields
+from .line_item_internal_request import LineItemInternalRequest
+from .line_item_pagination_response import LineItemPaginationResponse
+from .line_item_product import LineItemProduct
+from .line_item_product_create import LineItemProductCreate
+from .line_item_product_measure_unit import LineItemProductMeasureUnit
+from .line_item_product_vat_rate import LineItemProductVatRate
+from .line_item_request import LineItemRequest
+from .line_item_response import LineItemResponse
+from .line_item_update import LineItemUpdate
+from .line_items_replace_response import LineItemsReplaceResponse
+from .line_items_response import LineItemsResponse
+from .log_method_enum import LogMethodEnum
+from .log_response import LogResponse
+from .log_response_body import LogResponseBody
+from .log_type_enum import LogTypeEnum
+from .logs_response import LogsResponse
+from .mail_sent_event_data import MailSentEventData
+from .mail_settings_payload import MailSettingsPayload
+from .mail_settings_response import MailSettingsResponse
+from .mailbox_data_response import MailboxDataResponse
+from .mailbox_object_type_enum import MailboxObjectTypeEnum
+from .mailbox_response import MailboxResponse
+from .merged_settings_response import MergedSettingsResponse
+from .message_response import MessageResponse
+from .missing_fields import MissingFields
+from .missing_line_item_fields import MissingLineItemFields
+from .monite_all_payment_methods import MoniteAllPaymentMethods
+from .monite_all_payment_methods_types import MoniteAllPaymentMethodsTypes
+from .object_match_types import ObjectMatchTypes
+from .object_type import ObjectType
+from .object_type_available_comment import ObjectTypeAvailableComment
+from .object_type_enum import ObjectTypeEnum
+from .ocr_address import OcrAddress
+from .ocr_auto_tagging_settings_request import OcrAutoTaggingSettingsRequest
+from .ocr_recognition_response import OcrRecognitionResponse
+from .ocr_response_invoice_receipt_data import OcrResponseInvoiceReceiptData
+from .ocr_response_invoice_receipt_line_item import OcrResponseInvoiceReceiptLineItem
+from .ocr_response_invoice_receipt_line_item_raw import OcrResponseInvoiceReceiptLineItemRaw
+from .ocr_status_enum import OcrStatusEnum
+from .onboarding_link_public_response import OnboardingLinkPublicResponse
+from .onboarding_link_response import OnboardingLinkResponse
+from .onboarding_payment_methods_response import OnboardingPaymentMethodsResponse
+from .onboarding_requirements_error import OnboardingRequirementsError
+from .onboarding_requirements_response import OnboardingRequirementsResponse
+from .onboarding_verification_error import OnboardingVerificationError
+from .onboarding_verification_status_enum import OnboardingVerificationStatusEnum
+from .optional_individual_schema import OptionalIndividualSchema
+from .optional_organization_schema import OptionalOrganizationSchema
+from .optional_person_address_request import OptionalPersonAddressRequest
+from .optional_person_relationship import OptionalPersonRelationship
+from .order_enum import OrderEnum
+from .order_enum2 import OrderEnum2
+from .order_enum3 import OrderEnum3
+from .organization_response_schema import OrganizationResponseSchema
+from .organization_schema import OrganizationSchema
+from .overdue_reminder_response import OverdueReminderResponse
+from .overdue_reminder_term import OverdueReminderTerm
+from .ownership_declaration import OwnershipDeclaration
+from .page_schema import PageSchema
+from .page_schema2 import PageSchema2
+from .page_schema3 import PageSchema3
+from .page_schema4 import PageSchema4
+from .partner_metadata import PartnerMetadata
+from .partner_metadata_response import PartnerMetadataResponse
+from .partner_project_settings_response import PartnerProjectSettingsResponse
+from .payable_action_enum import PayableActionEnum
+from .payable_action_schema import PayableActionSchema
+from .payable_aggregated_data_response import PayableAggregatedDataResponse
+from .payable_aggregated_item import PayableAggregatedItem
+from .payable_cursor_fields import PayableCursorFields
+from .payable_entity_address_schema import PayableEntityAddressSchema
+from .payable_entity_individual_response import PayableEntityIndividualResponse
+from .payable_entity_organization_response import PayableEntityOrganizationResponse
+from .payable_individual_schema import PayableIndividualSchema
+from .payable_organization_schema import PayableOrganizationSchema
+from .payable_origin_enum import PayableOriginEnum
+from .payable_pagination_response import PayablePaginationResponse
+from .payable_payment_term_discount import PayablePaymentTermDiscount
+from .payable_payment_term_final import PayablePaymentTermFinal
+from .payable_payment_terms_create_payload import PayablePaymentTermsCreatePayload
+from .payable_response_schema import PayableResponseSchema
+from .payable_response_schema_other_extracted_data import PayableResponseSchemaOtherExtractedData
+from .payable_schema import PayableSchema
+from .payable_settings_payload import PayableSettingsPayload
+from .payable_settings_response import PayableSettingsResponse
+from .payable_state_enum import PayableStateEnum
+from .payable_templates_variable import PayableTemplatesVariable
+from .payable_templates_variables_object import PayableTemplatesVariablesObject
+from .payable_templates_variables_object_list import PayableTemplatesVariablesObjectList
+from .payable_validation_response import PayableValidationResponse
+from .payable_validations_resource import PayableValidationsResource
+from .payables_fields_allowed_for_validate import PayablesFieldsAllowedForValidate
+from .payables_variable_type import PayablesVariableType
+from .payment_account_object import PaymentAccountObject
+from .payment_account_type import PaymentAccountType
+from .payment_intent import PaymentIntent
+from .payment_intent_cursor_fields import PaymentIntentCursorFields
+from .payment_intent_history import PaymentIntentHistory
+from .payment_intent_history_response import PaymentIntentHistoryResponse
+from .payment_intent_payout_method import PaymentIntentPayoutMethod
+from .payment_intent_response import PaymentIntentResponse
+from .payment_intents_list_response import PaymentIntentsListResponse
+from .payment_intents_recipient import PaymentIntentsRecipient
+from .payment_method import PaymentMethod
+from .payment_method_direction import PaymentMethodDirection
+from .payment_method_requirements import PaymentMethodRequirements
+from .payment_method_status import PaymentMethodStatus
+from .payment_object import PaymentObject
+from .payment_object_payable import PaymentObjectPayable
+from .payment_object_type import PaymentObjectType
+from .payment_page_theme_payload import PaymentPageThemePayload
+from .payment_page_theme_response import PaymentPageThemeResponse
+from .payment_priority_enum import PaymentPriorityEnum
+from .payment_received_event_data import PaymentReceivedEventData
+from .payment_record_cursor_fields import PaymentRecordCursorFields
+from .payment_record_object_request import PaymentRecordObjectRequest
+from .payment_record_object_response import PaymentRecordObjectResponse
+from .payment_record_response import PaymentRecordResponse
+from .payment_record_response_list import PaymentRecordResponseList
+from .payment_reminder_response import PaymentReminderResponse
+from .payment_requirements import PaymentRequirements
+from .payment_term import PaymentTerm
+from .payment_term_discount import PaymentTermDiscount
+from .payment_term_discount_with_date import PaymentTermDiscountWithDate
+from .payment_terms import PaymentTerms
+from .payment_terms_list_response import PaymentTermsListResponse
+from .payment_terms_response import PaymentTermsResponse
+from .payments_batch_payment_response import PaymentsBatchPaymentResponse
+from .payments_batch_payment_status import PaymentsBatchPaymentStatus
+from .payments_settings_payload import PaymentsSettingsPayload
+from .payments_settings_response import PaymentsSettingsResponse
+from .permission_enum import PermissionEnum
+from .person_address_request import PersonAddressRequest
+from .person_address_response import PersonAddressResponse
+from .person_onboarding_documents import PersonOnboardingDocuments
+from .person_relationship_request import PersonRelationshipRequest
+from .person_relationship_response import PersonRelationshipResponse
+from .person_response import PersonResponse
+from .persons_response import PersonsResponse
+from .platform import Platform
+from .preview_schema import PreviewSchema
+from .preview_schema2 import PreviewSchema2
+from .preview_schema3 import PreviewSchema3
+from .preview_schema4 import PreviewSchema4
+from .preview_template_response import PreviewTemplateResponse
+from .price import Price
+from .process_resource import ProcessResource
+from .process_resource_script_snapshot import ProcessResourceScriptSnapshot
+from .process_status_enum import ProcessStatusEnum
+from .product_cursor_fields import ProductCursorFields
+from .product_service_pagination_response import ProductServicePaginationResponse
+from .product_service_response import ProductServiceResponse
+from .product_service_type_enum import ProductServiceTypeEnum
+from .project_cursor_fields import ProjectCursorFields
+from .project_pagination_response import ProjectPaginationResponse
+from .project_resource import ProjectResource
+from .public_payment_link_response import PublicPaymentLinkResponse
+from .purchase_order_counterpart_address_schema import PurchaseOrderCounterpartAddressSchema
+from .purchase_order_counterpart_individual_response import PurchaseOrderCounterpartIndividualResponse
+from .purchase_order_counterpart_individual_root_response import PurchaseOrderCounterpartIndividualRootResponse
+from .purchase_order_counterpart_organization_response import PurchaseOrderCounterpartOrganizationResponse
+from .purchase_order_counterpart_organization_root_response import PurchaseOrderCounterpartOrganizationRootResponse
+from .purchase_order_counterpart_schema import PurchaseOrderCounterpartSchema
+from .purchase_order_cursor_fields import PurchaseOrderCursorFields
+from .purchase_order_email_preview_response import PurchaseOrderEmailPreviewResponse
+from .purchase_order_email_sent_response import PurchaseOrderEmailSentResponse
+from .purchase_order_item import PurchaseOrderItem
+from .purchase_order_pagination_response import PurchaseOrderPaginationResponse
+from .purchase_order_response_schema import PurchaseOrderResponseSchema
+from .purchase_order_response_schema_entity import PurchaseOrderResponseSchemaEntity
+from .purchase_order_status_enum import PurchaseOrderStatusEnum
+from .purchase_order_vat_id import PurchaseOrderVatId
+from .quote_response_payload import QuoteResponsePayload
+from .quote_response_payload_entity import (
+ QuoteResponsePayloadEntity,
+ QuoteResponsePayloadEntity_Individual,
+ QuoteResponsePayloadEntity_Organization,
+)
+from .quote_state_enum import QuoteStateEnum
+from .receivable_counterpart_contact import ReceivableCounterpartContact
+from .receivable_counterpart_type import ReceivableCounterpartType
+from .receivable_counterpart_vat_id_response import ReceivableCounterpartVatIdResponse
+from .receivable_create_based_on_payload import ReceivableCreateBasedOnPayload
+from .receivable_cursor_fields import ReceivableCursorFields
+from .receivable_edit_flow import ReceivableEditFlow
+from .receivable_entity_address_schema import ReceivableEntityAddressSchema
+from .receivable_entity_base import ReceivableEntityBase
+from .receivable_entity_individual import ReceivableEntityIndividual
+from .receivable_entity_individual_request import ReceivableEntityIndividualRequest
+from .receivable_entity_organization import ReceivableEntityOrganization
+from .receivable_entity_organization_request import ReceivableEntityOrganizationRequest
+from .receivable_entity_vat_id_response import ReceivableEntityVatIdResponse
+from .receivable_facade_create_invoice_payload import ReceivableFacadeCreateInvoicePayload
+from .receivable_facade_create_payload import ReceivableFacadeCreatePayload
+from .receivable_facade_create_quote_payload import ReceivableFacadeCreateQuotePayload
+from .receivable_file_schema import ReceivableFileSchema
+from .receivable_file_url import ReceivableFileUrl
+from .receivable_history_cursor_fields import ReceivableHistoryCursorFields
+from .receivable_history_event_type_enum import ReceivableHistoryEventTypeEnum
+from .receivable_history_pagination_response import ReceivableHistoryPaginationResponse
+from .receivable_history_response import ReceivableHistoryResponse
+from .receivable_history_response_event_data import ReceivableHistoryResponseEventData
+from .receivable_mail_cursor_fields import ReceivableMailCursorFields
+from .receivable_mail_pagination_response import ReceivableMailPaginationResponse
+from .receivable_mail_recipient_state import ReceivableMailRecipientState
+from .receivable_mail_recipients import ReceivableMailRecipients
+from .receivable_mail_response import ReceivableMailResponse
+from .receivable_mail_status_enum import ReceivableMailStatusEnum
+from .receivable_page_schema import ReceivablePageSchema
+from .receivable_pagination_response import ReceivablePaginationResponse
+from .receivable_preview_response import ReceivablePreviewResponse
+from .receivable_preview_schema import ReceivablePreviewSchema
+from .receivable_response import (
+ ReceivableResponse,
+ ReceivableResponse_CreditNote,
+ ReceivableResponse_Invoice,
+ ReceivableResponse_Quote,
+)
+from .receivable_send_response import ReceivableSendResponse
+from .receivable_settings_payload import ReceivableSettingsPayload
+from .receivable_settings_response import ReceivableSettingsResponse
+from .receivable_templates_variable import ReceivableTemplatesVariable
+from .receivable_templates_variables_object import ReceivableTemplatesVariablesObject
+from .receivable_templates_variables_object_list import ReceivableTemplatesVariablesObjectList
+from .receivable_type import ReceivableType
+from .receivable_update_payload import ReceivableUpdatePayload
+from .receivable_updated_event_data import ReceivableUpdatedEventData
+from .receivables_preview_type_enum import ReceivablesPreviewTypeEnum
+from .receivables_reminders_warning_message import ReceivablesRemindersWarningMessage
+from .receivables_representation_of_counterpart_address import ReceivablesRepresentationOfCounterpartAddress
+from .receivables_representation_of_entity_bank_account import ReceivablesRepresentationOfEntityBankAccount
+from .receivables_send_response import ReceivablesSendResponse
+from .receivables_status_enum import ReceivablesStatusEnum
+from .receivables_verify_response import ReceivablesVerifyResponse
+from .recipient import Recipient
+from .recipient_account_response import RecipientAccountResponse
+from .recipient_type import RecipientType
+from .recipients import Recipients
+from .recurrence import Recurrence
+from .recurrence_iteration import RecurrenceIteration
+from .recurrence_status import RecurrenceStatus
+from .related_documents import RelatedDocuments
+from .reminder import Reminder
+from .reminder_type_enum import ReminderTypeEnum
+from .reminders_settings import RemindersSettings
+from .requirements_error import RequirementsError
+from .response_item import ResponseItem
+from .role_cursor_fields import RoleCursorFields
+from .role_pagination_response import RolePaginationResponse
+from .role_response import RoleResponse
+from .root_schema import (
+ RootSchema,
+ RootSchema_ApprovalPolicy,
+ RootSchema_ApprovalRequest,
+ RootSchema_Comment,
+ RootSchema_Counterpart,
+ RootSchema_CounterpartVatId,
+ RootSchema_Entity,
+ RootSchema_EntityBankAccount,
+ RootSchema_EntityUser,
+ RootSchema_EntityVatIds,
+ RootSchema_Export,
+ RootSchema_Onboarding,
+ RootSchema_OverdueReminder,
+ RootSchema_Payable,
+ RootSchema_PayablesPurchaseOrder,
+ RootSchema_PaymentRecord,
+ RootSchema_PaymentReminder,
+ RootSchema_Person,
+ RootSchema_Product,
+ RootSchema_Project,
+ RootSchema_Receivable,
+ RootSchema_Reconciliation,
+ RootSchema_Role,
+ RootSchema_Tag,
+ RootSchema_TodoTask,
+ RootSchema_TodoTaskMute,
+ RootSchema_Transaction,
+ RootSchema_Workflow,
+)
+from .service_providers_enum import ServiceProvidersEnum
+from .signature import Signature
+from .single_onboarding_requirements_response import SingleOnboardingRequirementsResponse
+from .single_payment_intent import SinglePaymentIntent
+from .single_payment_intent_response import SinglePaymentIntentResponse
+from .source_of_payable_data_enum import SourceOfPayableDataEnum
+from .status_changed_event_data import StatusChangedEventData
+from .status_enum import StatusEnum
+from .success_result import SuccessResult
+from .suggested_payment_term import SuggestedPaymentTerm
+from .supported_field_names import SupportedFieldNames
+from .supported_format_schema import SupportedFormatSchema
+from .supported_format_schema_object_type import SupportedFormatSchemaObjectType
+from .sync_record_cursor_fields import SyncRecordCursorFields
+from .sync_record_resource import SyncRecordResource
+from .sync_record_resource_list import SyncRecordResourceList
+from .sync_status import SyncStatus
+from .system_template_data_schema import SystemTemplateDataSchema
+from .system_templates import SystemTemplates
+from .tag_category import TagCategory
+from .tag_cursor_fields import TagCursorFields
+from .tag_read_schema import TagReadSchema
+from .tags_pagination_response import TagsPaginationResponse
+from .tax_component_response import TaxComponentResponse
+from .tax_rate_account_cursor_fields import TaxRateAccountCursorFields
+from .template_data_schema import TemplateDataSchema
+from .template_list_response import TemplateListResponse
+from .template_receivable_response import TemplateReceivableResponse
+from .template_type_enum import TemplateTypeEnum
+from .term_final_with_date import TermFinalWithDate
+from .terms_of_service_acceptance import TermsOfServiceAcceptance
+from .text_template_response import TextTemplateResponse
+from .text_template_response_list import TextTemplateResponseList
+from .text_template_type import TextTemplateType
+from .total_vat_amount_item import TotalVatAmountItem
+from .unit import Unit
+from .unit_list_response import UnitListResponse
+from .unit_request import UnitRequest
+from .unit_response import UnitResponse
+from .update_credit_note import UpdateCreditNote
+from .update_credit_note_payload import UpdateCreditNotePayload
+from .update_entity_address_schema import UpdateEntityAddressSchema
+from .update_entity_request import UpdateEntityRequest
+from .update_invoice import UpdateInvoice
+from .update_invoice_payload import UpdateInvoicePayload
+from .update_issued_invoice import UpdateIssuedInvoice
+from .update_issued_invoice_entity import (
+ UpdateIssuedInvoiceEntity,
+ UpdateIssuedInvoiceEntity_Individual,
+ UpdateIssuedInvoiceEntity_Organization,
+)
+from .update_issued_invoice_payload import UpdateIssuedInvoicePayload
+from .update_line_item_for_credit_note import UpdateLineItemForCreditNote
+from .update_product_for_credit_note import UpdateProductForCreditNote
+from .update_quote import UpdateQuote
+from .update_quote_payload import UpdateQuotePayload
+from .validation_error import ValidationError
+from .validation_error_loc_item import ValidationErrorLocItem
+from .variable import Variable
+from .variables_object import VariablesObject
+from .variables_object_list import VariablesObjectList
+from .variables_type import VariablesType
+from .vat_id_type_enum import VatIdTypeEnum
+from .vat_mode_enum import VatModeEnum
+from .vat_rate_creator import VatRateCreator
+from .vat_rate_list_response import VatRateListResponse
+from .vat_rate_response import VatRateResponse
+from .vat_rate_status_enum import VatRateStatusEnum
+from .verification_airwallex_plaid_request import VerificationAirwallexPlaidRequest
+from .verification_airwallex_plaid_response import VerificationAirwallexPlaidResponse
+from .verification_error import VerificationError
+from .verification_request import VerificationRequest
+from .verification_response import VerificationResponse
+from .verification_status_enum import VerificationStatusEnum
+from .verify_response import VerifyResponse
+from .webhook_delivery_cursor_fields import WebhookDeliveryCursorFields
+from .webhook_delivery_pagination_resource import WebhookDeliveryPaginationResource
+from .webhook_delivery_resource import WebhookDeliveryResource
+from .webhook_object_type import WebhookObjectType
+from .webhook_subscription_cursor_fields import WebhookSubscriptionCursorFields
+from .webhook_subscription_pagination_resource import WebhookSubscriptionPaginationResource
+from .webhook_subscription_resource import WebhookSubscriptionResource
+from .webhook_subscription_resource_with_secret import WebhookSubscriptionResourceWithSecret
+from .webhook_subscription_status import WebhookSubscriptionStatus
+
+__all__ = [
+ "AccessTokenResponse",
+ "AccountDisabledReason",
+ "AccountResponse",
+ "AccountingConnectionList",
+ "AccountingConnectionResponse",
+ "AccountingCustomerRefObject",
+ "AccountingLineItem",
+ "AccountingMessageResponse",
+ "AccountingPayable",
+ "AccountingPayableDueDate",
+ "AccountingPayableList",
+ "AccountingPurchaseOrderRef",
+ "AccountingReceivable",
+ "AccountingReceivableDueDate",
+ "AccountingReceivableList",
+ "AccountingRefObject",
+ "AccountingSettingsPayload",
+ "AccountingSettingsResponse",
+ "AccountingTaxRateListResponse",
+ "AccountingTaxRateResponse",
+ "AccountingVendorRefObject",
+ "ActionEnum",
+ "ActionSchema",
+ "AirwallexMandate",
+ "AirwallexMandateType",
+ "AirwallexMandateVersion",
+ "AirwallexPlaidAccount",
+ "AirwallexPlaidBankAccountVerificationStatus",
+ "AirwallexPlaidInstitution",
+ "AirwallexPlaidVerification",
+ "AllDocumentExportResponseSchema",
+ "AllOverdueRemindersResponse",
+ "AllowedCountries",
+ "AllowedFileTypes",
+ "ApiVersion",
+ "ApprovalPolicyCursorFields",
+ "ApprovalPolicyResource",
+ "ApprovalPolicyResourceList",
+ "ApprovalPolicyResourceScriptItem",
+ "ApprovalPolicyResourceStatus",
+ "ApprovalPolicyResourceTrigger",
+ "ApprovalPolicyStatus",
+ "ApprovalProcessResourceList",
+ "ApprovalProcessStepResource",
+ "ApprovalProcessStepResourceList",
+ "ApprovalProcessStepStatus",
+ "ApprovalRequestCreateByRoleRequest",
+ "ApprovalRequestCreateByUserRequest",
+ "ApprovalRequestCreateRequest",
+ "ApprovalRequestCursorFields",
+ "ApprovalRequestResourceList",
+ "ApprovalRequestResourceWithMetadata",
+ "ApprovalRequestStatus",
+ "BankAccount",
+ "BankAccountVerificationType",
+ "BankAccountVerifications",
+ "BasedOnReceivableCreatedEventData",
+ "BasedOnTransitionType",
+ "BizObjectsSchema",
+ "BusinessProfile",
+ "ButtonThemePayload",
+ "ButtonThemeResponse",
+ "CardThemePayload",
+ "CardThemeResponse",
+ "CommentCursorFields",
+ "CommentResource",
+ "CommentResourceList",
+ "CommonSchema",
+ "CompleteRefreshVerificationResponse",
+ "CompleteVerificationAirwallexPlaidRequest",
+ "CompleteVerificationResponse",
+ "ConnectionStatus",
+ "CounterpartAddress",
+ "CounterpartAddressResourceList",
+ "CounterpartAddressResponseWithCounterpartId",
+ "CounterpartBankAccountResourceList",
+ "CounterpartBankAccountResponse",
+ "CounterpartContactResponse",
+ "CounterpartContactsResourceList",
+ "CounterpartCreatePayload",
+ "CounterpartCreatePayload_Individual",
+ "CounterpartCreatePayload_Organization",
+ "CounterpartCursorFields",
+ "CounterpartIndividualCreatePayload",
+ "CounterpartIndividualResponse",
+ "CounterpartIndividualRootCreatePayload",
+ "CounterpartIndividualRootResponse",
+ "CounterpartIndividualRootUpdatePayload",
+ "CounterpartIndividualUpdatePayload",
+ "CounterpartOrganizationCreatePayload",
+ "CounterpartOrganizationResponse",
+ "CounterpartOrganizationRootCreatePayload",
+ "CounterpartOrganizationRootResponse",
+ "CounterpartOrganizationRootUpdatePayload",
+ "CounterpartOrganizationUpdatePayload",
+ "CounterpartPaginationResponse",
+ "CounterpartRawAddress",
+ "CounterpartRawAddressUpdateRequest",
+ "CounterpartRawBankAccount",
+ "CounterpartRawBankAccountUpdateRequest",
+ "CounterpartRawData",
+ "CounterpartRawDataUpdateRequest",
+ "CounterpartRawVatId",
+ "CounterpartRawVatIdUpdateRequest",
+ "CounterpartResponse",
+ "CounterpartTagCategory",
+ "CounterpartTagSchema",
+ "CounterpartType",
+ "CounterpartUpdatePayload",
+ "CounterpartVatIdResourceList",
+ "CounterpartVatIdResponse",
+ "CreateExportTaskResponseSchema",
+ "CreateOnboardingLinkRequest",
+ "CreditNoteResponsePayload",
+ "CreditNoteResponsePayloadEntity",
+ "CreditNoteResponsePayloadEntity_Individual",
+ "CreditNoteResponsePayloadEntity_Organization",
+ "CreditNoteStateEnum",
+ "CurrencyEnum",
+ "CurrencyExchangeSchema",
+ "CurrencySettings",
+ "CustomTemplateDataSchema",
+ "CustomTemplatesCursorFields",
+ "CustomTemplatesPaginationResponse",
+ "DataExportCursorFields",
+ "DayOfMonth",
+ "Discount",
+ "DiscountType",
+ "DnsRecord",
+ "DnsRecordPurpose",
+ "DnsRecordType",
+ "DnsRecords",
+ "DocumentExportResponseSchema",
+ "DocumentIDsSettings",
+ "DocumentIDsSettingsNextNumber",
+ "DocumentIDsSettingsRequest",
+ "DocumentIdSeparators",
+ "DocumentObjectTypeRequestEnum",
+ "DocumentTypeEnum",
+ "DocumentTypePrefix",
+ "DomainListResponse",
+ "DomainResponse",
+ "DomainResponseDnsRecords",
+ "EInvoicingProviderEnum",
+ "EInvoicingSettingsPayload",
+ "EInvoicingSettingsResponse",
+ "EntityAddressResponseSchema",
+ "EntityAddressSchema",
+ "EntityBankAccountPaginationResponse",
+ "EntityBankAccountResponse",
+ "EntityBusinessStructure",
+ "EntityCursorFields",
+ "EntityIndividualResponse",
+ "EntityOnboardingDataResponse",
+ "EntityOnboardingDocuments",
+ "EntityOrganizationResponse",
+ "EntityPaginationResponse",
+ "EntityResponse",
+ "EntityResponse_Individual",
+ "EntityResponse_Organization",
+ "EntityTypeEnum",
+ "EntityUserCursorFields",
+ "EntityUserPaginationResponse",
+ "EntityUserResponse",
+ "EntityVatIdResourceList",
+ "EntityVatIdResponse",
+ "ErrorSchema",
+ "ErrorSchemaResponse",
+ "EstimatedMonthlyRevenue",
+ "EventCursorFields",
+ "EventPaginationResource",
+ "EventResource",
+ "EventResourceForWebhookClient",
+ "ExchangeRate",
+ "ExportFormat",
+ "ExportObjectSchema",
+ "ExportObjectSchema_Payable",
+ "ExportObjectSchema_Receivable",
+ "ExportPayableSchema",
+ "ExportReceivableSchema",
+ "ExportSettingCursorFields",
+ "ExtraDataResource",
+ "ExtraDataResourceList",
+ "FileResponse",
+ "FileSchema",
+ "FileSchema2",
+ "FileSchema3",
+ "FileSchema4",
+ "FilesResponse",
+ "GetAllPaymentReminders",
+ "GetAllRecurrences",
+ "GetOnboardingRequirementsResponse",
+ "GrantType",
+ "HttpValidationError",
+ "IndividualResponseSchema",
+ "IndividualSchema",
+ "Invoice",
+ "InvoiceFile",
+ "InvoiceResponsePayload",
+ "InvoiceResponsePayloadEntity",
+ "InvoiceResponsePayloadEntity_Individual",
+ "InvoiceResponsePayloadEntity_Organization",
+ "Item",
+ "IterationStatus",
+ "LabelNValue",
+ "LanguageCodeEnum",
+ "LedgerAccountCursorFields",
+ "LedgerAccountListResponse",
+ "LedgerAccountResponse",
+ "LineItem",
+ "LineItemCursorFields",
+ "LineItemInternalRequest",
+ "LineItemPaginationResponse",
+ "LineItemProduct",
+ "LineItemProductCreate",
+ "LineItemProductMeasureUnit",
+ "LineItemProductVatRate",
+ "LineItemRequest",
+ "LineItemResponse",
+ "LineItemUpdate",
+ "LineItemsReplaceResponse",
+ "LineItemsResponse",
+ "LogMethodEnum",
+ "LogResponse",
+ "LogResponseBody",
+ "LogTypeEnum",
+ "LogsResponse",
+ "MailSentEventData",
+ "MailSettingsPayload",
+ "MailSettingsResponse",
+ "MailboxDataResponse",
+ "MailboxObjectTypeEnum",
+ "MailboxResponse",
+ "MergedSettingsResponse",
+ "MessageResponse",
+ "MissingFields",
+ "MissingLineItemFields",
+ "MoniteAllPaymentMethods",
+ "MoniteAllPaymentMethodsTypes",
+ "ObjectMatchTypes",
+ "ObjectType",
+ "ObjectTypeAvailableComment",
+ "ObjectTypeEnum",
+ "OcrAddress",
+ "OcrAutoTaggingSettingsRequest",
+ "OcrRecognitionResponse",
+ "OcrResponseInvoiceReceiptData",
+ "OcrResponseInvoiceReceiptLineItem",
+ "OcrResponseInvoiceReceiptLineItemRaw",
+ "OcrStatusEnum",
+ "OnboardingLinkPublicResponse",
+ "OnboardingLinkResponse",
+ "OnboardingPaymentMethodsResponse",
+ "OnboardingRequirementsError",
+ "OnboardingRequirementsResponse",
+ "OnboardingVerificationError",
+ "OnboardingVerificationStatusEnum",
+ "OptionalIndividualSchema",
+ "OptionalOrganizationSchema",
+ "OptionalPersonAddressRequest",
+ "OptionalPersonRelationship",
+ "OrderEnum",
+ "OrderEnum2",
+ "OrderEnum3",
+ "OrganizationResponseSchema",
+ "OrganizationSchema",
+ "OverdueReminderResponse",
+ "OverdueReminderTerm",
+ "OwnershipDeclaration",
+ "PageSchema",
+ "PageSchema2",
+ "PageSchema3",
+ "PageSchema4",
+ "PartnerMetadata",
+ "PartnerMetadataResponse",
+ "PartnerProjectSettingsResponse",
+ "PayableActionEnum",
+ "PayableActionSchema",
+ "PayableAggregatedDataResponse",
+ "PayableAggregatedItem",
+ "PayableCursorFields",
+ "PayableEntityAddressSchema",
+ "PayableEntityIndividualResponse",
+ "PayableEntityOrganizationResponse",
+ "PayableIndividualSchema",
+ "PayableOrganizationSchema",
+ "PayableOriginEnum",
+ "PayablePaginationResponse",
+ "PayablePaymentTermDiscount",
+ "PayablePaymentTermFinal",
+ "PayablePaymentTermsCreatePayload",
+ "PayableResponseSchema",
+ "PayableResponseSchemaOtherExtractedData",
+ "PayableSchema",
+ "PayableSettingsPayload",
+ "PayableSettingsResponse",
+ "PayableStateEnum",
+ "PayableTemplatesVariable",
+ "PayableTemplatesVariablesObject",
+ "PayableTemplatesVariablesObjectList",
+ "PayableValidationResponse",
+ "PayableValidationsResource",
+ "PayablesFieldsAllowedForValidate",
+ "PayablesVariableType",
+ "PaymentAccountObject",
+ "PaymentAccountType",
+ "PaymentIntent",
+ "PaymentIntentCursorFields",
+ "PaymentIntentHistory",
+ "PaymentIntentHistoryResponse",
+ "PaymentIntentPayoutMethod",
+ "PaymentIntentResponse",
+ "PaymentIntentsListResponse",
+ "PaymentIntentsRecipient",
+ "PaymentMethod",
+ "PaymentMethodDirection",
+ "PaymentMethodRequirements",
+ "PaymentMethodStatus",
+ "PaymentObject",
+ "PaymentObjectPayable",
+ "PaymentObjectType",
+ "PaymentPageThemePayload",
+ "PaymentPageThemeResponse",
+ "PaymentPriorityEnum",
+ "PaymentReceivedEventData",
+ "PaymentRecordCursorFields",
+ "PaymentRecordObjectRequest",
+ "PaymentRecordObjectResponse",
+ "PaymentRecordResponse",
+ "PaymentRecordResponseList",
+ "PaymentReminderResponse",
+ "PaymentRequirements",
+ "PaymentTerm",
+ "PaymentTermDiscount",
+ "PaymentTermDiscountWithDate",
+ "PaymentTerms",
+ "PaymentTermsListResponse",
+ "PaymentTermsResponse",
+ "PaymentsBatchPaymentResponse",
+ "PaymentsBatchPaymentStatus",
+ "PaymentsSettingsPayload",
+ "PaymentsSettingsResponse",
+ "PermissionEnum",
+ "PersonAddressRequest",
+ "PersonAddressResponse",
+ "PersonOnboardingDocuments",
+ "PersonRelationshipRequest",
+ "PersonRelationshipResponse",
+ "PersonResponse",
+ "PersonsResponse",
+ "Platform",
+ "PreviewSchema",
+ "PreviewSchema2",
+ "PreviewSchema3",
+ "PreviewSchema4",
+ "PreviewTemplateResponse",
+ "Price",
+ "ProcessResource",
+ "ProcessResourceScriptSnapshot",
+ "ProcessStatusEnum",
+ "ProductCursorFields",
+ "ProductServicePaginationResponse",
+ "ProductServiceResponse",
+ "ProductServiceTypeEnum",
+ "ProjectCursorFields",
+ "ProjectPaginationResponse",
+ "ProjectResource",
+ "PublicPaymentLinkResponse",
+ "PurchaseOrderCounterpartAddressSchema",
+ "PurchaseOrderCounterpartIndividualResponse",
+ "PurchaseOrderCounterpartIndividualRootResponse",
+ "PurchaseOrderCounterpartOrganizationResponse",
+ "PurchaseOrderCounterpartOrganizationRootResponse",
+ "PurchaseOrderCounterpartSchema",
+ "PurchaseOrderCursorFields",
+ "PurchaseOrderEmailPreviewResponse",
+ "PurchaseOrderEmailSentResponse",
+ "PurchaseOrderItem",
+ "PurchaseOrderPaginationResponse",
+ "PurchaseOrderResponseSchema",
+ "PurchaseOrderResponseSchemaEntity",
+ "PurchaseOrderStatusEnum",
+ "PurchaseOrderVatId",
+ "QuoteResponsePayload",
+ "QuoteResponsePayloadEntity",
+ "QuoteResponsePayloadEntity_Individual",
+ "QuoteResponsePayloadEntity_Organization",
+ "QuoteStateEnum",
+ "ReceivableCounterpartContact",
+ "ReceivableCounterpartType",
+ "ReceivableCounterpartVatIdResponse",
+ "ReceivableCreateBasedOnPayload",
+ "ReceivableCursorFields",
+ "ReceivableEditFlow",
+ "ReceivableEntityAddressSchema",
+ "ReceivableEntityBase",
+ "ReceivableEntityIndividual",
+ "ReceivableEntityIndividualRequest",
+ "ReceivableEntityOrganization",
+ "ReceivableEntityOrganizationRequest",
+ "ReceivableEntityVatIdResponse",
+ "ReceivableFacadeCreateInvoicePayload",
+ "ReceivableFacadeCreatePayload",
+ "ReceivableFacadeCreateQuotePayload",
+ "ReceivableFileSchema",
+ "ReceivableFileUrl",
+ "ReceivableHistoryCursorFields",
+ "ReceivableHistoryEventTypeEnum",
+ "ReceivableHistoryPaginationResponse",
+ "ReceivableHistoryResponse",
+ "ReceivableHistoryResponseEventData",
+ "ReceivableMailCursorFields",
+ "ReceivableMailPaginationResponse",
+ "ReceivableMailRecipientState",
+ "ReceivableMailRecipients",
+ "ReceivableMailResponse",
+ "ReceivableMailStatusEnum",
+ "ReceivablePageSchema",
+ "ReceivablePaginationResponse",
+ "ReceivablePreviewResponse",
+ "ReceivablePreviewSchema",
+ "ReceivableResponse",
+ "ReceivableResponse_CreditNote",
+ "ReceivableResponse_Invoice",
+ "ReceivableResponse_Quote",
+ "ReceivableSendResponse",
+ "ReceivableSettingsPayload",
+ "ReceivableSettingsResponse",
+ "ReceivableTemplatesVariable",
+ "ReceivableTemplatesVariablesObject",
+ "ReceivableTemplatesVariablesObjectList",
+ "ReceivableType",
+ "ReceivableUpdatePayload",
+ "ReceivableUpdatedEventData",
+ "ReceivablesPreviewTypeEnum",
+ "ReceivablesRemindersWarningMessage",
+ "ReceivablesRepresentationOfCounterpartAddress",
+ "ReceivablesRepresentationOfEntityBankAccount",
+ "ReceivablesSendResponse",
+ "ReceivablesStatusEnum",
+ "ReceivablesVerifyResponse",
+ "Recipient",
+ "RecipientAccountResponse",
+ "RecipientType",
+ "Recipients",
+ "Recurrence",
+ "RecurrenceIteration",
+ "RecurrenceStatus",
+ "RelatedDocuments",
+ "Reminder",
+ "ReminderTypeEnum",
+ "RemindersSettings",
+ "RequirementsError",
+ "ResponseItem",
+ "RoleCursorFields",
+ "RolePaginationResponse",
+ "RoleResponse",
+ "RootSchema",
+ "RootSchema_ApprovalPolicy",
+ "RootSchema_ApprovalRequest",
+ "RootSchema_Comment",
+ "RootSchema_Counterpart",
+ "RootSchema_CounterpartVatId",
+ "RootSchema_Entity",
+ "RootSchema_EntityBankAccount",
+ "RootSchema_EntityUser",
+ "RootSchema_EntityVatIds",
+ "RootSchema_Export",
+ "RootSchema_Onboarding",
+ "RootSchema_OverdueReminder",
+ "RootSchema_Payable",
+ "RootSchema_PayablesPurchaseOrder",
+ "RootSchema_PaymentRecord",
+ "RootSchema_PaymentReminder",
+ "RootSchema_Person",
+ "RootSchema_Product",
+ "RootSchema_Project",
+ "RootSchema_Receivable",
+ "RootSchema_Reconciliation",
+ "RootSchema_Role",
+ "RootSchema_Tag",
+ "RootSchema_TodoTask",
+ "RootSchema_TodoTaskMute",
+ "RootSchema_Transaction",
+ "RootSchema_Workflow",
+ "ServiceProvidersEnum",
+ "Signature",
+ "SingleOnboardingRequirementsResponse",
+ "SinglePaymentIntent",
+ "SinglePaymentIntentResponse",
+ "SourceOfPayableDataEnum",
+ "StatusChangedEventData",
+ "StatusEnum",
+ "SuccessResult",
+ "SuggestedPaymentTerm",
+ "SupportedFieldNames",
+ "SupportedFormatSchema",
+ "SupportedFormatSchemaObjectType",
+ "SyncRecordCursorFields",
+ "SyncRecordResource",
+ "SyncRecordResourceList",
+ "SyncStatus",
+ "SystemTemplateDataSchema",
+ "SystemTemplates",
+ "TagCategory",
+ "TagCursorFields",
+ "TagReadSchema",
+ "TagsPaginationResponse",
+ "TaxComponentResponse",
+ "TaxRateAccountCursorFields",
+ "TemplateDataSchema",
+ "TemplateListResponse",
+ "TemplateReceivableResponse",
+ "TemplateTypeEnum",
+ "TermFinalWithDate",
+ "TermsOfServiceAcceptance",
+ "TextTemplateResponse",
+ "TextTemplateResponseList",
+ "TextTemplateType",
+ "TotalVatAmountItem",
+ "Unit",
+ "UnitListResponse",
+ "UnitRequest",
+ "UnitResponse",
+ "UpdateCreditNote",
+ "UpdateCreditNotePayload",
+ "UpdateEntityAddressSchema",
+ "UpdateEntityRequest",
+ "UpdateInvoice",
+ "UpdateInvoicePayload",
+ "UpdateIssuedInvoice",
+ "UpdateIssuedInvoiceEntity",
+ "UpdateIssuedInvoiceEntity_Individual",
+ "UpdateIssuedInvoiceEntity_Organization",
+ "UpdateIssuedInvoicePayload",
+ "UpdateLineItemForCreditNote",
+ "UpdateProductForCreditNote",
+ "UpdateQuote",
+ "UpdateQuotePayload",
+ "ValidationError",
+ "ValidationErrorLocItem",
+ "Variable",
+ "VariablesObject",
+ "VariablesObjectList",
+ "VariablesType",
+ "VatIdTypeEnum",
+ "VatModeEnum",
+ "VatRateCreator",
+ "VatRateListResponse",
+ "VatRateResponse",
+ "VatRateStatusEnum",
+ "VerificationAirwallexPlaidRequest",
+ "VerificationAirwallexPlaidResponse",
+ "VerificationError",
+ "VerificationRequest",
+ "VerificationResponse",
+ "VerificationStatusEnum",
+ "VerifyResponse",
+ "WebhookDeliveryCursorFields",
+ "WebhookDeliveryPaginationResource",
+ "WebhookDeliveryResource",
+ "WebhookObjectType",
+ "WebhookSubscriptionCursorFields",
+ "WebhookSubscriptionPaginationResource",
+ "WebhookSubscriptionResource",
+ "WebhookSubscriptionResourceWithSecret",
+ "WebhookSubscriptionStatus",
+]
diff --git a/src/monite/types/access_token_response.py b/src/monite/types/access_token_response.py
new file mode 100644
index 0000000..08f216e
--- /dev/null
+++ b/src/monite/types/access_token_response.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class AccessTokenResponse(UniversalBaseModel):
+ access_token: str
+ expires_in: int
+ token_type: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/account_disabled_reason.py b/src/monite/types/account_disabled_reason.py
new file mode 100644
index 0000000..d70fe26
--- /dev/null
+++ b/src/monite/types/account_disabled_reason.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+AccountDisabledReason = typing.Union[
+ typing.Literal[
+ "requirements.past_due",
+ "requirements.pending_verification",
+ "listed",
+ "platform_paused",
+ "rejected.fraud",
+ "rejected.listed",
+ "rejected.terms_of_service",
+ "rejected.other",
+ "under_review",
+ "other",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/account_response.py b/src/monite/types/account_response.py
new file mode 100644
index 0000000..a33567f
--- /dev/null
+++ b/src/monite/types/account_response.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .bank_account import BankAccount
+from .payment_account_type import PaymentAccountType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class AccountResponse(UniversalBaseModel):
+ id: str
+ bank_accounts: typing.Optional[typing.List[BankAccount]] = None
+ type: PaymentAccountType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_connection_list.py b/src/monite/types/accounting_connection_list.py
new file mode 100644
index 0000000..6aefcb1
--- /dev/null
+++ b/src/monite/types/accounting_connection_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .accounting_connection_response import AccountingConnectionResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class AccountingConnectionList(UniversalBaseModel):
+ data: typing.List[AccountingConnectionResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_connection_response.py b/src/monite/types/accounting_connection_response.py
new file mode 100644
index 0000000..e650813
--- /dev/null
+++ b/src/monite/types/accounting_connection_response.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+from .error_schema import ErrorSchema
+from .connection_status import ConnectionStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class AccountingConnectionResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ connection_url: str
+ errors: typing.Optional[typing.List[ErrorSchema]] = None
+ last_pull: typing.Optional[dt.datetime] = None
+ platform: typing.Optional[str] = None
+ status: typing.Optional[ConnectionStatus] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_customer_ref_object.py b/src/monite/types/accounting_customer_ref_object.py
new file mode 100644
index 0000000..0fe99b8
--- /dev/null
+++ b/src/monite/types/accounting_customer_ref_object.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingCustomerRefObject(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ A unique identifier of the customer in the accounting system.
+ """
+
+ company_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Customer name in the accounting system.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_line_item.py b/src/monite/types/accounting_line_item.py
new file mode 100644
index 0000000..de80cd2
--- /dev/null
+++ b/src/monite/types/accounting_line_item.py
@@ -0,0 +1,57 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .accounting_ref_object import AccountingRefObject
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingLineItem(UniversalBaseModel):
+ """
+ Contains the details of an invoice line item retrieved from an accounting system.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The name or description of the product or service being invoiced.
+ """
+
+ discount_amount: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Discount amount for this line item (if any).
+ """
+
+ discount_percentage: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Discount percentage for this line item (if any).
+ """
+
+ ledger_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the ledger account associated with this line item. You can use `GET /ledger_accounts/{ledger_account_id}` to get further details about this ledger account.
+ """
+
+ quantity: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The quantity of the product or service.
+ """
+
+ tax_rate_ref: typing.Optional[AccountingRefObject] = pydantic.Field(default=None)
+ """
+ An internal reference to the tax rate in the accounting system that the line item is linked to.
+ """
+
+ unit_amount: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The cost per unit of the product or service.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_message_response.py b/src/monite/types/accounting_message_response.py
new file mode 100644
index 0000000..2dce152
--- /dev/null
+++ b/src/monite/types/accounting_message_response.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class AccountingMessageResponse(UniversalBaseModel):
+ message: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_payable.py b/src/monite/types/accounting_payable.py
new file mode 100644
index 0000000..15e9d67
--- /dev/null
+++ b/src/monite/types/accounting_payable.py
@@ -0,0 +1,96 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .accounting_payable_due_date import AccountingPayableDueDate
+from .accounting_line_item import AccountingLineItem
+from .accounting_purchase_order_ref import AccountingPurchaseOrderRef
+from .accounting_vendor_ref_object import AccountingVendorRefObject
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingPayable(UniversalBaseModel):
+ """
+ Details of an accounts payable invoice (bill) retrieved from an accounting system.
+ """
+
+ id: str = pydantic.Field()
+ """
+ An internal identifier of the payable in the accounting system.
+ """
+
+ amount_due: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Remaining amount to be paid.
+ """
+
+ currency: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ISO-4217 currency code of the payable.
+ """
+
+ currency_rate: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Rate to convert the total amount of the transaction into the entity's base currency at the time of the transaction.
+ """
+
+ due_date: typing.Optional[AccountingPayableDueDate] = pydantic.Field(default=None)
+ """
+ The payable's due date.
+ """
+
+ invoice_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Invoice number of the payable.
+ """
+
+ lines: typing.Optional[typing.List[AccountingLineItem]] = None
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Any additional information or business notes about the payable.
+ """
+
+ posted_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Date when the payable was added to the accounting service. This may differ from the payable creation date.
+ """
+
+ purchase_order_refs: typing.Optional[typing.List[AccountingPurchaseOrderRef]] = pydantic.Field(default=None)
+ """
+ A list of purchase orders linked to the payable, if any.
+ """
+
+ status: str = pydantic.Field()
+ """
+ The status of the payable in the accounting system. Possible values: `open`, `draft`, `partially_paid`, `paid`, `unknown`, `void`.
+ """
+
+ subtotal: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Amount payable, including discounts but excluding VAT/taxes.
+ """
+
+ tax_amount: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Total VAT or tax amount.
+ """
+
+ total_amount: float = pydantic.Field()
+ """
+ The total amount payable, including discounts and VAT/taxes.
+ """
+
+ vendor_ref: typing.Optional[AccountingVendorRefObject] = pydantic.Field(default=None)
+ """
+ Information about the vendor from whom the payable was received.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_payable_due_date.py b/src/monite/types/accounting_payable_due_date.py
new file mode 100644
index 0000000..3887720
--- /dev/null
+++ b/src/monite/types/accounting_payable_due_date.py
@@ -0,0 +1,6 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+import datetime as dt
+
+AccountingPayableDueDate = typing.Union[dt.datetime, str]
diff --git a/src/monite/types/accounting_payable_list.py b/src/monite/types/accounting_payable_list.py
new file mode 100644
index 0000000..565d0ee
--- /dev/null
+++ b/src/monite/types/accounting_payable_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .accounting_payable import AccountingPayable
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class AccountingPayableList(UniversalBaseModel):
+ data: typing.List[AccountingPayable]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_purchase_order_ref.py b/src/monite/types/accounting_purchase_order_ref.py
new file mode 100644
index 0000000..801eaef
--- /dev/null
+++ b/src/monite/types/accounting_purchase_order_ref.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingPurchaseOrderRef(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ An internal ID of the purchase order in the accounting system.
+ """
+
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Reference number of the purchase order.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_receivable.py b/src/monite/types/accounting_receivable.py
new file mode 100644
index 0000000..d09f89d
--- /dev/null
+++ b/src/monite/types/accounting_receivable.py
@@ -0,0 +1,70 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .accounting_customer_ref_object import AccountingCustomerRefObject
+from .accounting_receivable_due_date import AccountingReceivableDueDate
+from .accounting_line_item import AccountingLineItem
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingReceivable(UniversalBaseModel):
+ """
+ Invoice details retrieved from an accounting system.
+ """
+
+ id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An internal identifier of the invoice in the accounting system.
+ """
+
+ currency: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ISO-4217 currency code of the invoice.
+ """
+
+ currency_rate: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Rate to convert the total amount of the transaction into the entity's base currency at the time of the transaction.
+ """
+
+ customer_ref: typing.Optional[AccountingCustomerRefObject] = pydantic.Field(default=None)
+ """
+ Information about the customer that the invoice was sent to.
+ """
+
+ due_date: typing.Optional[AccountingReceivableDueDate] = pydantic.Field(default=None)
+ """
+ Invoice due date.
+ """
+
+ invoice_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Invoice document number.
+ """
+
+ lines: typing.Optional[typing.List[AccountingLineItem]] = None
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Any additional information or business notes about the invoice.
+ """
+
+ pass_through: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ An object containing additional invoice data returned by the accounting system. This sometimes includes custom invoice fields.
+ """
+
+ posted_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Date when the invoice was added to the accounting service. This may differ from the invoice creation date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_receivable_due_date.py b/src/monite/types/accounting_receivable_due_date.py
new file mode 100644
index 0000000..fe94bbe
--- /dev/null
+++ b/src/monite/types/accounting_receivable_due_date.py
@@ -0,0 +1,6 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+import datetime as dt
+
+AccountingReceivableDueDate = typing.Union[dt.datetime, str]
diff --git a/src/monite/types/accounting_receivable_list.py b/src/monite/types/accounting_receivable_list.py
new file mode 100644
index 0000000..2eeb4c5
--- /dev/null
+++ b/src/monite/types/accounting_receivable_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .accounting_receivable import AccountingReceivable
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class AccountingReceivableList(UniversalBaseModel):
+ data: typing.List[AccountingReceivable]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_ref_object.py b/src/monite/types/accounting_ref_object.py
new file mode 100644
index 0000000..524cb06
--- /dev/null
+++ b/src/monite/types/accounting_ref_object.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingRefObject(UniversalBaseModel):
+ id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An internal ID of the tax rate in the accounting system.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_settings_payload.py b/src/monite/types/accounting_settings_payload.py
new file mode 100644
index 0000000..2352c5a
--- /dev/null
+++ b/src/monite/types/accounting_settings_payload.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingSettingsPayload(UniversalBaseModel):
+ provider: str
+ token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Token for the accounting provider (Codat only)
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_settings_response.py b/src/monite/types/accounting_settings_response.py
new file mode 100644
index 0000000..d42062f
--- /dev/null
+++ b/src/monite/types/accounting_settings_response.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingSettingsResponse(UniversalBaseModel):
+ provider: str
+ token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Token for the accounting provider (Codat only)
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_tax_rate_list_response.py b/src/monite/types/accounting_tax_rate_list_response.py
new file mode 100644
index 0000000..5841d6c
--- /dev/null
+++ b/src/monite/types/accounting_tax_rate_list_response.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .accounting_tax_rate_response import AccountingTaxRateResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class AccountingTaxRateListResponse(UniversalBaseModel):
+ data: typing.List[AccountingTaxRateResponse]
+ next_pagination_token: typing.Optional[str] = None
+ prev_pagination_token: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_tax_rate_response.py b/src/monite/types/accounting_tax_rate_response.py
new file mode 100644
index 0000000..0b00169
--- /dev/null
+++ b/src/monite/types/accounting_tax_rate_response.py
@@ -0,0 +1,37 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .tax_component_response import TaxComponentResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingTaxRateResponse(UniversalBaseModel):
+ id: str
+ code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Code for the tax rate from the accounting platform.
+ """
+
+ components: typing.Optional[typing.List[TaxComponentResponse]] = None
+ effective_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Effective tax rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+ """
+
+ name: typing.Optional[str] = None
+ status: typing.Optional[str] = None
+ total_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total (not compounded) sum of the components of a tax rate in [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/accounting_vendor_ref_object.py b/src/monite/types/accounting_vendor_ref_object.py
new file mode 100644
index 0000000..2e2192f
--- /dev/null
+++ b/src/monite/types/accounting_vendor_ref_object.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AccountingVendorRefObject(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ A unique identifier of the vendor in the accounting system.
+ """
+
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Vendor name in the accounting system.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/action_enum.py b/src/monite/types/action_enum.py
new file mode 100644
index 0000000..d49283b
--- /dev/null
+++ b/src/monite/types/action_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ActionEnum = typing.Union[typing.Literal["create", "read", "update", "delete"], typing.Any]
diff --git a/src/monite/types/action_schema.py b/src/monite/types/action_schema.py
new file mode 100644
index 0000000..61a3b8d
--- /dev/null
+++ b/src/monite/types/action_schema.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .action_enum import ActionEnum
+import pydantic
+from .permission_enum import PermissionEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ActionSchema(UniversalBaseModel):
+ action_name: typing.Optional[ActionEnum] = pydantic.Field(default=None)
+ """
+ Action name
+ """
+
+ permission: typing.Optional[PermissionEnum] = pydantic.Field(default=None)
+ """
+ Permission type
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/airwallex_mandate.py b/src/monite/types/airwallex_mandate.py
new file mode 100644
index 0000000..083e435
--- /dev/null
+++ b/src/monite/types/airwallex_mandate.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .airwallex_mandate_type import AirwallexMandateType
+from .airwallex_mandate_version import AirwallexMandateVersion
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class AirwallexMandate(UniversalBaseModel):
+ email: str = pydantic.Field()
+ """
+ PDF copy of mandate will be sent to the email by Airwallex
+ """
+
+ signatory: str = pydantic.Field()
+ """
+ Name of the person signed the mandate, must be a bank account owner
+ """
+
+ type: AirwallexMandateType = "us_ach_debit"
+ version: AirwallexMandateVersion = "1.0"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/airwallex_mandate_type.py b/src/monite/types/airwallex_mandate_type.py
new file mode 100644
index 0000000..12c4fe2
--- /dev/null
+++ b/src/monite/types/airwallex_mandate_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+AirwallexMandateType = typing.Literal["us_ach_debit"]
diff --git a/src/monite/types/airwallex_mandate_version.py b/src/monite/types/airwallex_mandate_version.py
new file mode 100644
index 0000000..0a63ecf
--- /dev/null
+++ b/src/monite/types/airwallex_mandate_version.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+AirwallexMandateVersion = typing.Literal["1.0"]
diff --git a/src/monite/types/airwallex_plaid_account.py b/src/monite/types/airwallex_plaid_account.py
new file mode 100644
index 0000000..ffef9cf
--- /dev/null
+++ b/src/monite/types/airwallex_plaid_account.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class AirwallexPlaidAccount(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Plaid`s unique identifier for the account
+ """
+
+ mask: str = pydantic.Field()
+ """
+ The last 2-4 alphanumeric characters of an account's official account number
+ """
+
+ name: str = pydantic.Field()
+ """
+ The name of the account, either assigned by the user or by the financial institution itself
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/airwallex_plaid_bank_account_verification_status.py b/src/monite/types/airwallex_plaid_bank_account_verification_status.py
new file mode 100644
index 0000000..d01a1e1
--- /dev/null
+++ b/src/monite/types/airwallex_plaid_bank_account_verification_status.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+AirwallexPlaidBankAccountVerificationStatus = typing.Union[
+ typing.Literal["verified", "expired", "suspended"], typing.Any
+]
diff --git a/src/monite/types/airwallex_plaid_institution.py b/src/monite/types/airwallex_plaid_institution.py
new file mode 100644
index 0000000..970b941
--- /dev/null
+++ b/src/monite/types/airwallex_plaid_institution.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class AirwallexPlaidInstitution(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ The institution identifier assigned by Plaid
+ """
+
+ name: str = pydantic.Field()
+ """
+ The full financial institution name
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/airwallex_plaid_verification.py b/src/monite/types/airwallex_plaid_verification.py
new file mode 100644
index 0000000..ca1e0e4
--- /dev/null
+++ b/src/monite/types/airwallex_plaid_verification.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .airwallex_plaid_bank_account_verification_status import AirwallexPlaidBankAccountVerificationStatus
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class AirwallexPlaidVerification(UniversalBaseModel):
+ status: AirwallexPlaidBankAccountVerificationStatus = pydantic.Field()
+ """
+ Status of the bank account verification
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/all_document_export_response_schema.py b/src/monite/types/all_document_export_response_schema.py
new file mode 100644
index 0000000..bd0a70e
--- /dev/null
+++ b/src/monite/types/all_document_export_response_schema.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .document_export_response_schema import DocumentExportResponseSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class AllDocumentExportResponseSchema(UniversalBaseModel):
+ data: typing.List[DocumentExportResponseSchema] = pydantic.Field()
+ """
+ A set of export objects returned per page.
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results. If there is no next page, i.e. you have reached the last page, the value is `null`.
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results. If there is no previous page, i.e. you have reached the first page, the value is `null`.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/all_overdue_reminders_response.py b/src/monite/types/all_overdue_reminders_response.py
new file mode 100644
index 0000000..baeb54d
--- /dev/null
+++ b/src/monite/types/all_overdue_reminders_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .overdue_reminder_response import OverdueReminderResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class AllOverdueRemindersResponse(UniversalBaseModel):
+ data: typing.List[OverdueReminderResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/allowed_countries.py b/src/monite/types/allowed_countries.py
new file mode 100644
index 0000000..8bfe815
--- /dev/null
+++ b/src/monite/types/allowed_countries.py
@@ -0,0 +1,261 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+AllowedCountries = typing.Union[
+ typing.Literal[
+ "AF",
+ "AX",
+ "AL",
+ "DZ",
+ "AS",
+ "AD",
+ "AO",
+ "AI",
+ "AQ",
+ "AG",
+ "AR",
+ "AM",
+ "AW",
+ "AU",
+ "AT",
+ "AZ",
+ "BS",
+ "BH",
+ "BD",
+ "BB",
+ "BY",
+ "BE",
+ "BZ",
+ "BJ",
+ "BM",
+ "BT",
+ "BO",
+ "BA",
+ "BW",
+ "BV",
+ "BR",
+ "IO",
+ "BN",
+ "BG",
+ "BF",
+ "BI",
+ "KH",
+ "CM",
+ "CA",
+ "IC",
+ "CV",
+ "KY",
+ "CF",
+ "EA",
+ "TD",
+ "CL",
+ "CN",
+ "CX",
+ "CC",
+ "CO",
+ "KM",
+ "CG",
+ "CD",
+ "CK",
+ "CR",
+ "CI",
+ "HR",
+ "CU",
+ "CY",
+ "CZ",
+ "DK",
+ "DJ",
+ "DM",
+ "DO",
+ "EC",
+ "EG",
+ "SV",
+ "GQ",
+ "ER",
+ "EE",
+ "SZ",
+ "ET",
+ "FK",
+ "FO",
+ "FJ",
+ "FI",
+ "FR",
+ "GF",
+ "PF",
+ "TF",
+ "GA",
+ "GM",
+ "GE",
+ "DE",
+ "GH",
+ "GI",
+ "GR",
+ "GL",
+ "GD",
+ "GP",
+ "GU",
+ "GT",
+ "GG",
+ "GN",
+ "GW",
+ "GY",
+ "HT",
+ "HM",
+ "VA",
+ "HN",
+ "HK",
+ "HU",
+ "IS",
+ "IN",
+ "ID",
+ "IR",
+ "IQ",
+ "IE",
+ "IM",
+ "IL",
+ "IT",
+ "JM",
+ "JP",
+ "JE",
+ "JO",
+ "KZ",
+ "KE",
+ "KI",
+ "KP",
+ "KR",
+ "KW",
+ "KG",
+ "LA",
+ "LV",
+ "LB",
+ "LS",
+ "LR",
+ "LY",
+ "LI",
+ "LT",
+ "LU",
+ "MO",
+ "MG",
+ "MW",
+ "MY",
+ "MV",
+ "ML",
+ "MT",
+ "MH",
+ "MQ",
+ "MR",
+ "MU",
+ "YT",
+ "MX",
+ "FM",
+ "MD",
+ "MC",
+ "MN",
+ "ME",
+ "MS",
+ "MA",
+ "MZ",
+ "MM",
+ "NA",
+ "NR",
+ "NP",
+ "NL",
+ "AN",
+ "NC",
+ "NZ",
+ "NI",
+ "NE",
+ "NG",
+ "NU",
+ "NF",
+ "MP",
+ "MK",
+ "NO",
+ "OM",
+ "PK",
+ "PW",
+ "PS",
+ "PA",
+ "PG",
+ "PY",
+ "PE",
+ "PH",
+ "PN",
+ "PL",
+ "PT",
+ "PR",
+ "QA",
+ "RE",
+ "RO",
+ "RU",
+ "RW",
+ "SH",
+ "KN",
+ "LC",
+ "PM",
+ "VC",
+ "WS",
+ "SM",
+ "ST",
+ "SA",
+ "SN",
+ "RS",
+ "SC",
+ "SL",
+ "SG",
+ "SK",
+ "SI",
+ "SB",
+ "SO",
+ "ZA",
+ "SS",
+ "GS",
+ "ES",
+ "LK",
+ "SD",
+ "SR",
+ "SJ",
+ "SE",
+ "CH",
+ "SY",
+ "TW",
+ "TJ",
+ "TZ",
+ "TH",
+ "TL",
+ "TG",
+ "TK",
+ "TO",
+ "TT",
+ "TN",
+ "TR",
+ "TM",
+ "TC",
+ "TV",
+ "UG",
+ "UA",
+ "AE",
+ "GB",
+ "US",
+ "UM",
+ "UY",
+ "UZ",
+ "VU",
+ "VE",
+ "VN",
+ "VG",
+ "VI",
+ "WF",
+ "EH",
+ "YE",
+ "ZM",
+ "ZW",
+ "BL",
+ "BQ",
+ "CW",
+ "MF",
+ "SX",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/allowed_file_types.py b/src/monite/types/allowed_file_types.py
new file mode 100644
index 0000000..130eafe
--- /dev/null
+++ b/src/monite/types/allowed_file_types.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+AllowedFileTypes = typing.Union[
+ typing.Literal[
+ "ocr_results",
+ "ocr_files",
+ "payables",
+ "receivables",
+ "receipts",
+ "userpics",
+ "entity_logo",
+ "companies_logo",
+ "zip",
+ "identity_documents",
+ "additional_identity_documents",
+ "receivable_signatures",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/api_version.py b/src/monite/types/api_version.py
new file mode 100644
index 0000000..7d8da8c
--- /dev/null
+++ b/src/monite/types/api_version.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApiVersion = typing.Union[
+ typing.Literal[
+ "2024-01-31", "2023-09-01", "2023-06-04", "2023-04-12", "2023-03-14", "2023-03-01", "2023-02-07", "2022-11-16"
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/approval_policy_cursor_fields.py b/src/monite/types/approval_policy_cursor_fields.py
new file mode 100644
index 0000000..ddcddc7
--- /dev/null
+++ b/src/monite/types/approval_policy_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/approval_policy_resource.py b/src/monite/types/approval_policy_resource.py
new file mode 100644
index 0000000..d553369
--- /dev/null
+++ b/src/monite/types/approval_policy_resource.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .approval_policy_resource_script_item import ApprovalPolicyResourceScriptItem
+from .approval_policy_resource_trigger import ApprovalPolicyResourceTrigger
+from .approval_policy_resource_status import ApprovalPolicyResourceStatus
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ApprovalPolicyResource(UniversalBaseModel):
+ name: str = pydantic.Field()
+ """
+ The name of the approval policy.
+ """
+
+ description: str = pydantic.Field()
+ """
+ A brief description of the approval policy.
+ """
+
+ script: typing.List[ApprovalPolicyResourceScriptItem] = pydantic.Field()
+ """
+ A list of JSON objects that represents the approval policy script. The script contains the logic that determines whether an action should be sent to approval. This field is required, and it should contain at least one script object.
+ """
+
+ trigger: typing.Optional[ApprovalPolicyResourceTrigger] = pydantic.Field(default=None)
+ """
+ A JSON object that represents the trigger for the approval policy. The trigger specifies the event that will trigger the policy to be evaluated.
+ """
+
+ id: str
+ status: ApprovalPolicyResourceStatus = pydantic.Field()
+ """
+ The current status of the approval policy.
+ """
+
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ created_by: str
+ updated_by: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_policy_resource_list.py b/src/monite/types/approval_policy_resource_list.py
new file mode 100644
index 0000000..a2a4b9c
--- /dev/null
+++ b/src/monite/types/approval_policy_resource_list.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .approval_policy_resource import ApprovalPolicyResource
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ApprovalPolicyResourceList(UniversalBaseModel):
+ data: typing.List[ApprovalPolicyResource]
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_policy_resource_script_item.py b/src/monite/types/approval_policy_resource_script_item.py
new file mode 100644
index 0000000..65e3003
--- /dev/null
+++ b/src/monite/types/approval_policy_resource_script_item.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyResourceScriptItem = typing.Union[
+ bool, float, str, typing.List[typing.Optional[typing.Any]], typing.Dict[str, typing.Optional[typing.Any]]
+]
diff --git a/src/monite/types/approval_policy_resource_status.py b/src/monite/types/approval_policy_resource_status.py
new file mode 100644
index 0000000..9de70f2
--- /dev/null
+++ b/src/monite/types/approval_policy_resource_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyResourceStatus = typing.Union[typing.Literal["active", "pending"], typing.Any]
diff --git a/src/monite/types/approval_policy_resource_trigger.py b/src/monite/types/approval_policy_resource_trigger.py
new file mode 100644
index 0000000..13b2612
--- /dev/null
+++ b/src/monite/types/approval_policy_resource_trigger.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyResourceTrigger = typing.Union[
+ bool, float, str, typing.List[typing.Optional[typing.Any]], typing.Dict[str, typing.Optional[typing.Any]]
+]
diff --git a/src/monite/types/approval_policy_status.py b/src/monite/types/approval_policy_status.py
new file mode 100644
index 0000000..ebf5e3d
--- /dev/null
+++ b/src/monite/types/approval_policy_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalPolicyStatus = typing.Union[typing.Literal["active", "deleted", "pending"], typing.Any]
diff --git a/src/monite/types/approval_process_resource_list.py b/src/monite/types/approval_process_resource_list.py
new file mode 100644
index 0000000..fc015c5
--- /dev/null
+++ b/src/monite/types/approval_process_resource_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .process_resource import ProcessResource
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ApprovalProcessResourceList(UniversalBaseModel):
+ data: typing.List[ProcessResource]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_process_step_resource.py b/src/monite/types/approval_process_step_resource.py
new file mode 100644
index 0000000..48db6dc
--- /dev/null
+++ b/src/monite/types/approval_process_step_resource.py
@@ -0,0 +1,26 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .approval_process_step_status import ApprovalProcessStepStatus
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ApprovalProcessStepResource(UniversalBaseModel):
+ object_id: str
+ required_approval_count: int
+ status: ApprovalProcessStepStatus
+ user_ids: typing.List[str]
+ role_ids: typing.List[str]
+ approved_by: typing.List[str]
+ rejected_by: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_process_step_resource_list.py b/src/monite/types/approval_process_step_resource_list.py
new file mode 100644
index 0000000..16f0165
--- /dev/null
+++ b/src/monite/types/approval_process_step_resource_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .approval_process_step_resource import ApprovalProcessStepResource
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ApprovalProcessStepResourceList(UniversalBaseModel):
+ data: typing.List[ApprovalProcessStepResource]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_process_step_status.py b/src/monite/types/approval_process_step_status.py
new file mode 100644
index 0000000..0854544
--- /dev/null
+++ b/src/monite/types/approval_process_step_status.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalProcessStepStatus = typing.Union[
+ typing.Literal["waiting", "approved", "rejected", "canceled", "failed", "not_started", "skipped"], typing.Any
+]
diff --git a/src/monite/types/approval_request_create_by_role_request.py b/src/monite/types/approval_request_create_by_role_request.py
new file mode 100644
index 0000000..527fe8c
--- /dev/null
+++ b/src/monite/types/approval_request_create_by_role_request.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .object_type import ObjectType
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ApprovalRequestCreateByRoleRequest(UniversalBaseModel):
+ object_id: str
+ object_type: ObjectType
+ required_approval_count: int
+ role_ids: typing.List[str]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_request_create_by_user_request.py b/src/monite/types/approval_request_create_by_user_request.py
new file mode 100644
index 0000000..c9eb248
--- /dev/null
+++ b/src/monite/types/approval_request_create_by_user_request.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .object_type import ObjectType
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ApprovalRequestCreateByUserRequest(UniversalBaseModel):
+ object_id: str
+ object_type: ObjectType
+ required_approval_count: int
+ user_ids: typing.List[str]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_request_create_request.py b/src/monite/types/approval_request_create_request.py
new file mode 100644
index 0000000..15ca8d5
--- /dev/null
+++ b/src/monite/types/approval_request_create_request.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .approval_request_create_by_role_request import ApprovalRequestCreateByRoleRequest
+from .approval_request_create_by_user_request import ApprovalRequestCreateByUserRequest
+
+ApprovalRequestCreateRequest = typing.Union[ApprovalRequestCreateByRoleRequest, ApprovalRequestCreateByUserRequest]
diff --git a/src/monite/types/approval_request_cursor_fields.py b/src/monite/types/approval_request_cursor_fields.py
new file mode 100644
index 0000000..ff1c5dc
--- /dev/null
+++ b/src/monite/types/approval_request_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalRequestCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/approval_request_resource_list.py b/src/monite/types/approval_request_resource_list.py
new file mode 100644
index 0000000..e8a1855
--- /dev/null
+++ b/src/monite/types/approval_request_resource_list.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .approval_request_resource_with_metadata import ApprovalRequestResourceWithMetadata
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ApprovalRequestResourceList(UniversalBaseModel):
+ data: typing.List[ApprovalRequestResourceWithMetadata]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_request_resource_with_metadata.py b/src/monite/types/approval_request_resource_with_metadata.py
new file mode 100644
index 0000000..ac81b39
--- /dev/null
+++ b/src/monite/types/approval_request_resource_with_metadata.py
@@ -0,0 +1,37 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+import pydantic
+from .object_type import ObjectType
+from .approval_request_status import ApprovalRequestStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ApprovalRequestResourceWithMetadata(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ approved_by: typing.List[str]
+ created_by: str = pydantic.Field()
+ """
+ ID of the user who created the approval request
+ """
+
+ object_id: str
+ object_type: ObjectType
+ rejected_by: typing.Optional[str] = None
+ required_approval_count: int
+ role_ids: typing.List[str]
+ status: ApprovalRequestStatus
+ user_ids: typing.List[str]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/approval_request_status.py b/src/monite/types/approval_request_status.py
new file mode 100644
index 0000000..97ccf02
--- /dev/null
+++ b/src/monite/types/approval_request_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ApprovalRequestStatus = typing.Union[typing.Literal["waiting", "approved", "rejected", "canceled"], typing.Any]
diff --git a/src/monite/types/bank_account.py b/src/monite/types/bank_account.py
new file mode 100644
index 0000000..be86a7f
--- /dev/null
+++ b/src/monite/types/bank_account.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .allowed_countries import AllowedCountries
+from .currency_enum import CurrencyEnum
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class BankAccount(UniversalBaseModel):
+ id: str
+ account_holder_name: typing.Optional[str] = None
+ account_number: typing.Optional[str] = None
+ bic: typing.Optional[str] = None
+ country: typing.Optional[AllowedCountries] = None
+ currency: typing.Optional[CurrencyEnum] = None
+ display_name: typing.Optional[str] = None
+ iban: typing.Optional[str] = None
+ is_default: typing.Optional[bool] = None
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Display name of a bank account
+ """
+
+ sort_code: typing.Optional[str] = None
+ was_created_by_user_id: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/bank_account_verification_type.py b/src/monite/types/bank_account_verification_type.py
new file mode 100644
index 0000000..e773c11
--- /dev/null
+++ b/src/monite/types/bank_account_verification_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+BankAccountVerificationType = typing.Literal["airwallex_plaid"]
diff --git a/src/monite/types/bank_account_verifications.py b/src/monite/types/bank_account_verifications.py
new file mode 100644
index 0000000..b81d93d
--- /dev/null
+++ b/src/monite/types/bank_account_verifications.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .airwallex_plaid_verification import AirwallexPlaidVerification
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class BankAccountVerifications(UniversalBaseModel):
+ airwallex_plaid: typing.Optional[AirwallexPlaidVerification] = pydantic.Field(default=None)
+ """
+ Airwallex Plaid verification
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/based_on_receivable_created_event_data.py b/src/monite/types/based_on_receivable_created_event_data.py
new file mode 100644
index 0000000..fedabcd
--- /dev/null
+++ b/src/monite/types/based_on_receivable_created_event_data.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .receivable_type import ReceivableType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class BasedOnReceivableCreatedEventData(UniversalBaseModel):
+ receivable_id: str
+ type: ReceivableType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/based_on_transition_type.py b/src/monite/types/based_on_transition_type.py
new file mode 100644
index 0000000..83b582d
--- /dev/null
+++ b/src/monite/types/based_on_transition_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+BasedOnTransitionType = typing.Union[typing.Literal["invoice", "credit_note"], typing.Any]
diff --git a/src/monite/types/biz_objects_schema.py b/src/monite/types/biz_objects_schema.py
new file mode 100644
index 0000000..a1099fc
--- /dev/null
+++ b/src/monite/types/biz_objects_schema.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .root_schema import RootSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class BizObjectsSchema(UniversalBaseModel):
+ objects: typing.Optional[typing.List[RootSchema]] = pydantic.Field(default=None)
+ """
+ List of objects
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/business_profile.py b/src/monite/types/business_profile.py
new file mode 100644
index 0000000..f32518e
--- /dev/null
+++ b/src/monite/types/business_profile.py
@@ -0,0 +1,44 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .estimated_monthly_revenue import EstimatedMonthlyRevenue
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class BusinessProfile(UniversalBaseModel):
+ description_of_goods_or_services: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Required for US entities. A free-form description of the products the entity sells (whether online or at offline retail stores) or the services it provides to its customers.
+ """
+
+ estimated_monthly_revenue: typing.Optional[EstimatedMonthlyRevenue] = pydantic.Field(default=None)
+ """
+ Required for US entities. The approximate revenue that the business generates per month.
+ """
+
+ mcc: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The merchant category code of the entity. MCCs are used to classify businesses based on the goods or services they provide.
+ """
+
+ operating_countries: typing.Optional[typing.List[AllowedCountries]] = pydantic.Field(default=None)
+ """
+ Required for US entities. A list of primary countries where the business conducts its operations, such as selling products or providing services. Use two-letter country codes (ISO 3166-2 alpha-2).
+ """
+
+ url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The business's publicly available website.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/button_theme_payload.py b/src/monite/types/button_theme_payload.py
new file mode 100644
index 0000000..6329322
--- /dev/null
+++ b/src/monite/types/button_theme_payload.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ButtonThemePayload(UniversalBaseModel):
+ primary_color: typing.Optional[str] = None
+ primary_hover_color: typing.Optional[str] = None
+ secondary_color: typing.Optional[str] = None
+ secondary_hover_color: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/button_theme_response.py b/src/monite/types/button_theme_response.py
new file mode 100644
index 0000000..63759ef
--- /dev/null
+++ b/src/monite/types/button_theme_response.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ButtonThemeResponse(UniversalBaseModel):
+ primary_color: typing.Optional[str] = None
+ primary_hover_color: typing.Optional[str] = None
+ secondary_color: typing.Optional[str] = None
+ secondary_hover_color: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/card_theme_payload.py b/src/monite/types/card_theme_payload.py
new file mode 100644
index 0000000..11c5d0a
--- /dev/null
+++ b/src/monite/types/card_theme_payload.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CardThemePayload(UniversalBaseModel):
+ background_color: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/card_theme_response.py b/src/monite/types/card_theme_response.py
new file mode 100644
index 0000000..9665dee
--- /dev/null
+++ b/src/monite/types/card_theme_response.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CardThemeResponse(UniversalBaseModel):
+ background_color: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/comment_cursor_fields.py b/src/monite/types/comment_cursor_fields.py
new file mode 100644
index 0000000..623714d
--- /dev/null
+++ b/src/monite/types/comment_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CommentCursorFields = typing.Literal["id"]
diff --git a/src/monite/types/comment_resource.py b/src/monite/types/comment_resource.py
new file mode 100644
index 0000000..b920f43
--- /dev/null
+++ b/src/monite/types/comment_resource.py
@@ -0,0 +1,30 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CommentResource(UniversalBaseModel):
+ id: str
+ created_at: typing.Optional[dt.datetime] = None
+ updated_at: typing.Optional[dt.datetime] = None
+ created_by_entity_user_id: str
+ entity_id: str
+ object_id: str
+ object_type: str
+ reply_to_entity_user_id: typing.Optional[str] = None
+ status: StatusEnum
+ text: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/comment_resource_list.py b/src/monite/types/comment_resource_list.py
new file mode 100644
index 0000000..b52a13a
--- /dev/null
+++ b/src/monite/types/comment_resource_list.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .comment_resource import CommentResource
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CommentResourceList(UniversalBaseModel):
+ data: typing.List[CommentResource]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/common_schema.py b/src/monite/types/common_schema.py
new file mode 100644
index 0000000..992bf90
--- /dev/null
+++ b/src/monite/types/common_schema.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .action_schema import ActionSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CommonSchema(UniversalBaseModel):
+ actions: typing.Optional[typing.List[ActionSchema]] = pydantic.Field(default=None)
+ """
+ List of actions
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/complete_refresh_verification_response.py b/src/monite/types/complete_refresh_verification_response.py
new file mode 100644
index 0000000..7b04516
--- /dev/null
+++ b/src/monite/types/complete_refresh_verification_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .bank_account_verifications import BankAccountVerifications
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class CompleteRefreshVerificationResponse(UniversalBaseModel):
+ verifications: BankAccountVerifications
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/complete_verification_airwallex_plaid_request.py b/src/monite/types/complete_verification_airwallex_plaid_request.py
new file mode 100644
index 0000000..688f2ac
--- /dev/null
+++ b/src/monite/types/complete_verification_airwallex_plaid_request.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .airwallex_plaid_account import AirwallexPlaidAccount
+import pydantic
+from .airwallex_plaid_institution import AirwallexPlaidInstitution
+from .airwallex_mandate import AirwallexMandate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class CompleteVerificationAirwallexPlaidRequest(UniversalBaseModel):
+ account: AirwallexPlaidAccount = pydantic.Field()
+ """
+ The bank account that was selected in the Plaid Modal
+ """
+
+ institution: AirwallexPlaidInstitution = pydantic.Field()
+ """
+ The financial institution that was selected in the Plaid Modal
+ """
+
+ mandate: AirwallexMandate
+ public_token: str = pydantic.Field()
+ """
+ The Plaid Public Token
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/complete_verification_response.py b/src/monite/types/complete_verification_response.py
new file mode 100644
index 0000000..5a27cbc
--- /dev/null
+++ b/src/monite/types/complete_verification_response.py
@@ -0,0 +1,72 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .allowed_countries import AllowedCountries
+from .currency_enum import CurrencyEnum
+from .bank_account_verifications import BankAccountVerifications
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CompleteVerificationResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Deprecated. Use bank_account_id instead.
+ """
+
+ account_holder_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Account holder's name
+ """
+
+ account_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Account number (required if IBAN is not provided)
+ """
+
+ bank_account_id: str
+ bank_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The name of the entity`s bank account.
+ """
+
+ bic: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The BIC of the entity`s bank account.
+ """
+
+ country: typing.Optional[AllowedCountries] = None
+ currency: typing.Optional[CurrencyEnum] = None
+ display_name: typing.Optional[str] = None
+ iban: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The IBAN of the entity`s bank account.
+ """
+
+ is_default: bool = pydantic.Field()
+ """
+ Marks if a bank account should be used by default for the currency. Only 1 can be True for each currency.
+ """
+
+ routing_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Routing number (US)
+ """
+
+ sort_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Sort code (GB)
+ """
+
+ verifications: BankAccountVerifications
+ was_created_by_user_id: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/connection_status.py b/src/monite/types/connection_status.py
new file mode 100644
index 0000000..84a70f0
--- /dev/null
+++ b/src/monite/types/connection_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ConnectionStatus = typing.Union[typing.Literal["connected", "disconnected", "deauthorized", "pending_auth"], typing.Any]
diff --git a/src/monite/types/counterpart_address.py b/src/monite/types/counterpart_address.py
new file mode 100644
index 0000000..e4d464e
--- /dev/null
+++ b/src/monite/types/counterpart_address.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .allowed_countries import AllowedCountries
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartAddress(UniversalBaseModel):
+ """
+ Address information.
+ """
+
+ city: str = pydantic.Field()
+ """
+ City name.
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ line1: str = pydantic.Field()
+ """
+ Street address.
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Additional address information (if any).
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ ZIP or postal code.
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, region, province, or county.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_address_resource_list.py b/src/monite/types/counterpart_address_resource_list.py
new file mode 100644
index 0000000..e157006
--- /dev/null
+++ b/src/monite/types/counterpart_address_resource_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .counterpart_address_response_with_counterpart_id import CounterpartAddressResponseWithCounterpartId
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CounterpartAddressResourceList(UniversalBaseModel):
+ data: typing.List[CounterpartAddressResponseWithCounterpartId]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_address_response_with_counterpart_id.py b/src/monite/types/counterpart_address_response_with_counterpart_id.py
new file mode 100644
index 0000000..8126968
--- /dev/null
+++ b/src/monite/types/counterpart_address_response_with_counterpart_id.py
@@ -0,0 +1,62 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .allowed_countries import AllowedCountries
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartAddressResponseWithCounterpartId(UniversalBaseModel):
+ """
+ Address information.
+ """
+
+ id: str = pydantic.Field()
+ """
+ Unique ID of the address in the system
+ """
+
+ city: str = pydantic.Field()
+ """
+ City name.
+ """
+
+ counterpart_id: str = pydantic.Field()
+ """
+ ID of the counterpart that owns the address.
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ line1: str = pydantic.Field()
+ """
+ Street address.
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Additional address information (if any).
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ ZIP or postal code.
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, region, province, or county.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_bank_account_resource_list.py b/src/monite/types/counterpart_bank_account_resource_list.py
new file mode 100644
index 0000000..dc1329a
--- /dev/null
+++ b/src/monite/types/counterpart_bank_account_resource_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .counterpart_bank_account_response import CounterpartBankAccountResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CounterpartBankAccountResourceList(UniversalBaseModel):
+ data: typing.List[CounterpartBankAccountResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_bank_account_response.py b/src/monite/types/counterpart_bank_account_response.py
new file mode 100644
index 0000000..e896422
--- /dev/null
+++ b/src/monite/types/counterpart_bank_account_response.py
@@ -0,0 +1,60 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .allowed_countries import AllowedCountries
+from .currency_enum import CurrencyEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartBankAccountResponse(UniversalBaseModel):
+ id: str
+ account_holder_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The name of the person or business that owns this bank account. Required for US bank accounts to accept ACH payments.
+ """
+
+ account_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank account number. Required for US bank accounts to accept ACH payments. US account numbers contain 9 to 12 digits. UK account numbers typically contain 8 digits.
+ """
+
+ bic: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The BIC/SWIFT code of the bank.
+ """
+
+ counterpart_id: str
+ country: AllowedCountries
+ currency: CurrencyEnum
+ iban: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The IBAN of the bank account.
+ """
+
+ is_default_for_currency: typing.Optional[bool] = None
+ name: typing.Optional[str] = None
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs.
+ """
+
+ routing_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank's routing transit number (RTN). Required for US bank accounts to accept ACH payments. US routing numbers consist of 9 digits.
+ """
+
+ sort_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank's sort code.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_contact_response.py b/src/monite/types/counterpart_contact_response.py
new file mode 100644
index 0000000..9bc6c1c
--- /dev/null
+++ b/src/monite/types/counterpart_contact_response.py
@@ -0,0 +1,55 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .counterpart_address import CounterpartAddress
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartContactResponse(UniversalBaseModel):
+ """
+ The contact person for an organization.
+ """
+
+ id: str
+ address: CounterpartAddress = pydantic.Field()
+ """
+ The address of a contact person.
+ """
+
+ counterpart_id: str
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address of a contact person.
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The first name of a contact person.
+ """
+
+ is_default: bool
+ last_name: str = pydantic.Field()
+ """
+ The last name of a contact person.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The phone number of a contact person
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The title or honorific of a contact person. Examples: Mr., Ms., Dr., Prof.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_contacts_resource_list.py b/src/monite/types/counterpart_contacts_resource_list.py
new file mode 100644
index 0000000..fbc5167
--- /dev/null
+++ b/src/monite/types/counterpart_contacts_resource_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .counterpart_contact_response import CounterpartContactResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CounterpartContactsResourceList(UniversalBaseModel):
+ data: typing.List[CounterpartContactResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_create_payload.py b/src/monite/types/counterpart_create_payload.py
new file mode 100644
index 0000000..94883cf
--- /dev/null
+++ b/src/monite/types/counterpart_create_payload.py
@@ -0,0 +1,59 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .language_code_enum import LanguageCodeEnum
+from .counterpart_organization_create_payload import CounterpartOrganizationCreatePayload
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+from .counterpart_individual_create_payload import CounterpartIndividualCreatePayload
+
+
+class CounterpartCreatePayload_Organization(UniversalBaseModel):
+ """
+ This schema is used to create new counterparts (either organizations or individuals).
+ The counterpart type is specified by the `type` property. Depending on the `type`,
+ you need to provide the data for either the `individual` or `organization` property.
+ """
+
+ type: typing.Literal["organization"] = "organization"
+ language: typing.Optional[LanguageCodeEnum] = None
+ organization: CounterpartOrganizationCreatePayload
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class CounterpartCreatePayload_Individual(UniversalBaseModel):
+ """
+ This schema is used to create new counterparts (either organizations or individuals).
+ The counterpart type is specified by the `type` property. Depending on the `type`,
+ you need to provide the data for either the `individual` or `organization` property.
+ """
+
+ type: typing.Literal["individual"] = "individual"
+ individual: CounterpartIndividualCreatePayload
+ language: typing.Optional[LanguageCodeEnum] = None
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+CounterpartCreatePayload = typing.Union[CounterpartCreatePayload_Organization, CounterpartCreatePayload_Individual]
diff --git a/src/monite/types/counterpart_cursor_fields.py b/src/monite/types/counterpart_cursor_fields.py
new file mode 100644
index 0000000..1005b0c
--- /dev/null
+++ b/src/monite/types/counterpart_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CounterpartCursorFields = typing.Literal["counterpart_name"]
diff --git a/src/monite/types/counterpart_individual_create_payload.py b/src/monite/types/counterpart_individual_create_payload.py
new file mode 100644
index 0000000..ae0b87e
--- /dev/null
+++ b/src/monite/types/counterpart_individual_create_payload.py
@@ -0,0 +1,67 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .counterpart_address import CounterpartAddress
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartIndividualCreatePayload(UniversalBaseModel):
+ """
+ Represents counterparts that are individuals (natural persons).
+ """
+
+ address: CounterpartAddress = pydantic.Field()
+ """
+ The person's address.
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's email address.
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The person's first name.
+ """
+
+ is_customer: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ last_name: str = pydantic.Field()
+ """
+ The person's last name.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's phone number.
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this counterpart.
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's title or honorific. Examples: Mr., Ms., Dr., Prof.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_individual_response.py b/src/monite/types/counterpart_individual_response.py
new file mode 100644
index 0000000..2ceddbc
--- /dev/null
+++ b/src/monite/types/counterpart_individual_response.py
@@ -0,0 +1,62 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .counterpart_tag_schema import CounterpartTagSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartIndividualResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are individuals (natural persons).
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's email address.
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The person's first name.
+ """
+
+ is_customer: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ last_name: str = pydantic.Field()
+ """
+ The person's last name.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's phone number.
+ """
+
+ tags: typing.Optional[typing.List[CounterpartTagSchema]] = pydantic.Field(default=None)
+ """
+ The list of tags for this counterpart.
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's title or honorific. Examples: Mr., Ms., Dr., Prof.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_individual_root_create_payload.py b/src/monite/types/counterpart_individual_root_create_payload.py
new file mode 100644
index 0000000..557a9ff
--- /dev/null
+++ b/src/monite/types/counterpart_individual_root_create_payload.py
@@ -0,0 +1,35 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .counterpart_individual_create_payload import CounterpartIndividualCreatePayload
+import typing
+from .language_code_enum import LanguageCodeEnum
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartIndividualRootCreatePayload(UniversalBaseModel):
+ """
+ This schema is used to create counterparts that are individuals (natural persons).
+ """
+
+ individual: CounterpartIndividualCreatePayload
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_individual_root_response.py b/src/monite/types/counterpart_individual_root_response.py
new file mode 100644
index 0000000..4209f52
--- /dev/null
+++ b/src/monite/types/counterpart_individual_root_response.py
@@ -0,0 +1,77 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .counterpart_individual_response import CounterpartIndividualResponse
+from .language_code_enum import LanguageCodeEnum
+from .counterpart_type import CounterpartType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartIndividualRootResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are individuals (natural persons).
+ """
+
+ id: str = pydantic.Field()
+ """
+ Unique ID of the counterpart.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was created. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was last updated. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ created_automatically: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ `true` if the counterpart was created automatically by Monite when processing incoming invoices with OCR. `false` if the counterpart was created by the API client.
+ """
+
+ default_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the counterpart's billing address. If the counterpart is US-based and needs to accept ACH payments, this address must have all fields filled in. If `default_billing_address_id` is not defined, the default address is instead used as the billing address for ACH payments.
+ """
+
+ default_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the shipping address.
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity user ID of counterpart creator.
+ """
+
+ individual: CounterpartIndividualResponse
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ type: CounterpartType = pydantic.Field()
+ """
+ The counterpart type: `organization` (juridical person) or `individual` (natural person).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_individual_root_update_payload.py b/src/monite/types/counterpart_individual_root_update_payload.py
new file mode 100644
index 0000000..85497e4
--- /dev/null
+++ b/src/monite/types/counterpart_individual_root_update_payload.py
@@ -0,0 +1,45 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .counterpart_individual_update_payload import CounterpartIndividualUpdatePayload
+from .language_code_enum import LanguageCodeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartIndividualRootUpdatePayload(UniversalBaseModel):
+ """
+ Represents counterparts that are individuals (natural persons).
+ """
+
+ default_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the counterpart's billing address. If the counterpart is US-based and needs to accept ACH payments, this address must have all fields filled in. If `default_billing_address_id` is not defined, the default address is instead used as the billing address for ACH payments.
+ """
+
+ default_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the shipping address.
+ """
+
+ individual: CounterpartIndividualUpdatePayload
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_individual_update_payload.py b/src/monite/types/counterpart_individual_update_payload.py
new file mode 100644
index 0000000..2143af5
--- /dev/null
+++ b/src/monite/types/counterpart_individual_update_payload.py
@@ -0,0 +1,61 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartIndividualUpdatePayload(UniversalBaseModel):
+ """
+ Represents counterparts that are individuals (natural persons).
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's email address.
+ """
+
+ first_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's first name.
+ """
+
+ is_customer: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ last_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's last name.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's phone number.
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this counterpart.
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's title or honorific. Examples: Mr., Ms., Dr., Prof.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_organization_create_payload.py b/src/monite/types/counterpart_organization_create_payload.py
new file mode 100644
index 0000000..b3afdb1
--- /dev/null
+++ b/src/monite/types/counterpart_organization_create_payload.py
@@ -0,0 +1,57 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .counterpart_address import CounterpartAddress
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartOrganizationCreatePayload(UniversalBaseModel):
+ """
+ Represents counterparts that are organizations (juridical persons).
+ """
+
+ address: CounterpartAddress = pydantic.Field()
+ """
+ The address of the organization.
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address of the organization
+ """
+
+ is_customer: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ legal_name: str = pydantic.Field()
+ """
+ The legal name of the organization.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The phone number of the organization
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this counterpart.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_organization_response.py b/src/monite/types/counterpart_organization_response.py
new file mode 100644
index 0000000..49183b5
--- /dev/null
+++ b/src/monite/types/counterpart_organization_response.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .counterpart_tag_schema import CounterpartTagSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartOrganizationResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are organizations (juridical persons).
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address of the organization
+ """
+
+ is_customer: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ legal_name: str = pydantic.Field()
+ """
+ The legal name of the organization.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The phone number of the organization
+ """
+
+ tags: typing.Optional[typing.List[CounterpartTagSchema]] = pydantic.Field(default=None)
+ """
+ The list of tags for this counterpart.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_organization_root_create_payload.py b/src/monite/types/counterpart_organization_root_create_payload.py
new file mode 100644
index 0000000..c55ff16
--- /dev/null
+++ b/src/monite/types/counterpart_organization_root_create_payload.py
@@ -0,0 +1,35 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .language_code_enum import LanguageCodeEnum
+import pydantic
+from .counterpart_organization_create_payload import CounterpartOrganizationCreatePayload
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartOrganizationRootCreatePayload(UniversalBaseModel):
+ """
+ This schema is used to create counterparts that are organizations (juridical persons).
+ """
+
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ organization: CounterpartOrganizationCreatePayload
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_organization_root_response.py b/src/monite/types/counterpart_organization_root_response.py
new file mode 100644
index 0000000..6364238
--- /dev/null
+++ b/src/monite/types/counterpart_organization_root_response.py
@@ -0,0 +1,77 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .language_code_enum import LanguageCodeEnum
+from .counterpart_organization_response import CounterpartOrganizationResponse
+from .counterpart_type import CounterpartType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartOrganizationRootResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are organizations (juridical persons).
+ """
+
+ id: str = pydantic.Field()
+ """
+ Unique ID of the counterpart.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was created. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was last updated. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ created_automatically: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ `true` if the counterpart was created automatically by Monite when processing incoming invoices with OCR. `false` if the counterpart was created by the API client.
+ """
+
+ default_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the counterpart's billing address. If the counterpart is US-based and needs to accept ACH payments, this address must have all fields filled in. If `default_billing_address_id` is not defined, the default address is instead used as the billing address for ACH payments.
+ """
+
+ default_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the shipping address.
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity user ID of counterpart creator.
+ """
+
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ organization: CounterpartOrganizationResponse
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ type: CounterpartType = pydantic.Field()
+ """
+ The counterpart type: `organization` (juridical person) or `individual` (natural person).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_organization_root_update_payload.py b/src/monite/types/counterpart_organization_root_update_payload.py
new file mode 100644
index 0000000..ba1bec5
--- /dev/null
+++ b/src/monite/types/counterpart_organization_root_update_payload.py
@@ -0,0 +1,45 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .language_code_enum import LanguageCodeEnum
+from .counterpart_organization_update_payload import CounterpartOrganizationUpdatePayload
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartOrganizationRootUpdatePayload(UniversalBaseModel):
+ """
+ Represents counterparts that are organizations (juridical persons).
+ """
+
+ default_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the counterpart's billing address. If the counterpart is US-based and needs to accept ACH payments, this address must have all fields filled in. If `default_billing_address_id` is not defined, the default address is instead used as the billing address for ACH payments.
+ """
+
+ default_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the shipping address.
+ """
+
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ organization: CounterpartOrganizationUpdatePayload
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_organization_update_payload.py b/src/monite/types/counterpart_organization_update_payload.py
new file mode 100644
index 0000000..077cc8f
--- /dev/null
+++ b/src/monite/types/counterpart_organization_update_payload.py
@@ -0,0 +1,51 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartOrganizationUpdatePayload(UniversalBaseModel):
+ """
+ Represents counterparts that are organizations (juridical persons).
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address of the organization.
+ """
+
+ is_customer: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ legal_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The legal name of the organization.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The phone number of the organization.
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this counterpart.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_pagination_response.py b/src/monite/types/counterpart_pagination_response.py
new file mode 100644
index 0000000..1ba4b06
--- /dev/null
+++ b/src/monite/types/counterpart_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .counterpart_response import CounterpartResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartPaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of counterparts
+ """
+
+ data: typing.List[CounterpartResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_address.py b/src/monite/types/counterpart_raw_address.py
new file mode 100644
index 0000000..f0f2001
--- /dev/null
+++ b/src/monite/types/counterpart_raw_address.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartRawAddress(UniversalBaseModel):
+ """
+ Address information.
+ """
+
+ city: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ City name.
+ """
+
+ country: typing.Optional[AllowedCountries] = pydantic.Field(default=None)
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ line1: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Street address.
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Additional address information (if any).
+ """
+
+ postal_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ZIP or postal code.
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, region, province, or county.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_address_update_request.py b/src/monite/types/counterpart_raw_address_update_request.py
new file mode 100644
index 0000000..7471335
--- /dev/null
+++ b/src/monite/types/counterpart_raw_address_update_request.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartRawAddressUpdateRequest(UniversalBaseModel):
+ """
+ Address information.
+ """
+
+ city: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ City name.
+ """
+
+ country: typing.Optional[AllowedCountries] = pydantic.Field(default=None)
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ line1: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Street address.
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Additional address information (if any).
+ """
+
+ postal_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ZIP or postal code.
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, region, province, or county.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_bank_account.py b/src/monite/types/counterpart_raw_bank_account.py
new file mode 100644
index 0000000..9b74c58
--- /dev/null
+++ b/src/monite/types/counterpart_raw_bank_account.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartRawBankAccount(UniversalBaseModel):
+ account_holder_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Vendor's bank account name.
+ """
+
+ account_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Vendor's bank account number, IBAN, or similar (if specified in the payable document).
+ """
+
+ bic: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ SWIFT code (BIC) of the vendor's bank.
+ """
+
+ iban: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ required for non-GB bank accounts
+ """
+
+ sort_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ required for GB bank accounts
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_bank_account_update_request.py b/src/monite/types/counterpart_raw_bank_account_update_request.py
new file mode 100644
index 0000000..810904a
--- /dev/null
+++ b/src/monite/types/counterpart_raw_bank_account_update_request.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartRawBankAccountUpdateRequest(UniversalBaseModel):
+ account_holder_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Vendor's bank account name.
+ """
+
+ account_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Vendor's bank account number, IBAN, or similar (if specified in the payable document).
+ """
+
+ bic: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ SWIFT code (BIC) of the vendor's bank.
+ """
+
+ iban: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ required for non-GB bank accounts
+ """
+
+ sort_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ required for GB bank accounts
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_data.py b/src/monite/types/counterpart_raw_data.py
new file mode 100644
index 0000000..6d5225d
--- /dev/null
+++ b/src/monite/types/counterpart_raw_data.py
@@ -0,0 +1,55 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .counterpart_raw_address import CounterpartRawAddress
+import pydantic
+from .counterpart_raw_bank_account import CounterpartRawBankAccount
+from .counterpart_raw_vat_id import CounterpartRawVatId
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartRawData(UniversalBaseModel):
+ address: typing.Optional[CounterpartRawAddress] = pydantic.Field(default=None)
+ """
+ The address of the vendor or supplier.
+ """
+
+ bank_account: typing.Optional[CounterpartRawBankAccount] = pydantic.Field(default=None)
+ """
+ Object representing counterpart bank account.
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address of the organization
+ """
+
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Vendor or supplier name.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The phone number of the organization
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The tax id of the counterpart.
+ """
+
+ vat_id: typing.Optional[CounterpartRawVatId] = pydantic.Field(default=None)
+ """
+ VAT ID of the vendor or supplier which was used in the invoice.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_data_update_request.py b/src/monite/types/counterpart_raw_data_update_request.py
new file mode 100644
index 0000000..8f6d122
--- /dev/null
+++ b/src/monite/types/counterpart_raw_data_update_request.py
@@ -0,0 +1,55 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .counterpart_raw_address_update_request import CounterpartRawAddressUpdateRequest
+import pydantic
+from .counterpart_raw_bank_account_update_request import CounterpartRawBankAccountUpdateRequest
+from .counterpart_raw_vat_id_update_request import CounterpartRawVatIdUpdateRequest
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartRawDataUpdateRequest(UniversalBaseModel):
+ address: typing.Optional[CounterpartRawAddressUpdateRequest] = pydantic.Field(default=None)
+ """
+ The address of the vendor or supplier.
+ """
+
+ bank_account: typing.Optional[CounterpartRawBankAccountUpdateRequest] = pydantic.Field(default=None)
+ """
+ Object representing counterpart bank account.
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address of the organization
+ """
+
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Vendor or supplier name.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The phone number of the organization
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The tax id of the counterpart.
+ """
+
+ vat_id: typing.Optional[CounterpartRawVatIdUpdateRequest] = pydantic.Field(default=None)
+ """
+ VAT ID of the vendor or supplier which was used in the invoice.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_vat_id.py b/src/monite/types/counterpart_raw_vat_id.py
new file mode 100644
index 0000000..6c59e8d
--- /dev/null
+++ b/src/monite/types/counterpart_raw_vat_id.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CounterpartRawVatId(UniversalBaseModel):
+ country: typing.Optional[AllowedCountries] = None
+ type: typing.Optional[str] = None
+ value: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_raw_vat_id_update_request.py b/src/monite/types/counterpart_raw_vat_id_update_request.py
new file mode 100644
index 0000000..10cfe5e
--- /dev/null
+++ b/src/monite/types/counterpart_raw_vat_id_update_request.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CounterpartRawVatIdUpdateRequest(UniversalBaseModel):
+ country: typing.Optional[AllowedCountries] = None
+ type: typing.Optional[str] = None
+ value: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_response.py b/src/monite/types/counterpart_response.py
new file mode 100644
index 0000000..c662230
--- /dev/null
+++ b/src/monite/types/counterpart_response.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .counterpart_individual_root_response import CounterpartIndividualRootResponse
+from .counterpart_organization_root_response import CounterpartOrganizationRootResponse
+
+CounterpartResponse = typing.Union[CounterpartIndividualRootResponse, CounterpartOrganizationRootResponse]
diff --git a/src/monite/types/counterpart_tag_category.py b/src/monite/types/counterpart_tag_category.py
new file mode 100644
index 0000000..38dc0b7
--- /dev/null
+++ b/src/monite/types/counterpart_tag_category.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CounterpartTagCategory = typing.Union[
+ typing.Literal[
+ "document_type", "department", "project", "cost_center", "vendor_type", "payment_method", "approval_status"
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/counterpart_tag_schema.py b/src/monite/types/counterpart_tag_schema.py
new file mode 100644
index 0000000..7d291b3
--- /dev/null
+++ b/src/monite/types/counterpart_tag_schema.py
@@ -0,0 +1,58 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .counterpart_tag_category import CounterpartTagCategory
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CounterpartTagSchema(UniversalBaseModel):
+ """
+ Represents a user-defined tag that can be assigned to resources to filter them.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of this tag.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the tag was created. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the tag was last updated. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ category: typing.Optional[CounterpartTagCategory] = pydantic.Field(default=None)
+ """
+ The tag category.
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the user who created the tag
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The tag description.
+ """
+
+ name: str = pydantic.Field()
+ """
+ The tag name.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_type.py b/src/monite/types/counterpart_type.py
new file mode 100644
index 0000000..2b8e530
--- /dev/null
+++ b/src/monite/types/counterpart_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CounterpartType = typing.Union[typing.Literal["individual", "organization"], typing.Any]
diff --git a/src/monite/types/counterpart_update_payload.py b/src/monite/types/counterpart_update_payload.py
new file mode 100644
index 0000000..a3fd09c
--- /dev/null
+++ b/src/monite/types/counterpart_update_payload.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .counterpart_individual_root_update_payload import CounterpartIndividualRootUpdatePayload
+from .counterpart_organization_root_update_payload import CounterpartOrganizationRootUpdatePayload
+
+CounterpartUpdatePayload = typing.Union[
+ CounterpartIndividualRootUpdatePayload, CounterpartOrganizationRootUpdatePayload
+]
diff --git a/src/monite/types/counterpart_vat_id_resource_list.py b/src/monite/types/counterpart_vat_id_resource_list.py
new file mode 100644
index 0000000..4c8cfee
--- /dev/null
+++ b/src/monite/types/counterpart_vat_id_resource_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .counterpart_vat_id_response import CounterpartVatIdResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CounterpartVatIdResourceList(UniversalBaseModel):
+ data: typing.List[CounterpartVatIdResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/counterpart_vat_id_response.py b/src/monite/types/counterpart_vat_id_response.py
new file mode 100644
index 0000000..b4bc596
--- /dev/null
+++ b/src/monite/types/counterpart_vat_id_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .allowed_countries import AllowedCountries
+from .vat_id_type_enum import VatIdTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CounterpartVatIdResponse(UniversalBaseModel):
+ id: str
+ counterpart_id: str
+ country: typing.Optional[AllowedCountries] = None
+ type: typing.Optional[VatIdTypeEnum] = None
+ value: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/create_export_task_response_schema.py b/src/monite/types/create_export_task_response_schema.py
new file mode 100644
index 0000000..2bd7051
--- /dev/null
+++ b/src/monite/types/create_export_task_response_schema.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class CreateExportTaskResponseSchema(UniversalBaseModel):
+ id: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/create_onboarding_link_request.py b/src/monite/types/create_onboarding_link_request.py
new file mode 100644
index 0000000..8fd2c8c
--- /dev/null
+++ b/src/monite/types/create_onboarding_link_request.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .recipient import Recipient
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class CreateOnboardingLinkRequest(UniversalBaseModel):
+ recipient: Recipient
+ refresh_url: str
+ return_url: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/credit_note_response_payload.py b/src/monite/types/credit_note_response_payload.py
new file mode 100644
index 0000000..8fb8a2d
--- /dev/null
+++ b/src/monite/types/credit_note_response_payload.py
@@ -0,0 +1,257 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import pydantic
+import typing
+from .receivables_representation_of_counterpart_address import ReceivablesRepresentationOfCounterpartAddress
+from .receivable_counterpart_contact import ReceivableCounterpartContact
+from .receivable_counterpart_type import ReceivableCounterpartType
+from .receivable_counterpart_vat_id_response import ReceivableCounterpartVatIdResponse
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .credit_note_response_payload_entity import CreditNoteResponsePayloadEntity
+from .receivable_entity_address_schema import ReceivableEntityAddressSchema
+from .receivables_representation_of_entity_bank_account import ReceivablesRepresentationOfEntityBankAccount
+from .receivable_entity_vat_id_response import ReceivableEntityVatIdResponse
+from .receivable_file_schema import ReceivableFileSchema
+from .language_code_enum import LanguageCodeEnum
+from .response_item import ResponseItem
+from .credit_note_state_enum import CreditNoteStateEnum
+from .tag_read_schema import TagReadSchema
+from .total_vat_amount_item import TotalVatAmountItem
+from .vat_mode_enum import VatModeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CreditNoteResponsePayload(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ based_on: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique ID of a previous document related to the receivable if applicable.
+ """
+
+ based_on_document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique document ID of a previous document related to the receivable if applicable.
+ """
+
+ commercial_condition_description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The commercial terms of the receivable (e.g. The products must be delivered in X days).
+ """
+
+ counterpart_billing_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = pydantic.Field(
+ default=None
+ )
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_business_type: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Different types of companies for different countries, ex. GmbH, SAS, SNC, etc.
+ """
+
+ counterpart_contact: typing.Optional[ReceivableCounterpartContact] = pydantic.Field(default=None)
+ """
+ Additional information about counterpart contacts.
+ """
+
+ counterpart_id: str = pydantic.Field()
+ """
+ Unique ID of the counterpart.
+ """
+
+ counterpart_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A legal name of a counterpart it is an organization or first and last name if it is an individual
+ """
+
+ counterpart_shipping_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = pydantic.Field(
+ default=None
+ )
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ counterpart_tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The VAT/TAX ID of the counterpart.
+ """
+
+ counterpart_type: ReceivableCounterpartType = pydantic.Field()
+ """
+ The type of the counterpart.
+ """
+
+ counterpart_vat_id: typing.Optional[ReceivableCounterpartVatIdResponse] = None
+ currency: CurrencyEnum = pydantic.Field()
+ """
+ The currency used in the receivable.
+ """
+
+ deduction_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax deducted in minor units
+ """
+
+ deduction_memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information about a tax deduction
+ """
+
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a receivable.
+ """
+
+ discounted_subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable with discounts before taxes [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The sequential code systematically assigned to invoices.
+ """
+
+ due_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Optional field representing date until which invoice should be paid
+ """
+
+ entity: CreditNoteResponsePayloadEntity
+ entity_address: ReceivableEntityAddressSchema
+ entity_bank_account: typing.Optional[ReceivablesRepresentationOfEntityBankAccount] = None
+ entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity user who created this document.
+ """
+
+ entity_vat_id: typing.Optional[ReceivableEntityVatIdResponse] = None
+ file: typing.Optional[ReceivableFileSchema] = None
+ file_language: LanguageCodeEnum = pydantic.Field()
+ """
+ The language of the customer-facing PDF file (`file_url`). The value matches the counterpart's `language` at the time when this PDF file was generated.
+ """
+
+ file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the counterpart's default language.
+ """
+
+ issue_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ Optional field for the issue of the entry.
+ """
+
+ line_items: typing.List[ResponseItem]
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable.
+ """
+
+ original_file_language: LanguageCodeEnum = pydantic.Field()
+ """
+ The language of the entity's copy of the PDF file (`original_file_url`). The value matches the entity's `language` at the time when this PDF file was generated.
+ """
+
+ original_file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the entity's default language.
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ purchase_order: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Contain purchase order number.
+ """
+
+ status: CreditNoteStateEnum = pydantic.Field()
+ """
+ The status of the Credit Note inside the receivable workflow.
+ """
+
+ subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ tags: typing.Optional[typing.List[TagReadSchema]] = pydantic.Field(default=None)
+ """
+ The list of tags for this receivable.
+ """
+
+ total_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units). Calculated as a subtotal + total_vat_amount.
+ """
+
+ total_vat_amount: int = pydantic.Field()
+ """
+ The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ total_vat_amounts: typing.Optional[typing.List[TotalVatAmountItem]] = pydantic.Field(default=None)
+ """
+ List of total vat amount for each VAT, presented in receivable
+ """
+
+ total_withholding_tax: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable with tax withheld in minor units
+ """
+
+ trade_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Trade name of the entity
+ """
+
+ vat_exempt: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the goods, materials, or services listed in the receivable are exempt from VAT or not.
+ """
+
+ vat_exemption_rationale: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The reason for the VAT exemption, if applicable.
+ """
+
+ vat_mode: typing.Optional[VatModeEnum] = pydantic.Field(default=None)
+ """
+ Defines whether the prices of products in receivable will already include VAT or not.
+ """
+
+ withholding_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax withheld in percent minor units
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/credit_note_response_payload_entity.py b/src/monite/types/credit_note_response_payload_entity.py
new file mode 100644
index 0000000..c4f560f
--- /dev/null
+++ b/src/monite/types/credit_note_response_payload_entity.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CreditNoteResponsePayloadEntity_Organization(UniversalBaseModel):
+ type: typing.Literal["organization"] = "organization"
+ email: typing.Optional[str] = None
+ logo: typing.Optional[str] = None
+ name: str
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ vat_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class CreditNoteResponsePayloadEntity_Individual(UniversalBaseModel):
+ type: typing.Literal["individual"] = "individual"
+ email: typing.Optional[str] = None
+ first_name: str
+ last_name: str
+ logo: typing.Optional[str] = None
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+CreditNoteResponsePayloadEntity = typing.Union[
+ CreditNoteResponsePayloadEntity_Organization, CreditNoteResponsePayloadEntity_Individual
+]
diff --git a/src/monite/types/credit_note_state_enum.py b/src/monite/types/credit_note_state_enum.py
new file mode 100644
index 0000000..f1d5020
--- /dev/null
+++ b/src/monite/types/credit_note_state_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CreditNoteStateEnum = typing.Union[typing.Literal["draft", "issued", "deleted"], typing.Any]
diff --git a/src/monite/types/currency_enum.py b/src/monite/types/currency_enum.py
new file mode 100644
index 0000000..24b5c77
--- /dev/null
+++ b/src/monite/types/currency_enum.py
@@ -0,0 +1,145 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CurrencyEnum = typing.Union[
+ typing.Literal[
+ "AED",
+ "AFN",
+ "ALL",
+ "AMD",
+ "ANG",
+ "AOA",
+ "ARS",
+ "AUD",
+ "AWG",
+ "AZN",
+ "BAM",
+ "BBD",
+ "BDT",
+ "BGN",
+ "BHD",
+ "BIF",
+ "BND",
+ "BOB",
+ "BRL",
+ "BSD",
+ "BWP",
+ "BYN",
+ "BZD",
+ "CAD",
+ "CDF",
+ "CHF",
+ "CLP",
+ "CNY",
+ "COP",
+ "CRC",
+ "CVE",
+ "CZK",
+ "DJF",
+ "DKK",
+ "DOP",
+ "DZD",
+ "EGP",
+ "ETB",
+ "EUR",
+ "FJD",
+ "GBP",
+ "GEL",
+ "GIP",
+ "GMD",
+ "GNF",
+ "GTQ",
+ "GYD",
+ "HKD",
+ "HNL",
+ "HRK",
+ "HTG",
+ "HUF",
+ "IDR",
+ "ILS",
+ "INR",
+ "ISK",
+ "JMD",
+ "JOD",
+ "JPY",
+ "KES",
+ "KGS",
+ "KHR",
+ "KMF",
+ "KRW",
+ "KWD",
+ "KYD",
+ "KZT",
+ "LAK",
+ "LBP",
+ "LKR",
+ "LRD",
+ "LSL",
+ "MAD",
+ "MDL",
+ "MGA",
+ "MKD",
+ "MMK",
+ "MNT",
+ "MOP",
+ "MUR",
+ "MVR",
+ "MWK",
+ "MXN",
+ "MYR",
+ "MZN",
+ "NAD",
+ "NGN",
+ "NIO",
+ "NOK",
+ "NPR",
+ "NZD",
+ "OMR",
+ "PAB",
+ "PEN",
+ "PGK",
+ "PHP",
+ "PKR",
+ "PLN",
+ "PYG",
+ "QAR",
+ "RON",
+ "RSD",
+ "RUB",
+ "RWF",
+ "SAR",
+ "SBD",
+ "SCR",
+ "SEK",
+ "SGD",
+ "SLL",
+ "SOS",
+ "SRD",
+ "SZL",
+ "THB",
+ "TJS",
+ "TND",
+ "TOP",
+ "TRY",
+ "TTD",
+ "TWD",
+ "TZS",
+ "UAH",
+ "UGX",
+ "USD",
+ "UYU",
+ "UZS",
+ "VND",
+ "VUV",
+ "WST",
+ "XAF",
+ "XCD",
+ "XOF",
+ "XPF",
+ "YER",
+ "ZAR",
+ "ZMW",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/currency_exchange_schema.py b/src/monite/types/currency_exchange_schema.py
new file mode 100644
index 0000000..476746d
--- /dev/null
+++ b/src/monite/types/currency_exchange_schema.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class CurrencyExchangeSchema(UniversalBaseModel):
+ default_currency_code: str
+ rate: float
+ total: float
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/currency_settings.py b/src/monite/types/currency_settings.py
new file mode 100644
index 0000000..22e71e7
--- /dev/null
+++ b/src/monite/types/currency_settings.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .currency_enum import CurrencyEnum
+import typing
+from .exchange_rate import ExchangeRate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class CurrencySettings(UniversalBaseModel):
+ default: CurrencyEnum
+ exchange_rates: typing.Optional[typing.List[ExchangeRate]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/custom_template_data_schema.py b/src/monite/types/custom_template_data_schema.py
new file mode 100644
index 0000000..6c0b780
--- /dev/null
+++ b/src/monite/types/custom_template_data_schema.py
@@ -0,0 +1,63 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class CustomTemplateDataSchema(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ ID of email template
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Template created date and time
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Template updated date and time
+ """
+
+ body_template: str = pydantic.Field()
+ """
+ Jinja2 compatible email body template
+ """
+
+ is_default: bool = pydantic.Field()
+ """
+ Is default template
+ """
+
+ language: str = pydantic.Field()
+ """
+ Lowercase ISO code of language
+ """
+
+ name: str = pydantic.Field()
+ """
+ Name of the template
+ """
+
+ subject_template: str = pydantic.Field()
+ """
+ Jinja2 compatible email subject template
+ """
+
+ type: str = pydantic.Field()
+ """
+ Document type of content
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/custom_templates_cursor_fields.py b/src/monite/types/custom_templates_cursor_fields.py
new file mode 100644
index 0000000..f39158f
--- /dev/null
+++ b/src/monite/types/custom_templates_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+CustomTemplatesCursorFields = typing.Union[typing.Literal["type", "name"], typing.Any]
diff --git a/src/monite/types/custom_templates_pagination_response.py b/src/monite/types/custom_templates_pagination_response.py
new file mode 100644
index 0000000..26a8594
--- /dev/null
+++ b/src/monite/types/custom_templates_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .custom_template_data_schema import CustomTemplateDataSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class CustomTemplatesPaginationResponse(UniversalBaseModel):
+ data: typing.List[CustomTemplateDataSchema] = pydantic.Field()
+ """
+ All user-defined email templates
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/data_export_cursor_fields.py b/src/monite/types/data_export_cursor_fields.py
new file mode 100644
index 0000000..66d5bdd
--- /dev/null
+++ b/src/monite/types/data_export_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DataExportCursorFields = typing.Literal["created_at"]
diff --git a/src/monite/types/day_of_month.py b/src/monite/types/day_of_month.py
new file mode 100644
index 0000000..4915824
--- /dev/null
+++ b/src/monite/types/day_of_month.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DayOfMonth = typing.Union[typing.Literal["first_day", "last_day"], typing.Any]
diff --git a/src/monite/types/discount.py b/src/monite/types/discount.py
new file mode 100644
index 0000000..6f78e26
--- /dev/null
+++ b/src/monite/types/discount.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .discount_type import DiscountType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class Discount(UniversalBaseModel):
+ amount: int = pydantic.Field()
+ """
+ The actual discount of the product in [minor units](https://docs.monite.com/docs/currencies#minor-units) if type field equals amount, else in percent minor units
+ """
+
+ type: DiscountType = pydantic.Field()
+ """
+ The field specifies whether to use product currency or %.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/discount_type.py b/src/monite/types/discount_type.py
new file mode 100644
index 0000000..5bdc402
--- /dev/null
+++ b/src/monite/types/discount_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DiscountType = typing.Union[typing.Literal["amount", "percentage"], typing.Any]
diff --git a/src/monite/types/dns_record.py b/src/monite/types/dns_record.py
new file mode 100644
index 0000000..f33e3f1
--- /dev/null
+++ b/src/monite/types/dns_record.py
@@ -0,0 +1,34 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .dns_record_purpose import DnsRecordPurpose
+import pydantic
+from .dns_record_type import DnsRecordType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class DnsRecord(UniversalBaseModel):
+ is_active: bool
+ name: typing.Optional[str] = None
+ record_purpose: typing.Optional[DnsRecordPurpose] = pydantic.Field(default=None)
+ """
+ Purpose of specific entry to distinguish between various TXT entries.
+ """
+
+ record_type: DnsRecordType
+ valid: str = pydantic.Field()
+ """
+ Field reflecting validation status by Mailgun.
+ """
+
+ value: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/dns_record_purpose.py b/src/monite/types/dns_record_purpose.py
new file mode 100644
index 0000000..52632c9
--- /dev/null
+++ b/src/monite/types/dns_record_purpose.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DnsRecordPurpose = typing.Union[typing.Literal["DKIM", "SPF"], typing.Any]
diff --git a/src/monite/types/dns_record_type.py b/src/monite/types/dns_record_type.py
new file mode 100644
index 0000000..82b5c61
--- /dev/null
+++ b/src/monite/types/dns_record_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DnsRecordType = typing.Union[typing.Literal["TXT", "MX", "CNAME"], typing.Any]
diff --git a/src/monite/types/dns_records.py b/src/monite/types/dns_records.py
new file mode 100644
index 0000000..2ad4db5
--- /dev/null
+++ b/src/monite/types/dns_records.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .dns_record import DnsRecord
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class DnsRecords(UniversalBaseModel):
+ receiving_dns_records: typing.List[DnsRecord] = pydantic.Field()
+ """
+ Set of DNS settings required by Mailgun for domain verification before emails receiving is possible.
+ """
+
+ sending_dns_records: typing.List[DnsRecord] = pydantic.Field()
+ """
+ Set of DNS settings required by Mailgun for domain verification before emails sending is possible.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/document_export_response_schema.py b/src/monite/types/document_export_response_schema.py
new file mode 100644
index 0000000..2d1319e
--- /dev/null
+++ b/src/monite/types/document_export_response_schema.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class DocumentExportResponseSchema(UniversalBaseModel):
+ id: str
+ count: int
+ created_by_entity_user_id: typing.Optional[str] = None
+ end_datetime: typing.Optional[dt.datetime] = None
+ entity_id: str
+ format: str
+ language: str
+ source_url: typing.Optional[str] = None
+ start_datetime: typing.Optional[dt.datetime] = None
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/document_i_ds_settings.py b/src/monite/types/document_i_ds_settings.py
new file mode 100644
index 0000000..b15fa33
--- /dev/null
+++ b/src/monite/types/document_i_ds_settings.py
@@ -0,0 +1,44 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .document_id_separators import DocumentIdSeparators
+from .document_type_prefix import DocumentTypePrefix
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class DocumentIDsSettings(UniversalBaseModel):
+ include_date: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Optionally add 4-digit of the current year
+ """
+
+ prefix: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Optional prefix. Does not substitute document_type prefix
+ """
+
+ separator: typing.Optional[DocumentIdSeparators] = pydantic.Field(default=None)
+ """
+ Which character should separate each part of the document_id
+ """
+
+ document_type_prefix: typing.Optional[DocumentTypePrefix] = pydantic.Field(default=None)
+ """
+ Prefixes for each document_type
+ """
+
+ min_digits: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Minimal size of number in document ID Number will be left padded with zeros if less
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/document_i_ds_settings_next_number.py b/src/monite/types/document_i_ds_settings_next_number.py
new file mode 100644
index 0000000..2f08cb6
--- /dev/null
+++ b/src/monite/types/document_i_ds_settings_next_number.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class DocumentIDsSettingsNextNumber(UniversalBaseModel):
+ quote: typing.Optional[int] = None
+ invoice: typing.Optional[int] = None
+ credit_note: typing.Optional[int] = None
+ purchase_order: typing.Optional[int] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/document_i_ds_settings_request.py b/src/monite/types/document_i_ds_settings_request.py
new file mode 100644
index 0000000..acc411a
--- /dev/null
+++ b/src/monite/types/document_i_ds_settings_request.py
@@ -0,0 +1,50 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .document_id_separators import DocumentIdSeparators
+from .document_type_prefix import DocumentTypePrefix
+from .document_i_ds_settings_next_number import DocumentIDsSettingsNextNumber
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class DocumentIDsSettingsRequest(UniversalBaseModel):
+ include_date: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Optionally add 4-digit of the current year
+ """
+
+ prefix: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Optional prefix. Does not substitute document_type prefix
+ """
+
+ separator: typing.Optional[DocumentIdSeparators] = pydantic.Field(default=None)
+ """
+ Which character should separate each part of the document_id
+ """
+
+ document_type_prefix: typing.Optional[DocumentTypePrefix] = pydantic.Field(default=None)
+ """
+ Prefixes for each document_type
+ """
+
+ min_digits: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Minimal size of number in document ID Number will be left padded with zeros if less
+ """
+
+ next_number: typing.Optional[DocumentIDsSettingsNextNumber] = pydantic.Field(default=None)
+ """
+ Write-only field. Changes which number will be issued next. Can't be less than the last issued document number
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/document_id_separators.py b/src/monite/types/document_id_separators.py
new file mode 100644
index 0000000..510f977
--- /dev/null
+++ b/src/monite/types/document_id_separators.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DocumentIdSeparators = typing.Union[typing.Literal["/", "-", "|", ".", ""], typing.Any]
diff --git a/src/monite/types/document_object_type_request_enum.py b/src/monite/types/document_object_type_request_enum.py
new file mode 100644
index 0000000..777939b
--- /dev/null
+++ b/src/monite/types/document_object_type_request_enum.py
@@ -0,0 +1,18 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DocumentObjectTypeRequestEnum = typing.Union[
+ typing.Literal[
+ "receivables_quote",
+ "receivables_invoice",
+ "receivables_paid_invoice",
+ "receivables_credit_note",
+ "receivables_discount_reminder",
+ "receivables_final_reminder",
+ "payables_purchase_order",
+ "payables_notify_approver",
+ "payables_notify_payer",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/document_type_enum.py b/src/monite/types/document_type_enum.py
new file mode 100644
index 0000000..369ea26
--- /dev/null
+++ b/src/monite/types/document_type_enum.py
@@ -0,0 +1,16 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+DocumentTypeEnum = typing.Union[
+ typing.Literal[
+ "quote",
+ "invoice",
+ "credit_note",
+ "discount_reminder",
+ "final_reminder",
+ "payables_purchase_order",
+ "overdue_reminder",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/document_type_prefix.py b/src/monite/types/document_type_prefix.py
new file mode 100644
index 0000000..ea30a73
--- /dev/null
+++ b/src/monite/types/document_type_prefix.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class DocumentTypePrefix(UniversalBaseModel):
+ quote: typing.Optional[str] = None
+ invoice: typing.Optional[str] = None
+ credit_note: typing.Optional[str] = None
+ purchase_order: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/domain_list_response.py b/src/monite/types/domain_list_response.py
new file mode 100644
index 0000000..835e84b
--- /dev/null
+++ b/src/monite/types/domain_list_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .domain_response import DomainResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class DomainListResponse(UniversalBaseModel):
+ data: typing.List[DomainResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/domain_response.py b/src/monite/types/domain_response.py
new file mode 100644
index 0000000..4bd6c49
--- /dev/null
+++ b/src/monite/types/domain_response.py
@@ -0,0 +1,38 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .domain_response_dns_records import DomainResponseDnsRecords
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class DomainResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Entry UUID
+ """
+
+ dedicated_ip: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A dedicated IP address assigned to this mailbox and used to send outgoing email.
+ """
+
+ dns_records: DomainResponseDnsRecords
+ domain: str
+ last_updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The time the domain was updated for the last time
+ """
+
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/domain_response_dns_records.py b/src/monite/types/domain_response_dns_records.py
new file mode 100644
index 0000000..13822b4
--- /dev/null
+++ b/src/monite/types/domain_response_dns_records.py
@@ -0,0 +1,6 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .dns_records import DnsRecords
+
+DomainResponseDnsRecords = typing.Union[DnsRecords, typing.Dict[str, typing.Optional[typing.Any]]]
diff --git a/src/monite/types/e_invoicing_provider_enum.py b/src/monite/types/e_invoicing_provider_enum.py
new file mode 100644
index 0000000..9949b1a
--- /dev/null
+++ b/src/monite/types/e_invoicing_provider_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+EInvoicingProviderEnum = typing.Literal["avalara"]
diff --git a/src/monite/types/e_invoicing_settings_payload.py b/src/monite/types/e_invoicing_settings_payload.py
new file mode 100644
index 0000000..b241be5
--- /dev/null
+++ b/src/monite/types/e_invoicing_settings_payload.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .e_invoicing_provider_enum import EInvoicingProviderEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class EInvoicingSettingsPayload(UniversalBaseModel):
+ client_id: str
+ client_secret: str
+ provider: EInvoicingProviderEnum = "avalara"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/e_invoicing_settings_response.py b/src/monite/types/e_invoicing_settings_response.py
new file mode 100644
index 0000000..9647520
--- /dev/null
+++ b/src/monite/types/e_invoicing_settings_response.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .e_invoicing_provider_enum import EInvoicingProviderEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class EInvoicingSettingsResponse(UniversalBaseModel):
+ client_id: str
+ client_secret: str
+ provider: EInvoicingProviderEnum = "avalara"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_address_response_schema.py b/src/monite/types/entity_address_response_schema.py
new file mode 100644
index 0000000..beab698
--- /dev/null
+++ b/src/monite/types/entity_address_response_schema.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .allowed_countries import AllowedCountries
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityAddressResponseSchema(UniversalBaseModel):
+ """
+ A schema represents address info of the entity
+ """
+
+ city: str = pydantic.Field()
+ """
+ A city (a full name) where the entity is registered
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ A country name (as ISO code) where the entity is registered
+ """
+
+ line1: str = pydantic.Field()
+ """
+ A street where the entity is registered
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An alternative street used by the entity
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ A postal code of the address where the entity is registered
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A state in a country where the entity is registered
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_address_schema.py b/src/monite/types/entity_address_schema.py
new file mode 100644
index 0000000..db99d62
--- /dev/null
+++ b/src/monite/types/entity_address_schema.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .allowed_countries import AllowedCountries
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityAddressSchema(UniversalBaseModel):
+ """
+ A schema represents address info of the entity
+ """
+
+ city: str = pydantic.Field()
+ """
+ A city (a full name) where the entity is registered
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ A country name (as ISO code) where the entity is registered
+ """
+
+ line1: str = pydantic.Field()
+ """
+ A street where the entity is registered
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An alternative street used by the entity
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ A postal code of the address where the entity is registered
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, county, province, prefecture, region, or similar component of the entity's address. For US entities, `state` is required and must be a two-letter [USPS state abbreviation](https://pe.usps.com/text/pub28/28apb.htm), for example, NY or CA.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_bank_account_pagination_response.py b/src/monite/types/entity_bank_account_pagination_response.py
new file mode 100644
index 0000000..d23e611
--- /dev/null
+++ b/src/monite/types/entity_bank_account_pagination_response.py
@@ -0,0 +1,37 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_bank_account_response import EntityBankAccountResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityBankAccountPaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of an entity's bank accounts.
+ """
+
+ data: typing.List[EntityBankAccountResponse] = pydantic.Field()
+ """
+ A list of an entity's bank accounts.
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_bank_account_response.py b/src/monite/types/entity_bank_account_response.py
new file mode 100644
index 0000000..e9c767e
--- /dev/null
+++ b/src/monite/types/entity_bank_account_response.py
@@ -0,0 +1,88 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .allowed_countries import AllowedCountries
+from .currency_enum import CurrencyEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityBankAccountResponse(UniversalBaseModel):
+ """
+ Represents a bank account owned by an entity.
+ """
+
+ id: str = pydantic.Field()
+ """
+ Unique ID of the bank account.
+ """
+
+ account_holder_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The name of the person or business that owns this bank account. Required if the account currency is GBP or USD.
+ """
+
+ account_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank account number. Required if the account currency is GBP or USD. UK account numbers typically contain 8 digits. US bank account numbers contain 9 to 12 digits.
+ """
+
+ bank_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank name.
+ """
+
+ bic: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The SWIFT/BIC code of the bank.
+ """
+
+ country: typing.Optional[AllowedCountries] = pydantic.Field(default=None)
+ """
+ The country in which the bank account is registered, repsesented as a two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ currency: typing.Optional[CurrencyEnum] = pydantic.Field(default=None)
+ """
+ The currency of the bank account, represented as a three-letter ISO [currency code](https://docs.monite.com/docs/currencies).
+ """
+
+ display_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ User-defined name of this bank account, such as 'Primary account' or 'Savings account'.
+ """
+
+ iban: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The IBAN of the bank account. Required if the account currency is EUR.
+ """
+
+ is_default_for_currency: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether this bank account is the default one for its currency.
+ """
+
+ routing_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank's routing transit number (RTN). Required if the account currency is USD. US routing numbers consist of 9 digits.
+ """
+
+ sort_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank's sort code. Required if the account currency is GBP.
+ """
+
+ was_created_by_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the entity user who added this bank account, or `null` if it was added using a partner access token.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_business_structure.py b/src/monite/types/entity_business_structure.py
new file mode 100644
index 0000000..a8f7f36
--- /dev/null
+++ b/src/monite/types/entity_business_structure.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+EntityBusinessStructure = typing.Union[
+ typing.Literal[
+ "incorporated_partnership",
+ "unincorporated_partnership",
+ "public_corporation",
+ "private_corporation",
+ "sole_proprietorship",
+ "single_member_llc",
+ "multi_member_llc",
+ "private_partnership",
+ "unincorporated_association",
+ "public_partnership",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/entity_cursor_fields.py b/src/monite/types/entity_cursor_fields.py
new file mode 100644
index 0000000..1d2fcaf
--- /dev/null
+++ b/src/monite/types/entity_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+EntityCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/entity_individual_response.py b/src/monite/types/entity_individual_response.py
new file mode 100644
index 0000000..c2dd0c5
--- /dev/null
+++ b/src/monite/types/entity_individual_response.py
@@ -0,0 +1,81 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from .entity_address_response_schema import EntityAddressResponseSchema
+import typing
+from .individual_response_schema import IndividualResponseSchema
+from .file_schema4 import FileSchema4
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityIndividualResponse(UniversalBaseModel):
+ """
+ A base for an entity response schema
+ """
+
+ id: str = pydantic.Field()
+ """
+ UUID entity ID
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ address: EntityAddressResponseSchema = pydantic.Field()
+ """
+ An address description of the entity
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An official email address of the entity
+ """
+
+ individual: IndividualResponseSchema = pydantic.Field()
+ """
+ A set of metadata describing an individual
+ """
+
+ logo: typing.Optional[FileSchema4] = pydantic.Field(default=None)
+ """
+ A logo image of the entity
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ status: StatusEnum = pydantic.Field()
+ """
+ record status, 'active' by default
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_onboarding_data_response.py b/src/monite/types/entity_onboarding_data_response.py
new file mode 100644
index 0000000..e260d48
--- /dev/null
+++ b/src/monite/types/entity_onboarding_data_response.py
@@ -0,0 +1,35 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .business_profile import BusinessProfile
+import pydantic
+from .ownership_declaration import OwnershipDeclaration
+from .terms_of_service_acceptance import TermsOfServiceAcceptance
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityOnboardingDataResponse(UniversalBaseModel):
+ business_profile: typing.Optional[BusinessProfile] = pydantic.Field(default=None)
+ """
+ Business information about the entity.
+ """
+
+ ownership_declaration: typing.Optional[OwnershipDeclaration] = pydantic.Field(default=None)
+ """
+ Used to attest that the beneficial owner information provided is both current and correct.
+ """
+
+ tos_acceptance: typing.Optional[TermsOfServiceAcceptance] = pydantic.Field(default=None)
+ """
+ Details on the entity's acceptance of the service agreement.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_onboarding_documents.py b/src/monite/types/entity_onboarding_documents.py
new file mode 100644
index 0000000..8f54646
--- /dev/null
+++ b/src/monite/types/entity_onboarding_documents.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class EntityOnboardingDocuments(UniversalBaseModel):
+ verification_document_front: typing.Optional[str] = None
+ verification_document_back: typing.Optional[str] = None
+ additional_verification_document_front: typing.Optional[str] = None
+ additional_verification_document_back: typing.Optional[str] = None
+ bank_account_ownership_verification: typing.Optional[typing.List[str]] = None
+ company_license: typing.Optional[typing.List[str]] = None
+ company_memorandum_of_association: typing.Optional[typing.List[str]] = None
+ company_ministerial_decree: typing.Optional[typing.List[str]] = None
+ company_registration_verification: typing.Optional[typing.List[str]] = None
+ company_tax_id_verification: typing.Optional[typing.List[str]] = None
+ proof_of_registration: typing.Optional[typing.List[str]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_organization_response.py b/src/monite/types/entity_organization_response.py
new file mode 100644
index 0000000..fac3ee3
--- /dev/null
+++ b/src/monite/types/entity_organization_response.py
@@ -0,0 +1,81 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from .entity_address_response_schema import EntityAddressResponseSchema
+import typing
+from .file_schema4 import FileSchema4
+from .organization_response_schema import OrganizationResponseSchema
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityOrganizationResponse(UniversalBaseModel):
+ """
+ A base for an entity response schema
+ """
+
+ id: str = pydantic.Field()
+ """
+ UUID entity ID
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ address: EntityAddressResponseSchema = pydantic.Field()
+ """
+ An address description of the entity
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An official email address of the entity
+ """
+
+ logo: typing.Optional[FileSchema4] = pydantic.Field(default=None)
+ """
+ A logo image of the entity
+ """
+
+ organization: OrganizationResponseSchema = pydantic.Field()
+ """
+ A set of metadata describing an organization
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ status: StatusEnum = pydantic.Field()
+ """
+ record status, 'active' by default
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_pagination_response.py b/src/monite/types/entity_pagination_response.py
new file mode 100644
index 0000000..80c0d7c
--- /dev/null
+++ b/src/monite/types/entity_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_response import EntityResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityPaginationResponse(UniversalBaseModel):
+ data: typing.List[EntityResponse] = pydantic.Field()
+ """
+ A set of entities of different types returned per page
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_response.py b/src/monite/types/entity_response.py
new file mode 100644
index 0000000..6b9aabf
--- /dev/null
+++ b/src/monite/types/entity_response.py
@@ -0,0 +1,72 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from .entity_address_response_schema import EntityAddressResponseSchema
+from .file_schema4 import FileSchema4
+from .organization_response_schema import OrganizationResponseSchema
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+from .individual_response_schema import IndividualResponseSchema
+
+
+class EntityResponse_Organization(UniversalBaseModel):
+ """
+ A schema for a response after creation of an entity of different types
+ """
+
+ type: typing.Literal["organization"] = "organization"
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ address: EntityAddressResponseSchema
+ email: typing.Optional[str] = None
+ logo: typing.Optional[FileSchema4] = None
+ organization: OrganizationResponseSchema
+ phone: typing.Optional[str] = None
+ status: StatusEnum
+ tax_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class EntityResponse_Individual(UniversalBaseModel):
+ """
+ A schema for a response after creation of an entity of different types
+ """
+
+ type: typing.Literal["individual"] = "individual"
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ address: EntityAddressResponseSchema
+ email: typing.Optional[str] = None
+ individual: IndividualResponseSchema
+ logo: typing.Optional[FileSchema4] = None
+ phone: typing.Optional[str] = None
+ status: StatusEnum
+ tax_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+EntityResponse = typing.Union[EntityResponse_Organization, EntityResponse_Individual]
diff --git a/src/monite/types/entity_type_enum.py b/src/monite/types/entity_type_enum.py
new file mode 100644
index 0000000..6f663c4
--- /dev/null
+++ b/src/monite/types/entity_type_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+EntityTypeEnum = typing.Union[typing.Literal["individual", "organization"], typing.Any]
diff --git a/src/monite/types/entity_user_cursor_fields.py b/src/monite/types/entity_user_cursor_fields.py
new file mode 100644
index 0000000..e2fd8c6
--- /dev/null
+++ b/src/monite/types/entity_user_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+EntityUserCursorFields = typing.Literal["updated_at"]
diff --git a/src/monite/types/entity_user_pagination_response.py b/src/monite/types/entity_user_pagination_response.py
new file mode 100644
index 0000000..8d73f1e
--- /dev/null
+++ b/src/monite/types/entity_user_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_user_response import EntityUserResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityUserPaginationResponse(UniversalBaseModel):
+ data: typing.List[EntityUserResponse] = pydantic.Field()
+ """
+ array of records
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_user_response.py b/src/monite/types/entity_user_response.py
new file mode 100644
index 0000000..ac7c07e
--- /dev/null
+++ b/src/monite/types/entity_user_response.py
@@ -0,0 +1,75 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EntityUserResponse(UniversalBaseModel):
+ """
+ A scheme for validation an entity user additional info
+ """
+
+ id: str = pydantic.Field()
+ """
+ UUID entity user ID
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An entity user business email
+ """
+
+ first_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ First name
+ """
+
+ last_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Last name
+ """
+
+ login: str = pydantic.Field()
+ """
+ Login
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An entity user phone number in the international format
+ """
+
+ role_id: str = pydantic.Field()
+ """
+ UUID role ID
+ """
+
+ status: StatusEnum = pydantic.Field()
+ """
+ record status, 'active' by default
+ """
+
+ userpic_file_id: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_vat_id_resource_list.py b/src/monite/types/entity_vat_id_resource_list.py
new file mode 100644
index 0000000..a13d1d8
--- /dev/null
+++ b/src/monite/types/entity_vat_id_resource_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_vat_id_response import EntityVatIdResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class EntityVatIdResourceList(UniversalBaseModel):
+ data: typing.List[EntityVatIdResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/entity_vat_id_response.py b/src/monite/types/entity_vat_id_response.py
new file mode 100644
index 0000000..768d120
--- /dev/null
+++ b/src/monite/types/entity_vat_id_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .allowed_countries import AllowedCountries
+import typing
+from .vat_id_type_enum import VatIdTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class EntityVatIdResponse(UniversalBaseModel):
+ id: str
+ country: AllowedCountries
+ entity_id: str
+ type: typing.Optional[VatIdTypeEnum] = None
+ value: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/error_schema.py b/src/monite/types/error_schema.py
new file mode 100644
index 0000000..d969125
--- /dev/null
+++ b/src/monite/types/error_schema.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class ErrorSchema(UniversalBaseModel):
+ message: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/error_schema_response.py b/src/monite/types/error_schema_response.py
new file mode 100644
index 0000000..2ddb825
--- /dev/null
+++ b/src/monite/types/error_schema_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .error_schema import ErrorSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class ErrorSchemaResponse(UniversalBaseModel):
+ error: ErrorSchema
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/estimated_monthly_revenue.py b/src/monite/types/estimated_monthly_revenue.py
new file mode 100644
index 0000000..31ae11a
--- /dev/null
+++ b/src/monite/types/estimated_monthly_revenue.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .currency_enum import CurrencyEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EstimatedMonthlyRevenue(UniversalBaseModel):
+ amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of the monthly revenue, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250..
+ """
+
+ currency: typing.Optional[CurrencyEnum] = pydantic.Field(default=None)
+ """
+ [Currency code](https://docs.monite.com/docs/currencies) of the revenue.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/event_cursor_fields.py b/src/monite/types/event_cursor_fields.py
new file mode 100644
index 0000000..b9a24cd
--- /dev/null
+++ b/src/monite/types/event_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+EventCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/event_pagination_resource.py b/src/monite/types/event_pagination_resource.py
new file mode 100644
index 0000000..4ca4e53
--- /dev/null
+++ b/src/monite/types/event_pagination_resource.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .event_resource import EventResource
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EventPaginationResource(UniversalBaseModel):
+ data: typing.List[EventResource] = pydantic.Field()
+ """
+ A set of events returned per page
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/event_resource.py b/src/monite/types/event_resource.py
new file mode 100644
index 0000000..dca41dd
--- /dev/null
+++ b/src/monite/types/event_resource.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+import pydantic
+from .webhook_object_type import WebhookObjectType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EventResource(UniversalBaseModel):
+ id: str
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The timestamp that was generated at the time of making the database transaction that has initially caused the event
+ """
+
+ action: str
+ api_version: typing.Optional[str] = None
+ description: str
+ entity_id: str
+ object: typing.Optional[typing.Optional[typing.Any]] = None
+ object_type: WebhookObjectType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/event_resource_for_webhook_client.py b/src/monite/types/event_resource_for_webhook_client.py
new file mode 100644
index 0000000..143102a
--- /dev/null
+++ b/src/monite/types/event_resource_for_webhook_client.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+import pydantic
+from .webhook_object_type import WebhookObjectType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class EventResourceForWebhookClient(UniversalBaseModel):
+ id: str
+ created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The timestamp that was generated at the time of making the database transaction that has initially caused the event
+ """
+
+ action: str
+ api_version: typing.Optional[str] = None
+ description: str
+ entity_id: str
+ object: typing.Optional[typing.Optional[typing.Any]] = None
+ object_type: WebhookObjectType
+ webhook_subscription_id: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/exchange_rate.py b/src/monite/types/exchange_rate.py
new file mode 100644
index 0000000..4b9c0a2
--- /dev/null
+++ b/src/monite/types/exchange_rate.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .currency_enum import CurrencyEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class ExchangeRate(UniversalBaseModel):
+ base: CurrencyEnum
+ rate: float
+ to: CurrencyEnum
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/export_format.py b/src/monite/types/export_format.py
new file mode 100644
index 0000000..f16c8cf
--- /dev/null
+++ b/src/monite/types/export_format.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ExportFormat = typing.Union[typing.Literal["csv", "pdf", "csv_xero"], typing.Any]
diff --git a/src/monite/types/export_object_schema.py b/src/monite/types/export_object_schema.py
new file mode 100644
index 0000000..17da7a7
--- /dev/null
+++ b/src/monite/types/export_object_schema.py
@@ -0,0 +1,40 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payable_state_enum import PayableStateEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+from .receivables_status_enum import ReceivablesStatusEnum
+
+
+class ExportObjectSchema_Payable(UniversalBaseModel):
+ name: typing.Literal["payable"] = "payable"
+ statuses: typing.List[PayableStateEnum]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class ExportObjectSchema_Receivable(UniversalBaseModel):
+ name: typing.Literal["receivable"] = "receivable"
+ statuses: typing.List[ReceivablesStatusEnum]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+ExportObjectSchema = typing.Union[ExportObjectSchema_Payable, ExportObjectSchema_Receivable]
diff --git a/src/monite/types/export_payable_schema.py b/src/monite/types/export_payable_schema.py
new file mode 100644
index 0000000..fe8a7c9
--- /dev/null
+++ b/src/monite/types/export_payable_schema.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payable_state_enum import PayableStateEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ExportPayableSchema(UniversalBaseModel):
+ statuses: typing.List[PayableStateEnum]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/export_receivable_schema.py b/src/monite/types/export_receivable_schema.py
new file mode 100644
index 0000000..77fb36e
--- /dev/null
+++ b/src/monite/types/export_receivable_schema.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .receivables_status_enum import ReceivablesStatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ExportReceivableSchema(UniversalBaseModel):
+ statuses: typing.List[ReceivablesStatusEnum]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/export_setting_cursor_fields.py b/src/monite/types/export_setting_cursor_fields.py
new file mode 100644
index 0000000..d683a35
--- /dev/null
+++ b/src/monite/types/export_setting_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ExportSettingCursorFields = typing.Union[typing.Literal["id", "created_at"], typing.Any]
diff --git a/src/monite/types/extra_data_resource.py b/src/monite/types/extra_data_resource.py
new file mode 100644
index 0000000..683b2fe
--- /dev/null
+++ b/src/monite/types/extra_data_resource.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+from .supported_field_names import SupportedFieldNames
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ExtraDataResource(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ created_by: typing.Optional[str] = None
+ field_name: SupportedFieldNames
+ field_value: str
+ object_id: str
+ object_type: typing.Literal["counterpart"] = "counterpart"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/extra_data_resource_list.py b/src/monite/types/extra_data_resource_list.py
new file mode 100644
index 0000000..4f6009b
--- /dev/null
+++ b/src/monite/types/extra_data_resource_list.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .extra_data_resource import ExtraDataResource
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ExtraDataResourceList(UniversalBaseModel):
+ data: typing.List[ExtraDataResource]
+ next_pagination_token: typing.Optional[str] = None
+ prev_pagination_token: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/file_response.py b/src/monite/types/file_response.py
new file mode 100644
index 0000000..c991c05
--- /dev/null
+++ b/src/monite/types/file_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing_extensions
+from ..core.serialization import FieldMetadata
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class FileResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ file_type: str
+ md5: str
+ mimetype: str
+ name: str
+ region: str
+ s3bucket: typing_extensions.Annotated[str, FieldMetadata(alias="s3_bucket")]
+ s3file_path: typing_extensions.Annotated[str, FieldMetadata(alias="s3_file_path")]
+ size: int
+ url: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/file_schema.py b/src/monite/types/file_schema.py
new file mode 100644
index 0000000..3a57954
--- /dev/null
+++ b/src/monite/types/file_schema.py
@@ -0,0 +1,79 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .page_schema import PageSchema
+from .preview_schema import PreviewSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class FileSchema(UniversalBaseModel):
+ """
+ Represents a file (such as a PDF invoice) that was uploaded to Monite.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of this file.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC date and time when this workflow was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+ """
+
+ file_type: str = pydantic.Field()
+ """
+ The type of the business object associated with this file.
+ """
+
+ md5: str = pydantic.Field()
+ """
+ The MD5 hash of the file.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The file's [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
+ """
+
+ name: str = pydantic.Field()
+ """
+ The original file name (if available).
+ """
+
+ pages: typing.Optional[typing.List[PageSchema]] = pydantic.Field(default=None)
+ """
+ If the file is a PDF document, this property contains individual pages extracted from the file. Otherwise, an empty array.
+ """
+
+ previews: typing.Optional[typing.List[PreviewSchema]] = pydantic.Field(default=None)
+ """
+ Preview images generated for this file. There can be multiple images with different sizes.
+ """
+
+ region: str = pydantic.Field()
+ """
+ Geographical region of the data center where the file is stored.
+ """
+
+ size: int = pydantic.Field()
+ """
+ The file size in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the file.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/file_schema2.py b/src/monite/types/file_schema2.py
new file mode 100644
index 0000000..df519bc
--- /dev/null
+++ b/src/monite/types/file_schema2.py
@@ -0,0 +1,79 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .page_schema2 import PageSchema2
+from .preview_schema2 import PreviewSchema2
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class FileSchema2(UniversalBaseModel):
+ """
+ Represents a file (such as a PDF invoice) that was uploaded to Monite.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of this file.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC date and time when this workflow was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+ """
+
+ file_type: str = pydantic.Field()
+ """
+ The type of the business object associated with this file.
+ """
+
+ md5: str = pydantic.Field()
+ """
+ The MD5 hash of the file.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The file's [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
+ """
+
+ name: str = pydantic.Field()
+ """
+ The original file name (if available).
+ """
+
+ pages: typing.Optional[typing.List[PageSchema2]] = pydantic.Field(default=None)
+ """
+ If the file is a PDF document, this property contains individual pages extracted from the file. Otherwise, an empty array.
+ """
+
+ previews: typing.Optional[typing.List[PreviewSchema2]] = pydantic.Field(default=None)
+ """
+ Preview images generated for this file. There can be multiple images with different sizes.
+ """
+
+ region: str = pydantic.Field()
+ """
+ Geographical region of the data center where the file is stored.
+ """
+
+ size: int = pydantic.Field()
+ """
+ The file size in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the file.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/file_schema3.py b/src/monite/types/file_schema3.py
new file mode 100644
index 0000000..33e4f3d
--- /dev/null
+++ b/src/monite/types/file_schema3.py
@@ -0,0 +1,79 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .preview_schema3 import PreviewSchema3
+from .page_schema3 import PageSchema3
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class FileSchema3(UniversalBaseModel):
+ """
+ Represents a file (such as a PDF invoice) that was uploaded to Monite.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of this file.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC date and time when this file was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+ """
+
+ file_type: str = pydantic.Field()
+ """
+ The type of the business object associated with this file.
+ """
+
+ name: str = pydantic.Field()
+ """
+ The original file name (if available).
+ """
+
+ region: str = pydantic.Field()
+ """
+ Geographical region of the data center where the file is stored.
+ """
+
+ md5: str = pydantic.Field()
+ """
+ The MD5 hash of the file.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The file's [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the file.
+ """
+
+ size: int = pydantic.Field()
+ """
+ The file size in bytes.
+ """
+
+ previews: typing.Optional[typing.List[PreviewSchema3]] = pydantic.Field(default=None)
+ """
+ Preview images generated for this file. There can be multiple images with different sizes.
+ """
+
+ pages: typing.Optional[typing.List[PageSchema3]] = pydantic.Field(default=None)
+ """
+ If the file is a PDF document, this property contains individual pages extracted from the file. Otherwise, an empty array.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/file_schema4.py b/src/monite/types/file_schema4.py
new file mode 100644
index 0000000..924d9ed
--- /dev/null
+++ b/src/monite/types/file_schema4.py
@@ -0,0 +1,79 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .page_schema4 import PageSchema4
+from .preview_schema4 import PreviewSchema4
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class FileSchema4(UniversalBaseModel):
+ """
+ Represents a file (such as a PDF invoice) that was uploaded to Monite.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of this file.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC date and time when this workflow was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+ """
+
+ file_type: str = pydantic.Field()
+ """
+ The type of the business object associated with this file.
+ """
+
+ md5: str = pydantic.Field()
+ """
+ The MD5 hash of the file.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The file's [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
+ """
+
+ name: str = pydantic.Field()
+ """
+ The original file name (if available).
+ """
+
+ pages: typing.Optional[typing.List[PageSchema4]] = pydantic.Field(default=None)
+ """
+ If the file is a PDF document, this property contains individual pages extracted from the file. Otherwise, an empty array.
+ """
+
+ previews: typing.Optional[typing.List[PreviewSchema4]] = pydantic.Field(default=None)
+ """
+ Preview images generated for this file. There can be multiple images with different sizes.
+ """
+
+ region: str = pydantic.Field()
+ """
+ Geographical region of the data center where the file is stored.
+ """
+
+ size: int = pydantic.Field()
+ """
+ The file size in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the file.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/files_response.py b/src/monite/types/files_response.py
new file mode 100644
index 0000000..67e1f08
--- /dev/null
+++ b/src/monite/types/files_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .file_response import FileResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class FilesResponse(UniversalBaseModel):
+ data: typing.List[FileResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/get_all_payment_reminders.py b/src/monite/types/get_all_payment_reminders.py
new file mode 100644
index 0000000..6acb6b5
--- /dev/null
+++ b/src/monite/types/get_all_payment_reminders.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_reminder_response import PaymentReminderResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class GetAllPaymentReminders(UniversalBaseModel):
+ data: typing.List[PaymentReminderResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/get_all_recurrences.py b/src/monite/types/get_all_recurrences.py
new file mode 100644
index 0000000..701ff54
--- /dev/null
+++ b/src/monite/types/get_all_recurrences.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .recurrence import Recurrence
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class GetAllRecurrences(UniversalBaseModel):
+ data: typing.List[Recurrence]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/get_onboarding_requirements_response.py b/src/monite/types/get_onboarding_requirements_response.py
new file mode 100644
index 0000000..185d64f
--- /dev/null
+++ b/src/monite/types/get_onboarding_requirements_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .single_onboarding_requirements_response import SingleOnboardingRequirementsResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class GetOnboardingRequirementsResponse(UniversalBaseModel):
+ data: typing.List[SingleOnboardingRequirementsResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/grant_type.py b/src/monite/types/grant_type.py
new file mode 100644
index 0000000..3a4689a
--- /dev/null
+++ b/src/monite/types/grant_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+GrantType = typing.Union[typing.Literal["client_credentials", "entity_user"], typing.Any]
diff --git a/src/monite/types/http_validation_error.py b/src/monite/types/http_validation_error.py
new file mode 100644
index 0000000..f52507f
--- /dev/null
+++ b/src/monite/types/http_validation_error.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .validation_error import ValidationError
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class HttpValidationError(UniversalBaseModel):
+ detail: typing.Optional[typing.List[ValidationError]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/individual_response_schema.py b/src/monite/types/individual_response_schema.py
new file mode 100644
index 0000000..5c69158
--- /dev/null
+++ b/src/monite/types/individual_response_schema.py
@@ -0,0 +1,41 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+import typing_extensions
+from ..core.serialization import FieldMetadata
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class IndividualResponseSchema(UniversalBaseModel):
+ """
+ Contains data specific to entities of the `individual` type.
+ """
+
+ date_of_birth: typing.Optional[str] = None
+ first_name: str = pydantic.Field()
+ """
+ A first name of an individual
+ """
+
+ id_number: typing.Optional[str] = None
+ last_name: str = pydantic.Field()
+ """
+ A last name of an individual
+ """
+
+ ssn_last4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ssn_last_4")] = None
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A title of an individual
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/individual_schema.py b/src/monite/types/individual_schema.py
new file mode 100644
index 0000000..83a6f40
--- /dev/null
+++ b/src/monite/types/individual_schema.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+import typing_extensions
+from ..core.serialization import FieldMetadata
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class IndividualSchema(UniversalBaseModel):
+ """
+ A schema contains metadata for an individual
+ """
+
+ date_of_birth: typing.Optional[str] = None
+ first_name: str = pydantic.Field()
+ """
+ A first name of an individual
+ """
+
+ id_number: typing.Optional[str] = None
+ last_name: str = pydantic.Field()
+ """
+ A last name of an individual
+ """
+
+ ssn_last4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ssn_last_4")] = pydantic.Field(
+ default=None
+ )
+ """
+ The last four digits of the individual's Social Security number
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A title of an individual
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/invoice.py b/src/monite/types/invoice.py
new file mode 100644
index 0000000..854b09c
--- /dev/null
+++ b/src/monite/types/invoice.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .invoice_file import InvoiceFile
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class Invoice(UniversalBaseModel):
+ due_date: typing.Optional[str] = None
+ file: typing.Optional[InvoiceFile] = None
+ issue_date: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/invoice_file.py b/src/monite/types/invoice_file.py
new file mode 100644
index 0000000..33665a5
--- /dev/null
+++ b/src/monite/types/invoice_file.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class InvoiceFile(UniversalBaseModel):
+ mimetype: str
+ name: str
+ url: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/invoice_response_payload.py b/src/monite/types/invoice_response_payload.py
new file mode 100644
index 0000000..3eb880f
--- /dev/null
+++ b/src/monite/types/invoice_response_payload.py
@@ -0,0 +1,315 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import pydantic
+import typing
+from .receivables_representation_of_counterpart_address import ReceivablesRepresentationOfCounterpartAddress
+from .receivable_counterpart_contact import ReceivableCounterpartContact
+from .receivable_counterpart_type import ReceivableCounterpartType
+from .receivable_counterpart_vat_id_response import ReceivableCounterpartVatIdResponse
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .invoice_response_payload_entity import InvoiceResponsePayloadEntity
+from .receivable_entity_address_schema import ReceivableEntityAddressSchema
+from .receivables_representation_of_entity_bank_account import ReceivablesRepresentationOfEntityBankAccount
+from .receivable_entity_vat_id_response import ReceivableEntityVatIdResponse
+from .receivable_file_schema import ReceivableFileSchema
+from .language_code_enum import LanguageCodeEnum
+from .response_item import ResponseItem
+from .payment_terms import PaymentTerms
+from .related_documents import RelatedDocuments
+from .receivables_status_enum import ReceivablesStatusEnum
+from .tag_read_schema import TagReadSchema
+from .total_vat_amount_item import TotalVatAmountItem
+from .vat_mode_enum import VatModeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class InvoiceResponsePayload(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ amount_due: int = pydantic.Field()
+ """
+ How much is left to be paid in [minor units](https://docs.monite.com/docs/currencies#minor-units). Equal 0 if the Invoice is fully paid.
+ """
+
+ amount_paid: int = pydantic.Field()
+ """
+ How much has been paid [minor units](https://docs.monite.com/docs/currencies#minor-units)
+ """
+
+ amount_to_pay: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ How much is left to be paid in in [minor units](https://docs.monite.com/docs/currencies#minor-units), including payment_term discounts.
+ """
+
+ based_on: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique ID of a previous document related to the receivable if applicable.
+ """
+
+ based_on_document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique document ID of a previous document related to the receivable if applicable.
+ """
+
+ comment: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Field with a comment for pay/partially/uncollectible info on this Invoice
+ """
+
+ commercial_condition_description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The commercial terms of the receivable (e.g. The products must be delivered in X days).
+ """
+
+ counterpart_billing_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = pydantic.Field(
+ default=None
+ )
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_business_type: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Different types of companies for different countries, ex. GmbH, SAS, SNC, etc.
+ """
+
+ counterpart_contact: typing.Optional[ReceivableCounterpartContact] = pydantic.Field(default=None)
+ """
+ Additional information about counterpart contacts.
+ """
+
+ counterpart_id: str = pydantic.Field()
+ """
+ Unique ID of the counterpart.
+ """
+
+ counterpart_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A legal name of a counterpart it is an organization or first and last name if it is an individual
+ """
+
+ counterpart_shipping_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = pydantic.Field(
+ default=None
+ )
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ counterpart_tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The VAT/TAX ID of the counterpart.
+ """
+
+ counterpart_type: ReceivableCounterpartType = pydantic.Field()
+ """
+ The type of the counterpart.
+ """
+
+ counterpart_vat_id: typing.Optional[ReceivableCounterpartVatIdResponse] = None
+ currency: CurrencyEnum = pydantic.Field()
+ """
+ The currency used in the receivable.
+ """
+
+ deduction_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax deducted in minor units
+ """
+
+ deduction_memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information about a tax deduction
+ """
+
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a receivable.
+ """
+
+ discounted_subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable with discounts before taxes [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The sequential code systematically assigned to invoices.
+ """
+
+ due_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Optional field representing date until which invoice should be paid
+ """
+
+ entity: InvoiceResponsePayloadEntity
+ entity_address: ReceivableEntityAddressSchema
+ entity_bank_account: typing.Optional[ReceivablesRepresentationOfEntityBankAccount] = None
+ entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity user who created this document.
+ """
+
+ entity_vat_id: typing.Optional[ReceivableEntityVatIdResponse] = None
+ file: typing.Optional[ReceivableFileSchema] = None
+ file_language: LanguageCodeEnum = pydantic.Field()
+ """
+ The language of the customer-facing PDF file (`file_url`). The value matches the counterpart's `language` at the time when this PDF file was generated.
+ """
+
+ file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the counterpart's default language.
+ """
+
+ fulfillment_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date when the goods are shipped or the service is provided.
+
+ If omitted, defaults to the invoice issue date,
+ and the value is automatically set when the invoice status changes to `issued`.
+ """
+
+ issue_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ Optional field for the issue of the entry.
+ """
+
+ line_items: typing.List[ResponseItem]
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable.
+ """
+
+ original_file_language: LanguageCodeEnum = pydantic.Field()
+ """
+ The language of the entity's copy of the PDF file (`original_file_url`). The value matches the entity's `language` at the time when this PDF file was generated.
+ """
+
+ original_file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the entity's default language.
+ """
+
+ overdue_reminder_id: typing.Optional[str] = None
+ paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ Date and time when the invoice was paid.
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ payment_page_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Link to the invoice's payment page. Either Monite's payment links or your custom payment links.
+ """
+
+ payment_reminder_id: typing.Optional[str] = None
+ payment_terms: typing.Optional[PaymentTerms] = None
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ purchase_order: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Contain purchase order number.
+ """
+
+ recurrence_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Stores an unique ID of a recurrence if the receivable is in a recurring status
+ """
+
+ related_documents: RelatedDocuments = pydantic.Field()
+ """
+ Ids of documents that relate to invoice. I.e credit notes, proforma invoices, etc.
+ """
+
+ status: ReceivablesStatusEnum = pydantic.Field()
+ """
+ The status of the receivable inside the receivable workflow.
+ """
+
+ subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ tags: typing.Optional[typing.List[TagReadSchema]] = pydantic.Field(default=None)
+ """
+ The list of tags for this receivable.
+ """
+
+ total_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units). Calculated as a subtotal + total_vat_amount.
+ """
+
+ total_amount_with_credit_notes: int = pydantic.Field()
+ """
+ The total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units), including VAT and excluding all issued credit notes.
+ """
+
+ total_vat_amount: int = pydantic.Field()
+ """
+ The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ total_vat_amounts: typing.Optional[typing.List[TotalVatAmountItem]] = pydantic.Field(default=None)
+ """
+ List of total vat amount for each VAT, presented in receivable
+ """
+
+ total_withholding_tax: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable with tax withheld in minor units
+ """
+
+ trade_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Trade name of the entity
+ """
+
+ vat_exempt: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the goods, materials, or services listed in the receivable are exempt from VAT or not.
+ """
+
+ vat_exemption_rationale: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The reason for the VAT exemption, if applicable.
+ """
+
+ vat_mode: typing.Optional[VatModeEnum] = pydantic.Field(default=None)
+ """
+ Defines whether the prices of products in receivable will already include VAT or not.
+ """
+
+ withholding_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax withheld in percent minor units
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/invoice_response_payload_entity.py b/src/monite/types/invoice_response_payload_entity.py
new file mode 100644
index 0000000..6de9733
--- /dev/null
+++ b/src/monite/types/invoice_response_payload_entity.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class InvoiceResponsePayloadEntity_Organization(UniversalBaseModel):
+ type: typing.Literal["organization"] = "organization"
+ email: typing.Optional[str] = None
+ logo: typing.Optional[str] = None
+ name: str
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ vat_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class InvoiceResponsePayloadEntity_Individual(UniversalBaseModel):
+ type: typing.Literal["individual"] = "individual"
+ email: typing.Optional[str] = None
+ first_name: str
+ last_name: str
+ logo: typing.Optional[str] = None
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+InvoiceResponsePayloadEntity = typing.Union[
+ InvoiceResponsePayloadEntity_Organization, InvoiceResponsePayloadEntity_Individual
+]
diff --git a/src/monite/types/item.py b/src/monite/types/item.py
new file mode 100644
index 0000000..149c1d8
--- /dev/null
+++ b/src/monite/types/item.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class Item(UniversalBaseModel):
+ """
+ Contains information about a text block or line extracted from an uploaded document by OCR.
+ """
+
+ text: str = pydantic.Field()
+ """
+ The text as recognized by OCR.
+ """
+
+ confidence: float = pydantic.Field()
+ """
+ OCR confidence score - the estimated accuracy percentage of character recognition of the extracted text, from 0 to 100%.
+ """
+
+ processed_text: typing.Optional[typing.Optional[typing.Any]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/iteration_status.py b/src/monite/types/iteration_status.py
new file mode 100644
index 0000000..dac16f7
--- /dev/null
+++ b/src/monite/types/iteration_status.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+IterationStatus = typing.Union[
+ typing.Literal["pending", "completed", "canceled", "issue_failed", "send_failed"], typing.Any
+]
diff --git a/src/monite/types/label_n_value.py b/src/monite/types/label_n_value.py
new file mode 100644
index 0000000..8cd676c
--- /dev/null
+++ b/src/monite/types/label_n_value.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .item import Item
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class LabelNValue(UniversalBaseModel):
+ """
+ A label-value pair extracted from an uploaded document by OCR.
+ For example, the label could be "Total" and the value could be a currency amount.
+ """
+
+ label: Item = pydantic.Field()
+ """
+ Text label.
+ """
+
+ value: Item = pydantic.Field()
+ """
+ The value (if any).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/language_code_enum.py b/src/monite/types/language_code_enum.py
new file mode 100644
index 0000000..c2ca666
--- /dev/null
+++ b/src/monite/types/language_code_enum.py
@@ -0,0 +1,189 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+LanguageCodeEnum = typing.Union[
+ typing.Literal[
+ "ab",
+ "aa",
+ "af",
+ "ak",
+ "sq",
+ "am",
+ "ar",
+ "an",
+ "hy",
+ "av",
+ "ae",
+ "ay",
+ "az",
+ "bm",
+ "ba",
+ "eu",
+ "be",
+ "bn",
+ "bi",
+ "bs",
+ "br",
+ "bg",
+ "my",
+ "ca",
+ "ch",
+ "ce",
+ "ny",
+ "zh",
+ "cu",
+ "cv",
+ "kw",
+ "co",
+ "cr",
+ "hr",
+ "cs",
+ "da",
+ "dv",
+ "nl",
+ "dz",
+ "en",
+ "eo",
+ "et",
+ "ee",
+ "fo",
+ "fj",
+ "fi",
+ "fr",
+ "fy",
+ "ff",
+ "gd",
+ "gl",
+ "lg",
+ "ka",
+ "de",
+ "el",
+ "kl",
+ "gn",
+ "gu",
+ "ht",
+ "ha",
+ "he",
+ "hz",
+ "hi",
+ "ho",
+ "hu",
+ "io",
+ "ig",
+ "id",
+ "ia",
+ "ie",
+ "iu",
+ "ik",
+ "ga",
+ "it",
+ "ja",
+ "jv",
+ "kn",
+ "kr",
+ "ks",
+ "kk",
+ "km",
+ "ki",
+ "rw",
+ "ky",
+ "kv",
+ "kg",
+ "ko",
+ "kj",
+ "ku",
+ "lo",
+ "la",
+ "lv",
+ "li",
+ "ln",
+ "lt",
+ "lu",
+ "lb",
+ "mk",
+ "mg",
+ "ms",
+ "ml",
+ "mt",
+ "gv",
+ "mi",
+ "mr",
+ "mh",
+ "mn",
+ "na",
+ "nv",
+ "nd",
+ "nr",
+ "ng",
+ "ne",
+ "no",
+ "nb",
+ "nn",
+ "ii",
+ "oc",
+ "oj",
+ "om",
+ "os",
+ "pi",
+ "ps",
+ "fa",
+ "pl",
+ "pt",
+ "pa",
+ "qu",
+ "ro",
+ "rm",
+ "rn",
+ "ru",
+ "se",
+ "sm",
+ "sg",
+ "sa",
+ "sc",
+ "sr",
+ "sn",
+ "sd",
+ "si",
+ "sk",
+ "sl",
+ "so",
+ "st",
+ "es",
+ "su",
+ "sw",
+ "ss",
+ "sv",
+ "tl",
+ "ty",
+ "tg",
+ "ta",
+ "tt",
+ "te",
+ "th",
+ "bo",
+ "ti",
+ "to",
+ "ts",
+ "tn",
+ "tr",
+ "tk",
+ "tw",
+ "ug",
+ "uk",
+ "ur",
+ "uz",
+ "ve",
+ "vi",
+ "vo",
+ "wa",
+ "cy",
+ "wo",
+ "xh",
+ "yi",
+ "yo",
+ "za",
+ "zu",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/ledger_account_cursor_fields.py b/src/monite/types/ledger_account_cursor_fields.py
new file mode 100644
index 0000000..fd2b663
--- /dev/null
+++ b/src/monite/types/ledger_account_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+LedgerAccountCursorFields = typing.Literal["name"]
diff --git a/src/monite/types/ledger_account_list_response.py b/src/monite/types/ledger_account_list_response.py
new file mode 100644
index 0000000..df6fada
--- /dev/null
+++ b/src/monite/types/ledger_account_list_response.py
@@ -0,0 +1,26 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .ledger_account_response import LedgerAccountResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class LedgerAccountListResponse(UniversalBaseModel):
+ """
+ A paginated list of ledger accounts.
+ """
+
+ data: typing.List[LedgerAccountResponse]
+ next_pagination_token: typing.Optional[str] = None
+ prev_pagination_token: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ledger_account_response.py b/src/monite/types/ledger_account_response.py
new file mode 100644
index 0000000..842c146
--- /dev/null
+++ b/src/monite/types/ledger_account_response.py
@@ -0,0 +1,72 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .currency_enum import CurrencyEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LedgerAccountResponse(UniversalBaseModel):
+ """
+ Represents a general ledger account retrieved from an accounting system.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique identifier of the ledger account.
+ """
+
+ currency: typing.Optional[CurrencyEnum] = pydantic.Field(default=None)
+ """
+ The currency of the ledger account, specified as a three-letter [currency code](https://docs.monite.com/docs/currencies) (ISO 4217).
+ """
+
+ current_balance: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The current balance in the account.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ User-defined description of the ledger account.
+ """
+
+ is_bank_account: bool = pydantic.Field()
+ """
+ Indicates whether this ledger account represents a bank account.
+ """
+
+ name: str = pydantic.Field()
+ """
+ A user-defined name of the ledger account. Examples: Accounts Receivable, Office Equipment, Advertising, Salaries.
+ """
+
+ nominal_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The account code in the accounting system.
+ """
+
+ status: str = pydantic.Field()
+ """
+ The status of the ledger account. Possible values: Active, Archived, Pending, Unknown.
+ """
+
+ subtype: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The subtype or category of the ledger account. Possible values vary based on the accounting system used. Examples: Current, Fixed, Expense, Inventory, Equity.
+ """
+
+ type: str = pydantic.Field()
+ """
+ The type of the ledger account. It determines whether the account is a credit account or a debit account and where it appears in financial reports within the accounting system. Possible values: Asset, Equity, Expense, Income, Liability, Unknown.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item.py b/src/monite/types/line_item.py
new file mode 100644
index 0000000..3c43d0c
--- /dev/null
+++ b/src/monite/types/line_item.py
@@ -0,0 +1,49 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .discount import Discount
+import pydantic
+from .line_item_product_create import LineItemProductCreate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItem(UniversalBaseModel):
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a product.
+ """
+
+ product: typing.Optional[LineItemProductCreate] = pydantic.Field(default=None)
+ """
+ Object of product. Can be used instead of product_id, created in product's catalog
+ """
+
+ product_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique identifier of the product.
+ """
+
+ quantity: float = pydantic.Field()
+ """
+ The quantity of each of the goods, materials, or services listed in the receivable.
+ """
+
+ tax_rate_value: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Percent minor units. Example: 12.5% is 1250. This field is only required on invoices issued by entities in the US, Pakistan, and other unsupported countries.
+ """
+
+ vat_rate_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique identifier of the vat rate object. This field is required for all entities in supported countries except the US and Pakistan.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_cursor_fields.py b/src/monite/types/line_item_cursor_fields.py
new file mode 100644
index 0000000..7c1d88c
--- /dev/null
+++ b/src/monite/types/line_item_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+LineItemCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/line_item_internal_request.py b/src/monite/types/line_item_internal_request.py
new file mode 100644
index 0000000..58b17ee
--- /dev/null
+++ b/src/monite/types/line_item_internal_request.py
@@ -0,0 +1,59 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemInternalRequest(UniversalBaseModel):
+ accounting_tax_rate_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Description of the product.
+ """
+
+ ledger_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+ """
+
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Name of the product.
+ """
+
+ quantity: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The quantity of each of the goods, materials, or services listed in the payable.
+ """
+
+ subtotal: typing.Optional[int] = None
+ tax: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+ """
+
+ total: typing.Optional[int] = None
+ unit: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unit of the product
+ """
+
+ unit_price: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_pagination_response.py b/src/monite/types/line_item_pagination_response.py
new file mode 100644
index 0000000..4f5b5db
--- /dev/null
+++ b/src/monite/types/line_item_pagination_response.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .line_item_response import LineItemResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemPaginationResponse(UniversalBaseModel):
+ data: typing.List[LineItemResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_product.py b/src/monite/types/line_item_product.py
new file mode 100644
index 0000000..716abdf
--- /dev/null
+++ b/src/monite/types/line_item_product.py
@@ -0,0 +1,75 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .line_item_product_measure_unit import LineItemProductMeasureUnit
+from .price import Price
+from .product_service_type_enum import ProductServiceTypeEnum
+from .line_item_product_vat_rate import LineItemProductVatRate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemProduct(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Unique ID of the product.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the product was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the product was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Description of the product.
+ """
+
+ entity_id: str
+ entity_user_id: typing.Optional[str] = None
+ is_inline: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the product is inline
+ """
+
+ ledger_account_id: typing.Optional[str] = None
+ measure_unit: typing.Optional[LineItemProductMeasureUnit] = None
+ measure_unit_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+ """
+
+ name: str = pydantic.Field()
+ """
+ Name of the product.
+ """
+
+ price: Price
+ price_after_vat: Price
+ smallest_amount: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The smallest amount allowed for this product.
+ """
+
+ type: typing.Optional[ProductServiceTypeEnum] = pydantic.Field(default=None)
+ """
+ Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+ """
+
+ vat_rate: LineItemProductVatRate
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_product_create.py b/src/monite/types/line_item_product_create.py
new file mode 100644
index 0000000..067dc5a
--- /dev/null
+++ b/src/monite/types/line_item_product_create.py
@@ -0,0 +1,43 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .unit_request import UnitRequest
+from .price import Price
+from .product_service_type_enum import ProductServiceTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemProductCreate(UniversalBaseModel):
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Description of the product.
+ """
+
+ ledger_account_id: typing.Optional[str] = None
+ measure_unit: typing.Optional[UnitRequest] = None
+ name: str = pydantic.Field()
+ """
+ Name of the product.
+ """
+
+ price: Price
+ smallest_amount: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The smallest amount allowed for this product.
+ """
+
+ type: typing.Optional[ProductServiceTypeEnum] = pydantic.Field(default=None)
+ """
+ Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_product_measure_unit.py b/src/monite/types/line_item_product_measure_unit.py
new file mode 100644
index 0000000..af316db
--- /dev/null
+++ b/src/monite/types/line_item_product_measure_unit.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class LineItemProductMeasureUnit(UniversalBaseModel):
+ id: typing.Optional[str] = None
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ description: typing.Optional[str] = None
+ name: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_product_vat_rate.py b/src/monite/types/line_item_product_vat_rate.py
new file mode 100644
index 0000000..717201b
--- /dev/null
+++ b/src/monite/types/line_item_product_vat_rate.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemProductVatRate(UniversalBaseModel):
+ id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique identifier of the vat rate object.
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ value: int = pydantic.Field()
+ """
+ Percent minor units. Example: 12.5% is 1250.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_request.py b/src/monite/types/line_item_request.py
new file mode 100644
index 0000000..6d1dd0b
--- /dev/null
+++ b/src/monite/types/line_item_request.py
@@ -0,0 +1,57 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemRequest(UniversalBaseModel):
+ accounting_tax_rate_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the tax rate reference used for accounting integration. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Description of the product.
+ """
+
+ ledger_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+ """
+
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Name of the product.
+ """
+
+ quantity: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The quantity of each of the goods, materials, or services listed in the payable.
+ """
+
+ tax: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+ """
+
+ unit: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unit of the product
+ """
+
+ unit_price: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_response.py b/src/monite/types/line_item_response.py
new file mode 100644
index 0000000..9289062
--- /dev/null
+++ b/src/monite/types/line_item_response.py
@@ -0,0 +1,79 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemResponse(UniversalBaseModel):
+ id: str
+ accounting_tax_rate_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the tax rate reference used for accounting integartion. May be used to override auto-picked tax rate reference in accounting platform in case of any platform-specific constraints.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Description of the product.
+ """
+
+ ledger_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the account record used to store bookkeeping entries for balance-sheet and income-statement transactions.
+ """
+
+ name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Name of the product.
+ """
+
+ payable_id: str
+ quantity: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The quantity of each of the goods, materials, or services listed in the payable.
+ """
+
+ subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ tax: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ VAT rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+ """
+
+ tax_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+ """
+
+ total: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The actual price of the product.
+ """
+
+ unit: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unit of the product
+ """
+
+ unit_price: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The unit price of the product, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+ """
+
+ was_created_by_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the user who created the tag.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_item_update.py b/src/monite/types/line_item_update.py
new file mode 100644
index 0000000..db4462a
--- /dev/null
+++ b/src/monite/types/line_item_update.py
@@ -0,0 +1,43 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .discount import Discount
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class LineItemUpdate(UniversalBaseModel):
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a product.
+ """
+
+ price: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The actual price of the product in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ quantity: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The quantity of each of the goods, materials, or services listed in the receivable.
+ """
+
+ tax_rate_value: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Percent minor units. Example: 12.5% is 1250. This field is only required on invoices issued by entities in the US, Pakistan, and other unsupported countries.
+ """
+
+ vat_rate_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique identifier of the vat rate object. This field is required for all entities in supported countries except the US and Pakistan.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_items_replace_response.py b/src/monite/types/line_items_replace_response.py
new file mode 100644
index 0000000..b8d658d
--- /dev/null
+++ b/src/monite/types/line_items_replace_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .line_item_response import LineItemResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class LineItemsReplaceResponse(UniversalBaseModel):
+ data: typing.List[LineItemResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/line_items_response.py b/src/monite/types/line_items_response.py
new file mode 100644
index 0000000..43a3f3b
--- /dev/null
+++ b/src/monite/types/line_items_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .response_item import ResponseItem
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class LineItemsResponse(UniversalBaseModel):
+ data: typing.List[ResponseItem]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/log_method_enum.py b/src/monite/types/log_method_enum.py
new file mode 100644
index 0000000..2bc4430
--- /dev/null
+++ b/src/monite/types/log_method_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+LogMethodEnum = typing.Union[typing.Literal["GET", "POST", "PUT", "PATCH", "DELETE"], typing.Any]
diff --git a/src/monite/types/log_response.py b/src/monite/types/log_response.py
new file mode 100644
index 0000000..ddd6690
--- /dev/null
+++ b/src/monite/types/log_response.py
@@ -0,0 +1,35 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .log_response_body import LogResponseBody
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class LogResponse(UniversalBaseModel):
+ id: str
+ body: typing.Optional[LogResponseBody] = None
+ content_type: str
+ entity_id: str
+ entity_user_id: typing.Optional[str] = None
+ headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ method: typing.Optional[str] = None
+ params: typing.Optional[str] = None
+ parent_log_id: typing.Optional[str] = None
+ partner_id: str
+ path: typing.Optional[str] = None
+ status_code: typing.Optional[int] = None
+ target_service: str
+ timestamp: dt.datetime
+ type: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/log_response_body.py b/src/monite/types/log_response_body.py
new file mode 100644
index 0000000..cdd0ec7
--- /dev/null
+++ b/src/monite/types/log_response_body.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+LogResponseBody = typing.Union[typing.Dict[str, typing.Optional[typing.Any]], typing.List[typing.Optional[typing.Any]]]
diff --git a/src/monite/types/log_type_enum.py b/src/monite/types/log_type_enum.py
new file mode 100644
index 0000000..af706fc
--- /dev/null
+++ b/src/monite/types/log_type_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+LogTypeEnum = typing.Union[typing.Literal["request", "response"], typing.Any]
diff --git a/src/monite/types/logs_response.py b/src/monite/types/logs_response.py
new file mode 100644
index 0000000..f078649
--- /dev/null
+++ b/src/monite/types/logs_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .log_response import LogResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class LogsResponse(UniversalBaseModel):
+ data: typing.List[LogResponse]
+ next_pagination_token: typing.Optional[str] = None
+ prev_pagination_token: typing.Optional[str] = None
+ total_logs: int
+ total_pages: int
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/mail_sent_event_data.py b/src/monite/types/mail_sent_event_data.py
new file mode 100644
index 0000000..47b0c97
--- /dev/null
+++ b/src/monite/types/mail_sent_event_data.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .receivable_mail_status_enum import ReceivableMailStatusEnum
+from .receivable_mail_recipients import ReceivableMailRecipients
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class MailSentEventData(UniversalBaseModel):
+ mail_id: str
+ mail_status: ReceivableMailStatusEnum
+ recipients: ReceivableMailRecipients
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/mail_settings_payload.py b/src/monite/types/mail_settings_payload.py
new file mode 100644
index 0000000..5a99c63
--- /dev/null
+++ b/src/monite/types/mail_settings_payload.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class MailSettingsPayload(UniversalBaseModel):
+ attach_documents_as_pdf: bool
+ from_email_username: typing.Optional[str] = None
+ from_name: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/mail_settings_response.py b/src/monite/types/mail_settings_response.py
new file mode 100644
index 0000000..232919a
--- /dev/null
+++ b/src/monite/types/mail_settings_response.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class MailSettingsResponse(UniversalBaseModel):
+ attach_documents_as_pdf: bool
+ from_email_username: typing.Optional[str] = None
+ from_name: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/mailbox_data_response.py b/src/monite/types/mailbox_data_response.py
new file mode 100644
index 0000000..6c10020
--- /dev/null
+++ b/src/monite/types/mailbox_data_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .mailbox_response import MailboxResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class MailboxDataResponse(UniversalBaseModel):
+ data: typing.Optional[typing.List[MailboxResponse]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/mailbox_object_type_enum.py b/src/monite/types/mailbox_object_type_enum.py
new file mode 100644
index 0000000..2776788
--- /dev/null
+++ b/src/monite/types/mailbox_object_type_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+MailboxObjectTypeEnum = typing.Literal["payable"]
diff --git a/src/monite/types/mailbox_response.py b/src/monite/types/mailbox_response.py
new file mode 100644
index 0000000..8606deb
--- /dev/null
+++ b/src/monite/types/mailbox_response.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class MailboxResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Mailbox UUID
+ """
+
+ mailbox_domain_id: typing.Optional[str] = None
+ mailbox_full_address: str
+ mailbox_name: str
+ related_object_type: str
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/merged_settings_response.py b/src/monite/types/merged_settings_response.py
new file mode 100644
index 0000000..032cbd9
--- /dev/null
+++ b/src/monite/types/merged_settings_response.py
@@ -0,0 +1,126 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .accounting_settings_response import AccountingSettingsResponse
+import pydantic
+from .api_version import ApiVersion
+from .currency_settings import CurrencySettings
+from .document_i_ds_settings import DocumentIDsSettings
+from .e_invoicing_settings_response import EInvoicingSettingsResponse
+from .language_code_enum import LanguageCodeEnum
+from .mail_settings_response import MailSettingsResponse
+from .payable_settings_response import PayableSettingsResponse
+from .ocr_auto_tagging_settings_request import OcrAutoTaggingSettingsRequest
+from .payment_priority_enum import PaymentPriorityEnum
+from .payments_settings_response import PaymentsSettingsResponse
+from .receivable_settings_response import ReceivableSettingsResponse
+from .receivable_edit_flow import ReceivableEditFlow
+from .reminders_settings import RemindersSettings
+from .unit import Unit
+from .vat_mode_enum import VatModeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class MergedSettingsResponse(UniversalBaseModel):
+ accounting: typing.Optional[AccountingSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the accounting module.
+ """
+
+ allow_purchase_order_autolinking: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Automatically attempt to find a corresponding purchase order for all incoming payables.
+ """
+
+ api_version: typing.Optional[ApiVersion] = pydantic.Field(default=None)
+ """
+ Default API version for partner.
+ """
+
+ commercial_conditions: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Commercial conditions for receivables.
+ """
+
+ currency: typing.Optional[CurrencySettings] = pydantic.Field(default=None)
+ """
+ Custom currency exchange rates.
+ """
+
+ default_role: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ A default role to provision upon new entity creation.
+ """
+
+ document_ids: typing.Optional[DocumentIDsSettings] = None
+ einvoicing: typing.Optional[EInvoicingSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the e-invoicing module.
+ """
+
+ generate_paid_invoice_pdf: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ If enabled, the paid invoice's PDF will be in a new layout set by the user
+ """
+
+ language: typing.Optional[LanguageCodeEnum] = None
+ mail: typing.Optional[MailSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for email and mailboxes.
+ """
+
+ payable: typing.Optional[PayableSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the payables module.
+ """
+
+ payables_ocr_auto_tagging: typing.Optional[typing.List[OcrAutoTaggingSettingsRequest]] = pydantic.Field(
+ default=None
+ )
+ """
+ Auto tagging settings for all incoming OCR payable documents.
+ """
+
+ payment_priority: typing.Optional[PaymentPriorityEnum] = pydantic.Field(default=None)
+ """
+ Payment preferences for entity to automate calculating suggested payment date basing on payment terms and entity preferences
+ """
+
+ payments: typing.Optional[PaymentsSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the payments module.
+ """
+
+ quote_signature_required: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Sets the default behavior of whether a signature is required to accept quotes
+ """
+
+ receivable: typing.Optional[ReceivableSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the receivables module.
+ """
+
+ receivable_edit_flow: typing.Optional[ReceivableEditFlow] = None
+ reminder: typing.Optional[RemindersSettings] = None
+ units: typing.Optional[typing.List[Unit]] = pydantic.Field(default=None)
+ """
+ Measurement units.
+ """
+
+ vat_mode: typing.Optional[VatModeEnum] = pydantic.Field(default=None)
+ """
+ Defines whether the prices of products in receivables will already include VAT or not.
+ """
+
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/message_response.py b/src/monite/types/message_response.py
new file mode 100644
index 0000000..6d81985
--- /dev/null
+++ b/src/monite/types/message_response.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class MessageResponse(UniversalBaseModel):
+ message: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/missing_fields.py b/src/monite/types/missing_fields.py
new file mode 100644
index 0000000..1497028
--- /dev/null
+++ b/src/monite/types/missing_fields.py
@@ -0,0 +1,43 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .missing_line_item_fields import MissingLineItemFields
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class MissingFields(UniversalBaseModel):
+ counterpart: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Missing fields of counterpart.
+ """
+
+ entity: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Missing fields of entity.
+ """
+
+ products: typing.Optional[typing.List[MissingLineItemFields]] = pydantic.Field(default=None)
+ """
+ Missing fields of line items.
+ """
+
+ receivable: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Missing fields of receivable.
+ """
+
+ vat_rates: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ List of invalid vat rates.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/missing_line_item_fields.py b/src/monite/types/missing_line_item_fields.py
new file mode 100644
index 0000000..090ac6d
--- /dev/null
+++ b/src/monite/types/missing_line_item_fields.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class MissingLineItemFields(UniversalBaseModel):
+ line_item_number: int = pydantic.Field()
+ """
+ Order number of line item.
+ """
+
+ missing_fields: typing.List[str] = pydantic.Field()
+ """
+ Missing fields of line item.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/monite_all_payment_methods.py b/src/monite/types/monite_all_payment_methods.py
new file mode 100644
index 0000000..bdc76dd
--- /dev/null
+++ b/src/monite/types/monite_all_payment_methods.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+MoniteAllPaymentMethods = typing.Union[
+ typing.Literal[
+ "SEPA Payments",
+ "US ACH Payments",
+ "BLIK",
+ "Card payments",
+ "Bacs Direct Debit",
+ "Bancontact",
+ "Electronic Payment Standard",
+ "Giropay",
+ "iDEAL",
+ "Przelewy24",
+ "SEPA Direct Debit",
+ "SOFORT",
+ "Apple Pay",
+ "Google Pay",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/monite_all_payment_methods_types.py b/src/monite/types/monite_all_payment_methods_types.py
new file mode 100644
index 0000000..a0c97f2
--- /dev/null
+++ b/src/monite/types/monite_all_payment_methods_types.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+MoniteAllPaymentMethodsTypes = typing.Union[
+ typing.Literal[
+ "sepa_credit",
+ "us_ach",
+ "blik",
+ "card",
+ "bacs_direct_debit",
+ "bancontact",
+ "eps",
+ "giropay",
+ "ideal",
+ "p24",
+ "sepa_debit",
+ "sofort",
+ "applepay",
+ "googlepay",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/object_match_types.py b/src/monite/types/object_match_types.py
new file mode 100644
index 0000000..d1f6eee
--- /dev/null
+++ b/src/monite/types/object_match_types.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ObjectMatchTypes = typing.Union[typing.Literal["product", "customer", "vendor", "receivable", "bill"], typing.Any]
diff --git a/src/monite/types/object_type.py b/src/monite/types/object_type.py
new file mode 100644
index 0000000..5770acd
--- /dev/null
+++ b/src/monite/types/object_type.py
@@ -0,0 +1,60 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ObjectType = typing.Union[
+ typing.Literal[
+ "account",
+ "approval",
+ "approval_request",
+ "approval_policy",
+ "monitescript_process",
+ "audit_trail",
+ "comment",
+ "counterpart",
+ "counterpart_address",
+ "counterpart_bank_account",
+ "counterpart_contact_person",
+ "counterpart_partner_metadata",
+ "counterpart_tax_id",
+ "counterpart_vat_id",
+ "entity",
+ "entity_bank_account",
+ "entity_settings",
+ "entity_token",
+ "entity_user",
+ "entity_user_token",
+ "entity_vat_ids",
+ "export",
+ "onboarding",
+ "partner",
+ "partner_internal_config",
+ "partner_settings",
+ "partner_token",
+ "payable",
+ "project",
+ "payable_line_item",
+ "payables_purchase_order",
+ "payment",
+ "payment_intent",
+ "payment_link",
+ "payment_record",
+ "payment_reminder",
+ "person",
+ "product",
+ "receivable",
+ "reconciliation",
+ "recurrence",
+ "role",
+ "tag",
+ "todo_task",
+ "todo_task_mute",
+ "transaction",
+ "webhook",
+ "workflow",
+ "workflow_pipeline",
+ "overdue_reminder",
+ "einvoicing",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/object_type_available_comment.py b/src/monite/types/object_type_available_comment.py
new file mode 100644
index 0000000..52f3484
--- /dev/null
+++ b/src/monite/types/object_type_available_comment.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ObjectTypeAvailableComment = typing.Literal["payable"]
diff --git a/src/monite/types/object_type_enum.py b/src/monite/types/object_type_enum.py
new file mode 100644
index 0000000..da9bdd3
--- /dev/null
+++ b/src/monite/types/object_type_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ObjectTypeEnum = typing.Union[typing.Literal["receivable", "payable"], typing.Any]
diff --git a/src/monite/types/ocr_address.py b/src/monite/types/ocr_address.py
new file mode 100644
index 0000000..39f8da0
--- /dev/null
+++ b/src/monite/types/ocr_address.py
@@ -0,0 +1,59 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OcrAddress(UniversalBaseModel):
+ """
+ In general it's compatible with CounterpartAddress model but
+
+ - All fields are optional
+ - There is an additional field original_country_name
+ """
+
+ country: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ original_country_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Country name as it is stated in the document.
+ """
+
+ city: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ City name.
+ """
+
+ postal_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ZIP or postal code.
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, region, province, or county.
+ """
+
+ line1: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Street address.
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Additional address information (if any).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ocr_auto_tagging_settings_request.py b/src/monite/types/ocr_auto_tagging_settings_request.py
new file mode 100644
index 0000000..47aab0b
--- /dev/null
+++ b/src/monite/types/ocr_auto_tagging_settings_request.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OcrAutoTaggingSettingsRequest(UniversalBaseModel):
+ tag_id: str = pydantic.Field()
+ """
+ Tag identifier that will be assigned to the payable document if one of the words listed in keywords is found during OCR
+ """
+
+ keywords: typing.List[str] = pydantic.Field()
+ """
+ A list of words that will be searched for assigning a tag in the recognized fields of the document after OCR processing. If at least one match is found, the tag will be assigned. Each keyword must be between 2 and 25 characters long
+ """
+
+ enabled: bool = pydantic.Field()
+ """
+ A switch to temporarily disable a keyword without removing it from the list
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ocr_recognition_response.py b/src/monite/types/ocr_recognition_response.py
new file mode 100644
index 0000000..e8ef630
--- /dev/null
+++ b/src/monite/types/ocr_recognition_response.py
@@ -0,0 +1,34 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .label_n_value import LabelNValue
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OcrRecognitionResponse(UniversalBaseModel):
+ """
+ Contains information about all text blocks extracted from an uploaded invoice by OCR.
+ The text blocks are grouped into `line_items` (invoice line items) and `summary` (all other information).
+ Legacy schema used for AWS textract recognition.
+ """
+
+ summary: typing.Optional[typing.List[LabelNValue]] = pydantic.Field(default=None)
+ """
+ Invoice text content other than the line items. Such as the invoice issue and due dates, vendor name and address, and other general information.
+ """
+
+ line_items: typing.Optional[typing.List[LabelNValue]] = pydantic.Field(default=None)
+ """
+ Text content of the invoice line items as recognized by OCR.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ocr_response_invoice_receipt_data.py b/src/monite/types/ocr_response_invoice_receipt_data.py
new file mode 100644
index 0000000..6e28ce2
--- /dev/null
+++ b/src/monite/types/ocr_response_invoice_receipt_data.py
@@ -0,0 +1,140 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .ocr_address import OcrAddress
+from .ocr_response_invoice_receipt_line_item import OcrResponseInvoiceReceiptLineItem
+from .ocr_response_invoice_receipt_line_item_raw import OcrResponseInvoiceReceiptLineItemRaw
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OcrResponseInvoiceReceiptData(UniversalBaseModel):
+ total: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total in cents/eurocents. Outdated, actual conversion happens in payables.
+ """
+
+ total_raw: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Total, without minor units
+ """
+
+ total_excl_vat: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Subtotal cents/eurocents. Outdated, actual conversion happens in payables.
+ """
+
+ total_excl_vat_raw: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Subtotal, without minor units
+ """
+
+ total_vat_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ VAT amount in cents. Outdated, actual conversion happens in payables.
+ """
+
+ total_vat_amount_raw: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ VAT amount, without minor units
+ """
+
+ total_vat_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ VAT Percent minor units. Example: 12.5% is 1250. Outdated, actual conversion happens in payables.
+ """
+
+ total_vat_rate_raw: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ VAT Percent raw, without minor units.
+ """
+
+ currency: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ISO 4217 currency code
+ """
+
+ purchase_order_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Purchase Order Number
+ """
+
+ counterpart_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart name
+ """
+
+ counterpart_address: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart address
+ """
+
+ counterpart_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart bank ID
+ """
+
+ document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Invoice/receipt ID
+ """
+
+ payment_terms_raw: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Raw payment terms parsed but not calculated.
+ """
+
+ tax_payer_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Tax payer ID
+ """
+
+ counterpart_vat_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart VAT ID
+ """
+
+ document_issued_at_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Document issuance date in ISO format
+ """
+
+ document_due_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Document due date in ISO format
+ """
+
+ counterpart_address_object: typing.Optional[OcrAddress] = pydantic.Field(default=None)
+ """
+ Counterpart address as a json object compatible with counterparts service
+ """
+
+ counterpart_account_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank account number
+ """
+
+ counterpart_routing_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The bank routing number
+ """
+
+ line_items: typing.Optional[typing.List[OcrResponseInvoiceReceiptLineItem]] = pydantic.Field(default=None)
+ """
+ List of line items from document. Outdated, actual conversion happens in payables.
+ """
+
+ line_items_raw: typing.Optional[typing.List[OcrResponseInvoiceReceiptLineItemRaw]] = pydantic.Field(default=None)
+ """
+ List of line items from document raw, without minor units conversion.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ocr_response_invoice_receipt_line_item.py b/src/monite/types/ocr_response_invoice_receipt_line_item.py
new file mode 100644
index 0000000..ff43554
--- /dev/null
+++ b/src/monite/types/ocr_response_invoice_receipt_line_item.py
@@ -0,0 +1,62 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OcrResponseInvoiceReceiptLineItem(UniversalBaseModel):
+ line_item_ocr_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ OCR Id of line item
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Human-readable line item description
+ """
+
+ quantity: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Quanity
+ """
+
+ unit_price: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Price in cents/eurocents
+ """
+
+ unit: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unit
+ """
+
+ vat_percentage: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ VAT Percent minor units. Example: 12.5% is 1250.
+ """
+
+ vat_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ VAT Amount minor units.
+ """
+
+ total_excl_vat: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total excl VAT
+ """
+
+ total_incl_vat: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total included VAT
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ocr_response_invoice_receipt_line_item_raw.py b/src/monite/types/ocr_response_invoice_receipt_line_item_raw.py
new file mode 100644
index 0000000..c861b51
--- /dev/null
+++ b/src/monite/types/ocr_response_invoice_receipt_line_item_raw.py
@@ -0,0 +1,62 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OcrResponseInvoiceReceiptLineItemRaw(UniversalBaseModel):
+ line_item_ocr_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ OCR Id of line item
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Human-readable line item description
+ """
+
+ quantity: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Quanity
+ """
+
+ unit_price: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Price as parsed
+ """
+
+ unit: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unit
+ """
+
+ vat_percentage: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ VAT Percent as parsed.
+ """
+
+ vat_amount: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ VAT Amount as parsed.
+ """
+
+ total_excl_vat: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Total excluded VAT as parsed.
+ """
+
+ total_incl_vat: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ Total included VAT as parsed.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ocr_status_enum.py b/src/monite/types/ocr_status_enum.py
new file mode 100644
index 0000000..cc7dc3f
--- /dev/null
+++ b/src/monite/types/ocr_status_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OcrStatusEnum = typing.Union[typing.Literal["processing", "error", "success"], typing.Any]
diff --git a/src/monite/types/onboarding_link_public_response.py b/src/monite/types/onboarding_link_public_response.py
new file mode 100644
index 0000000..8b7b15f
--- /dev/null
+++ b/src/monite/types/onboarding_link_public_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class OnboardingLinkPublicResponse(UniversalBaseModel):
+ id: str
+ entity_id: str
+ expires_at: dt.datetime
+ refresh_url: str
+ return_url: str
+ url: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/onboarding_link_response.py b/src/monite/types/onboarding_link_response.py
new file mode 100644
index 0000000..42bb19c
--- /dev/null
+++ b/src/monite/types/onboarding_link_response.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+from .recipient import Recipient
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class OnboardingLinkResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ expires_at: dt.datetime
+ recipient: Recipient
+ refresh_url: str
+ return_url: str
+ url: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/onboarding_payment_methods_response.py b/src/monite/types/onboarding_payment_methods_response.py
new file mode 100644
index 0000000..99982af
--- /dev/null
+++ b/src/monite/types/onboarding_payment_methods_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_method import PaymentMethod
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class OnboardingPaymentMethodsResponse(UniversalBaseModel):
+ data: typing.List[PaymentMethod]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/onboarding_requirements_error.py b/src/monite/types/onboarding_requirements_error.py
new file mode 100644
index 0000000..1fbac4f
--- /dev/null
+++ b/src/monite/types/onboarding_requirements_error.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class OnboardingRequirementsError(UniversalBaseModel):
+ code: str
+ reason: str
+ requirement: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/onboarding_requirements_response.py b/src/monite/types/onboarding_requirements_response.py
new file mode 100644
index 0000000..d30b158
--- /dev/null
+++ b/src/monite/types/onboarding_requirements_response.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .account_disabled_reason import AccountDisabledReason
+from .payment_requirements import PaymentRequirements
+from .requirements_error import RequirementsError
+from .verification_error import VerificationError
+from .verification_status_enum import VerificationStatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class OnboardingRequirementsResponse(UniversalBaseModel):
+ disabled_reason: typing.Optional[AccountDisabledReason] = None
+ requirements: PaymentRequirements
+ requirements_errors: typing.List[RequirementsError]
+ verification_errors: typing.List[VerificationError]
+ verification_status: VerificationStatusEnum
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/onboarding_verification_error.py b/src/monite/types/onboarding_verification_error.py
new file mode 100644
index 0000000..799a69e
--- /dev/null
+++ b/src/monite/types/onboarding_verification_error.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class OnboardingVerificationError(UniversalBaseModel):
+ code: str
+ details: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/onboarding_verification_status_enum.py b/src/monite/types/onboarding_verification_status_enum.py
new file mode 100644
index 0000000..1b7314e
--- /dev/null
+++ b/src/monite/types/onboarding_verification_status_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OnboardingVerificationStatusEnum = typing.Union[typing.Literal["enabled", "disabled", "pending"], typing.Any]
diff --git a/src/monite/types/optional_individual_schema.py b/src/monite/types/optional_individual_schema.py
new file mode 100644
index 0000000..e787a05
--- /dev/null
+++ b/src/monite/types/optional_individual_schema.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+import typing_extensions
+from ..core.serialization import FieldMetadata
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OptionalIndividualSchema(UniversalBaseModel):
+ """
+ A schema for metadata for updating an individual
+ """
+
+ date_of_birth: typing.Optional[str] = None
+ first_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A first name of an individual
+ """
+
+ id_number: typing.Optional[str] = None
+ last_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A last name of an individual
+ """
+
+ ssn_last4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ssn_last_4")] = pydantic.Field(
+ default=None
+ )
+ """
+ The last four digits of the individual's Social Security number
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A title of an individual
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/optional_organization_schema.py b/src/monite/types/optional_organization_schema.py
new file mode 100644
index 0000000..a006110
--- /dev/null
+++ b/src/monite/types/optional_organization_schema.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_business_structure import EntityBusinessStructure
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OptionalOrganizationSchema(UniversalBaseModel):
+ """
+ A schema contains metadata for updating an organization
+ """
+
+ business_structure: typing.Optional[EntityBusinessStructure] = pydantic.Field(default=None)
+ """
+ Business structure of the company
+ """
+
+ directors_provided: typing.Optional[bool] = None
+ executives_provided: typing.Optional[bool] = None
+ legal_entity_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A code which identifies uniquely a party of a transaction worldwide
+ """
+
+ legal_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A legal name of an organization
+ """
+
+ owners_provided: typing.Optional[bool] = None
+ representative_provided: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/optional_person_address_request.py b/src/monite/types/optional_person_address_request.py
new file mode 100644
index 0000000..87d68e0
--- /dev/null
+++ b/src/monite/types/optional_person_address_request.py
@@ -0,0 +1,48 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OptionalPersonAddressRequest(UniversalBaseModel):
+ city: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ City, district, suburb, town, or village
+ """
+
+ country: typing.Optional[AllowedCountries] = pydantic.Field(default=None)
+ """
+ Two-letter country code (ISO 3166-1 alpha-2)
+ """
+
+ line1: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address line 1 (e.g., street, PO Box, or company name)
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address line 2 (e.g., apartment, suite, unit, or building)
+ """
+
+ postal_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ZIP or postal code
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, county, province, or region
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/optional_person_relationship.py b/src/monite/types/optional_person_relationship.py
new file mode 100644
index 0000000..9fb3f43
--- /dev/null
+++ b/src/monite/types/optional_person_relationship.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OptionalPersonRelationship(UniversalBaseModel):
+ director: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is a director of the account's legal entity
+ """
+
+ executive: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person has significant responsibility to control, manage, or direct the organization
+ """
+
+ owner: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is an owner of the account's legal entity
+ """
+
+ percent_ownership: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The percent owned by the person of the account's legal entity
+ """
+
+ representative: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is authorized as the primary representative of the account
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's title (e.g., CEO, Support Engineer)
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/order_enum.py b/src/monite/types/order_enum.py
new file mode 100644
index 0000000..76cbd24
--- /dev/null
+++ b/src/monite/types/order_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OrderEnum = typing.Union[typing.Literal["asc", "desc"], typing.Any]
diff --git a/src/monite/types/order_enum2.py b/src/monite/types/order_enum2.py
new file mode 100644
index 0000000..d1c980b
--- /dev/null
+++ b/src/monite/types/order_enum2.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OrderEnum2 = typing.Union[typing.Literal["asc", "desc"], typing.Any]
diff --git a/src/monite/types/order_enum3.py b/src/monite/types/order_enum3.py
new file mode 100644
index 0000000..b7056a9
--- /dev/null
+++ b/src/monite/types/order_enum3.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+OrderEnum3 = typing.Union[typing.Literal["asc", "desc"], typing.Any]
diff --git a/src/monite/types/organization_response_schema.py b/src/monite/types/organization_response_schema.py
new file mode 100644
index 0000000..a95e766
--- /dev/null
+++ b/src/monite/types/organization_response_schema.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_business_structure import EntityBusinessStructure
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OrganizationResponseSchema(UniversalBaseModel):
+ """
+ Contains data specific to entities of the `organization` type.
+ """
+
+ business_structure: typing.Optional[EntityBusinessStructure] = pydantic.Field(default=None)
+ """
+ Business structure of the company
+ """
+
+ directors_provided: typing.Optional[bool] = None
+ executives_provided: typing.Optional[bool] = None
+ legal_entity_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A code which identifies uniquely a party of a transaction worldwide
+ """
+
+ legal_name: str = pydantic.Field()
+ """
+ A legal name of an organization
+ """
+
+ owners_provided: typing.Optional[bool] = None
+ representative_provided: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/organization_schema.py b/src/monite/types/organization_schema.py
new file mode 100644
index 0000000..e66508b
--- /dev/null
+++ b/src/monite/types/organization_schema.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_business_structure import EntityBusinessStructure
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OrganizationSchema(UniversalBaseModel):
+ """
+ A schema contains metadata for an organization
+ """
+
+ business_structure: typing.Optional[EntityBusinessStructure] = pydantic.Field(default=None)
+ """
+ Business structure of the company
+ """
+
+ directors_provided: typing.Optional[bool] = None
+ executives_provided: typing.Optional[bool] = None
+ legal_entity_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A code which identifies uniquely a party of a transaction worldwide
+ """
+
+ legal_name: str = pydantic.Field()
+ """
+ A legal name of an organization
+ """
+
+ owners_provided: typing.Optional[bool] = None
+ representative_provided: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/overdue_reminder_response.py b/src/monite/types/overdue_reminder_response.py
new file mode 100644
index 0000000..b1d2c20
--- /dev/null
+++ b/src/monite/types/overdue_reminder_response.py
@@ -0,0 +1,38 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import pydantic
+import typing
+from .recipients import Recipients
+from .overdue_reminder_term import OverdueReminderTerm
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OverdueReminderResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the OverdueReminder was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the OverdueReminder was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ name: str
+ recipients: typing.Optional[Recipients] = None
+ terms: typing.Optional[typing.List[OverdueReminderTerm]] = pydantic.Field(default=None)
+ """
+ Overdue reminder terms to send for payment
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/overdue_reminder_term.py b/src/monite/types/overdue_reminder_term.py
new file mode 100644
index 0000000..a7b3362
--- /dev/null
+++ b/src/monite/types/overdue_reminder_term.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class OverdueReminderTerm(UniversalBaseModel):
+ body: str
+ days_after: int
+ subject: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/ownership_declaration.py b/src/monite/types/ownership_declaration.py
new file mode 100644
index 0000000..7521d65
--- /dev/null
+++ b/src/monite/types/ownership_declaration.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class OwnershipDeclaration(UniversalBaseModel):
+ date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The date and time (in the ISO 8601 format) when the beneficial owner attestation was made.
+ """
+
+ ip: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The IP address from which the beneficial owner attestation was made. If omitted or set to `null` in the request, the IP address is inferred from the request origin or the `X-Forwarded-For` request header.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/page_schema.py b/src/monite/types/page_schema.py
new file mode 100644
index 0000000..5fb26c8
--- /dev/null
+++ b/src/monite/types/page_schema.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PageSchema(UniversalBaseModel):
+ """
+ When a PDF document is uploaded to Monite, it extracts individual pages from the document
+ and saves them as PNG images. This object contains the image and metadata of a single page.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of the image.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the image.
+ """
+
+ number: int = pydantic.Field()
+ """
+ The page number in the PDF document, from 0.
+ """
+
+ size: int = pydantic.Field()
+ """
+ Image file size, in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the image.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/page_schema2.py b/src/monite/types/page_schema2.py
new file mode 100644
index 0000000..7799451
--- /dev/null
+++ b/src/monite/types/page_schema2.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PageSchema2(UniversalBaseModel):
+ """
+ When a PDF document is uploaded to Monite, it extracts individual pages from the document
+ and saves them as PNG images. This object contains the image and metadata of a single page.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of the image.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the image.
+ """
+
+ number: int = pydantic.Field()
+ """
+ The page number in the PDF document, from 0.
+ """
+
+ size: int = pydantic.Field()
+ """
+ Image file size, in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the image.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/page_schema3.py b/src/monite/types/page_schema3.py
new file mode 100644
index 0000000..3fb4308
--- /dev/null
+++ b/src/monite/types/page_schema3.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PageSchema3(UniversalBaseModel):
+ """
+ When a PDF document is uploaded to Monite, it extracts individual pages from the document
+ and saves them as PNG images. This object contains the image and metadata of a single page.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of the image.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the image.
+ """
+
+ size: int = pydantic.Field()
+ """
+ Image file size, in bytes.
+ """
+
+ number: int = pydantic.Field()
+ """
+ The page number in the PDF document, from 0.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the image.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/page_schema4.py b/src/monite/types/page_schema4.py
new file mode 100644
index 0000000..4744eeb
--- /dev/null
+++ b/src/monite/types/page_schema4.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PageSchema4(UniversalBaseModel):
+ """
+ When a PDF document is uploaded to Monite, it extracts individual pages from the document
+ and saves them as PNG images. This object contains the image and metadata of a single page.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of the image.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the image.
+ """
+
+ number: int = pydantic.Field()
+ """
+ The page number in the PDF document, from 0.
+ """
+
+ size: int = pydantic.Field()
+ """
+ Image file size, in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the image.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/partner_metadata.py b/src/monite/types/partner_metadata.py
new file mode 100644
index 0000000..b44a9ec
--- /dev/null
+++ b/src/monite/types/partner_metadata.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PartnerMetadata(UniversalBaseModel):
+ metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ """
+ Metadata for partner needs
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/partner_metadata_response.py b/src/monite/types/partner_metadata_response.py
new file mode 100644
index 0000000..91828fe
--- /dev/null
+++ b/src/monite/types/partner_metadata_response.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PartnerMetadataResponse(UniversalBaseModel):
+ metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/partner_project_settings_response.py b/src/monite/types/partner_project_settings_response.py
new file mode 100644
index 0000000..93bc5be
--- /dev/null
+++ b/src/monite/types/partner_project_settings_response.py
@@ -0,0 +1,83 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .accounting_settings_response import AccountingSettingsResponse
+import pydantic
+from .api_version import ApiVersion
+from .currency_settings import CurrencySettings
+from .e_invoicing_settings_response import EInvoicingSettingsResponse
+from .mail_settings_response import MailSettingsResponse
+from .payable_settings_response import PayableSettingsResponse
+from .payments_settings_response import PaymentsSettingsResponse
+from .receivable_settings_response import ReceivableSettingsResponse
+from .unit import Unit
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PartnerProjectSettingsResponse(UniversalBaseModel):
+ accounting: typing.Optional[AccountingSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the accounting module.
+ """
+
+ api_version: typing.Optional[ApiVersion] = pydantic.Field(default=None)
+ """
+ Default API version for partner.
+ """
+
+ commercial_conditions: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ Commercial conditions for receivables.
+ """
+
+ currency: typing.Optional[CurrencySettings] = pydantic.Field(default=None)
+ """
+ Custom currency exchange rates.
+ """
+
+ default_role: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ A default role to provision upon new entity creation.
+ """
+
+ einvoicing: typing.Optional[EInvoicingSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the e-invoicing module.
+ """
+
+ mail: typing.Optional[MailSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for email and mailboxes.
+ """
+
+ payable: typing.Optional[PayableSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the payables module.
+ """
+
+ payments: typing.Optional[PaymentsSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the payments module.
+ """
+
+ receivable: typing.Optional[ReceivableSettingsResponse] = pydantic.Field(default=None)
+ """
+ Settings for the receivables module.
+ """
+
+ units: typing.Optional[typing.List[Unit]] = pydantic.Field(default=None)
+ """
+ Measurement units.
+ """
+
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_action_enum.py b/src/monite/types/payable_action_enum.py
new file mode 100644
index 0000000..a7bec90
--- /dev/null
+++ b/src/monite/types/payable_action_enum.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PayableActionEnum = typing.Union[
+ typing.Literal[
+ "create", "read", "update", "delete", "pay", "approve", "cancel", "submit", "create_from_mail", "reopen"
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/payable_action_schema.py b/src/monite/types/payable_action_schema.py
new file mode 100644
index 0000000..45859df
--- /dev/null
+++ b/src/monite/types/payable_action_schema.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payable_action_enum import PayableActionEnum
+import pydantic
+from .permission_enum import PermissionEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableActionSchema(UniversalBaseModel):
+ action_name: typing.Optional[PayableActionEnum] = pydantic.Field(default=None)
+ """
+ Action name
+ """
+
+ permission: typing.Optional[PermissionEnum] = pydantic.Field(default=None)
+ """
+ Permission type
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_aggregated_data_response.py b/src/monite/types/payable_aggregated_data_response.py
new file mode 100644
index 0000000..fea6c1d
--- /dev/null
+++ b/src/monite/types/payable_aggregated_data_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .payable_aggregated_item import PayableAggregatedItem
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableAggregatedDataResponse(UniversalBaseModel):
+ count: int = pydantic.Field()
+ """
+ The total count of payables across all statuses.
+ """
+
+ data: typing.List[PayableAggregatedItem] = pydantic.Field()
+ """
+ A list of aggregated items, each representing a status with its associated sum of the amount field and count.
+ """
+
+ sum_total_amount: int = pydantic.Field()
+ """
+ The total sum of the amount field for all payables across all statuses.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_aggregated_item.py b/src/monite/types/payable_aggregated_item.py
new file mode 100644
index 0000000..482db0e
--- /dev/null
+++ b/src/monite/types/payable_aggregated_item.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .payable_state_enum import PayableStateEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PayableAggregatedItem(UniversalBaseModel):
+ count: int = pydantic.Field()
+ """
+ The total count of payables with this specific status.
+ """
+
+ status: PayableStateEnum = pydantic.Field()
+ """
+ The status of the payable (e.g., paid, draft, etc.).
+ """
+
+ sum_total_amount: int = pydantic.Field()
+ """
+ The total sum of the amount field for all payables with this specific status.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_cursor_fields.py b/src/monite/types/payable_cursor_fields.py
new file mode 100644
index 0000000..3e71b63
--- /dev/null
+++ b/src/monite/types/payable_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PayableCursorFields = typing.Union[typing.Literal["id", "created_at"], typing.Any]
diff --git a/src/monite/types/payable_entity_address_schema.py b/src/monite/types/payable_entity_address_schema.py
new file mode 100644
index 0000000..19e7e46
--- /dev/null
+++ b/src/monite/types/payable_entity_address_schema.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableEntityAddressSchema(UniversalBaseModel):
+ """
+ A schema represents address info of the entity
+ """
+
+ city: str = pydantic.Field()
+ """
+ A city (a full name) where the entity is registered
+ """
+
+ country: typing.Optional[AllowedCountries] = pydantic.Field(default=None)
+ """
+ A country name (as ISO code) where the entity is registered
+ """
+
+ line1: str = pydantic.Field()
+ """
+ A street where the entity is registered
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An alternative street used by the entity
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ A postal code of the address where the entity is registered
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A state in a country where the entity is registered
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_entity_individual_response.py b/src/monite/types/payable_entity_individual_response.py
new file mode 100644
index 0000000..125f3a4
--- /dev/null
+++ b/src/monite/types/payable_entity_individual_response.py
@@ -0,0 +1,77 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from .payable_entity_address_schema import PayableEntityAddressSchema
+import typing
+from .payable_individual_schema import PayableIndividualSchema
+from .file_schema2 import FileSchema2
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableEntityIndividualResponse(UniversalBaseModel):
+ """
+ A base for an entity response schema
+ """
+
+ id: str = pydantic.Field()
+ """
+ UUID entity ID
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ address: PayableEntityAddressSchema
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An official email address of the entity
+ """
+
+ individual: PayableIndividualSchema = pydantic.Field()
+ """
+ A set of metadata describing an individual
+ """
+
+ logo: typing.Optional[FileSchema2] = pydantic.Field(default=None)
+ """
+ A logo image of the entity
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ status: StatusEnum = pydantic.Field()
+ """
+ record status, 'active' by default
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_entity_organization_response.py b/src/monite/types/payable_entity_organization_response.py
new file mode 100644
index 0000000..b163ea9
--- /dev/null
+++ b/src/monite/types/payable_entity_organization_response.py
@@ -0,0 +1,77 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from .payable_entity_address_schema import PayableEntityAddressSchema
+import typing
+from .file_schema2 import FileSchema2
+from .payable_organization_schema import PayableOrganizationSchema
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableEntityOrganizationResponse(UniversalBaseModel):
+ """
+ A base for an entity response schema
+ """
+
+ id: str = pydantic.Field()
+ """
+ UUID entity ID
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ address: PayableEntityAddressSchema
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An official email address of the entity
+ """
+
+ logo: typing.Optional[FileSchema2] = pydantic.Field(default=None)
+ """
+ A logo image of the entity
+ """
+
+ organization: PayableOrganizationSchema = pydantic.Field()
+ """
+ A set of metadata describing an organization
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ status: StatusEnum = pydantic.Field()
+ """
+ record status, 'active' by default
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_individual_schema.py b/src/monite/types/payable_individual_schema.py
new file mode 100644
index 0000000..7cfaa7c
--- /dev/null
+++ b/src/monite/types/payable_individual_schema.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+import typing_extensions
+from ..core.serialization import FieldMetadata
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableIndividualSchema(UniversalBaseModel):
+ """
+ A schema contains metadata for an individual
+ """
+
+ date_of_birth: typing.Optional[str] = None
+ first_name: str = pydantic.Field()
+ """
+ A first name of an individual
+ """
+
+ id_number: typing.Optional[str] = None
+ last_name: str = pydantic.Field()
+ """
+ A last name of an individual
+ """
+
+ ssn_last4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ssn_last_4")] = pydantic.Field(
+ default=None
+ )
+ """
+ The last four digits of the individual's Social Security number
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A title of an individual
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_organization_schema.py b/src/monite/types/payable_organization_schema.py
new file mode 100644
index 0000000..27d777c
--- /dev/null
+++ b/src/monite/types/payable_organization_schema.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .entity_business_structure import EntityBusinessStructure
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableOrganizationSchema(UniversalBaseModel):
+ """
+ A schema contains metadata for an organization
+ """
+
+ business_structure: typing.Optional[EntityBusinessStructure] = pydantic.Field(default=None)
+ """
+ Business structure of the company
+ """
+
+ directors_provided: typing.Optional[bool] = None
+ executives_provided: typing.Optional[bool] = None
+ legal_entity_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A code which identifies uniquely a party of a transaction worldwide
+ """
+
+ legal_name: str = pydantic.Field()
+ """
+ A legal name of an organization
+ """
+
+ owners_provided: typing.Optional[bool] = None
+ representative_provided: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_origin_enum.py b/src/monite/types/payable_origin_enum.py
new file mode 100644
index 0000000..4723fec
--- /dev/null
+++ b/src/monite/types/payable_origin_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PayableOriginEnum = typing.Union[typing.Literal["upload", "email"], typing.Any]
diff --git a/src/monite/types/payable_pagination_response.py b/src/monite/types/payable_pagination_response.py
new file mode 100644
index 0000000..8f89213
--- /dev/null
+++ b/src/monite/types/payable_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payable_response_schema import PayableResponseSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayablePaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of payables.
+ """
+
+ data: typing.List[PayableResponseSchema]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_payment_term_discount.py b/src/monite/types/payable_payment_term_discount.py
new file mode 100644
index 0000000..8a46e80
--- /dev/null
+++ b/src/monite/types/payable_payment_term_discount.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PayablePaymentTermDiscount(UniversalBaseModel):
+ discount: int = pydantic.Field()
+ """
+ The discount percentage in minor units. E.g., 200 means 2%, 1050 means 10.5%.
+ """
+
+ number_of_days: int = pydantic.Field()
+ """
+ The amount of days after the invoice issue date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_payment_term_final.py b/src/monite/types/payable_payment_term_final.py
new file mode 100644
index 0000000..14eb837
--- /dev/null
+++ b/src/monite/types/payable_payment_term_final.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PayablePaymentTermFinal(UniversalBaseModel):
+ number_of_days: int = pydantic.Field()
+ """
+ The amount of days after the invoice issue date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_payment_terms_create_payload.py b/src/monite/types/payable_payment_terms_create_payload.py
new file mode 100644
index 0000000..e1376ba
--- /dev/null
+++ b/src/monite/types/payable_payment_terms_create_payload.py
@@ -0,0 +1,31 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import typing_extensions
+from .payable_payment_term_discount import PayablePaymentTermDiscount
+from ..core.serialization import FieldMetadata
+from .payable_payment_term_final import PayablePaymentTermFinal
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PayablePaymentTermsCreatePayload(UniversalBaseModel):
+ description: typing.Optional[str] = None
+ name: str
+ term1: typing_extensions.Annotated[typing.Optional[PayablePaymentTermDiscount], FieldMetadata(alias="term_1")] = (
+ None
+ )
+ term2: typing_extensions.Annotated[typing.Optional[PayablePaymentTermDiscount], FieldMetadata(alias="term_2")] = (
+ None
+ )
+ term_final: PayablePaymentTermFinal
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_response_schema.py b/src/monite/types/payable_response_schema.py
new file mode 100644
index 0000000..2010bc9
--- /dev/null
+++ b/src/monite/types/payable_response_schema.py
@@ -0,0 +1,247 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .counterpart_raw_data import CounterpartRawData
+from .currency_enum import CurrencyEnum
+from .currency_exchange_schema import CurrencyExchangeSchema
+from .file_schema3 import FileSchema3
+from .ocr_status_enum import OcrStatusEnum
+from .payable_response_schema_other_extracted_data import PayableResponseSchemaOtherExtractedData
+from .payable_origin_enum import PayableOriginEnum
+from .payable_payment_terms_create_payload import PayablePaymentTermsCreatePayload
+from .source_of_payable_data_enum import SourceOfPayableDataEnum
+from .payable_state_enum import PayableStateEnum
+from .suggested_payment_term import SuggestedPaymentTerm
+from .tag_read_schema import TagReadSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableResponseSchema(UniversalBaseModel):
+ """
+ Represents an Accounts Payable document received from a vendor or supplier.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID assigned to this payable.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC date and time when this payable was created. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ UTC date and time when this payable was last updated. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+ """
+
+ amount_due: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ How much is left to be paid on the invoice (in minor units).
+ """
+
+ amount_paid: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ How much was paid on the invoice (in minor units).
+ """
+
+ amount_to_pay: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ How much is left to be paid on the invoice (in minor units) with discounts from payment terms.
+ """
+
+ approval_policy_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Id of existing approval policy that applies to this payable, if any. A policy is applied if the payable matches the policy trigger conditions.
+ """
+
+ counterpart: typing.Optional[CounterpartRawData] = pydantic.Field(default=None)
+ """
+ Object representing de-normalized counterpart data. Filled at the moment of invoice submitting for approval or payment.
+ """
+
+ counterpart_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The ID of counterpart address object stored in counterparts service
+ """
+
+ counterpart_bank_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The ID of counterpart bank account object stored in counterparts service
+ """
+
+ counterpart_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The ID of the counterpart object that represents the vendor or supplier.
+ """
+
+ counterpart_raw_data: typing.Optional[CounterpartRawData] = pydantic.Field(default=None)
+ """
+ Object representing counterpart data which was extracted by OCR. Used for informational purposes.
+ """
+
+ counterpart_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The ID of counterpart VAT ID object stored in counterparts service
+ """
+
+ created_by_role_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The ID of the role that the entity user who created this payable had at that time. If the payable was created using a partner access token, the value is `null`.
+ """
+
+ currency: typing.Optional[CurrencyEnum] = pydantic.Field(default=None)
+ """
+ The [currency code](https://docs.monite.com/docs/currencies) of the currency used in the payable.
+ """
+
+ currency_exchange: typing.Optional[CurrencyExchangeSchema] = None
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An arbitrary description of this payable.
+ """
+
+ document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A unique invoice number assigned by the invoice issuer for payment tracking purposes. This is different from `id` which is an internal ID created automatically by Monite.
+ """
+
+ due_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date by which the payable must be paid, in the YYYY-MM-DD format. If the payable specifies payment terms with early payment discounts, this is the final payment date.
+ """
+
+ entity_id: str = pydantic.Field()
+ """
+ The ID of the entity to which the payable was issued.
+ """
+
+ file: typing.Optional[FileSchema3] = pydantic.Field(default=None)
+ """
+ The original file from which this payable was created.
+ """
+
+ file_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ File id to retrieve file info from file saver.
+ """
+
+ issued_at: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date when the payable was issued, in the YYYY-MM-DD format.
+ """
+
+ marked_as_paid_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The ID of the entity user who marked this document as paid.
+ """
+
+ marked_as_paid_with_comment: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An arbitrary comment that describes how and when this payable was paid.
+ """
+
+ ocr_request_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Id of OCR request to match asynchronous result of processing payable.
+ """
+
+ ocr_status: typing.Optional[OcrStatusEnum] = pydantic.Field(default=None)
+ """
+ The status of the data recognition process using OCR. The 'processing' status means that the data recognition is in progress and the user needs to wait for the data enrichment. The 'error' status indicates that some error occurred on the OCR side and the user can fill in the data manually. The 'success' status means the data recognition has been successfully completed, after which the user can check the data if desired and enrich or correct it.
+ """
+
+ other_extracted_data: typing.Optional[PayableResponseSchemaOtherExtractedData] = pydantic.Field(default=None)
+ """
+ Data extracted from the uploaded payable by OCR.
+ """
+
+ paid_at: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The date by which the payable was paid
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ payable_origin: PayableOriginEnum = pydantic.Field()
+ """
+ Specifies how this payable was created in Monite: `upload` - created via an API call, `email` - sent via email to the entity's mailbox.
+ """
+
+ payment_terms: typing.Optional[PayablePaymentTermsCreatePayload] = pydantic.Field(default=None)
+ """
+ The number of days to pay with potential discount for options shorter than due_date
+ """
+
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Project ID of a payable.
+ """
+
+ purchase_order_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The identifier of the purchase order to which this payable belongs.
+ """
+
+ sender: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address from which the invoice was sent to the entity.
+ """
+
+ source_of_payable_data: SourceOfPayableDataEnum = pydantic.Field()
+ """
+ Specifies how the property values of this payable were provided: `ocr` - Monite OCR service extracted the values from the provided PDF or image file, `user_specified` - values were added or updated via an API call.
+ """
+
+ status: PayableStateEnum = pydantic.Field()
+ """
+ The [status](https://docs.monite.com/docs/payables-lifecycle) of the payable.
+ """
+
+ subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The subtotal amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+ """
+
+ suggested_payment_term: typing.Optional[SuggestedPaymentTerm] = pydantic.Field(default=None)
+ """
+ The suggested date and corresponding discount in which payable could be paid. The date is in the YYYY-MM-DD format. The discount is calculated as X \* (10^-4) - for example, 100 is 1%, 25 is 0,25%, 10000 is 100 %. Date varies depending on the payment terms and may even be equal to the due date with discount 0.
+ """
+
+ tags: typing.Optional[typing.List[TagReadSchema]] = pydantic.Field(default=None)
+ """
+ A list of user-defined tags (labels) assigned to this payable. Tags can be used to trigger a specific approval policy for this payable.
+ """
+
+ tax: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Registered tax percentage applied for a service price in minor units, e.g. 200 means 2%, 1050 means 10.5%.
+ """
+
+ tax_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Tax amount in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+ """
+
+ total_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The total amount to be paid, in [minor units](https://docs.monite.com/docs/currencies#minor-units). For example, $12.50 is represented as 1250.
+ """
+
+ was_created_by_user_id: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_response_schema_other_extracted_data.py b/src/monite/types/payable_response_schema_other_extracted_data.py
new file mode 100644
index 0000000..40c992f
--- /dev/null
+++ b/src/monite/types/payable_response_schema_other_extracted_data.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .ocr_response_invoice_receipt_data import OcrResponseInvoiceReceiptData
+from .ocr_recognition_response import OcrRecognitionResponse
+
+PayableResponseSchemaOtherExtractedData = typing.Union[OcrResponseInvoiceReceiptData, OcrRecognitionResponse]
diff --git a/src/monite/types/payable_schema.py b/src/monite/types/payable_schema.py
new file mode 100644
index 0000000..dd3f0ca
--- /dev/null
+++ b/src/monite/types/payable_schema.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payable_action_schema import PayableActionSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableSchema(UniversalBaseModel):
+ actions: typing.Optional[typing.List[PayableActionSchema]] = pydantic.Field(default=None)
+ """
+ List of actions
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_settings_payload.py b/src/monite/types/payable_settings_payload.py
new file mode 100644
index 0000000..94bac73
--- /dev/null
+++ b/src/monite/types/payable_settings_payload.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableSettingsPayload(UniversalBaseModel):
+ allow_cancel_duplicates_automatically: typing.Optional[bool] = None
+ allow_counterpart_autocreation: typing.Optional[bool] = None
+ allow_counterpart_autolinking: typing.Optional[bool] = None
+ approve_page_url: str
+ default_state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A state each new payable will have upon creation
+ """
+
+ enable_line_items: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_settings_response.py b/src/monite/types/payable_settings_response.py
new file mode 100644
index 0000000..6f44578
--- /dev/null
+++ b/src/monite/types/payable_settings_response.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableSettingsResponse(UniversalBaseModel):
+ allow_cancel_duplicates_automatically: typing.Optional[bool] = None
+ allow_counterpart_autocreation: typing.Optional[bool] = None
+ allow_counterpart_autolinking: typing.Optional[bool] = None
+ approve_page_url: str
+ default_state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A state each new payable will have upon creation
+ """
+
+ enable_line_items: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_state_enum.py b/src/monite/types/payable_state_enum.py
new file mode 100644
index 0000000..3b3a0ce
--- /dev/null
+++ b/src/monite/types/payable_state_enum.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PayableStateEnum = typing.Union[
+ typing.Literal[
+ "draft", "new", "approve_in_progress", "waiting_to_be_paid", "partially_paid", "paid", "canceled", "rejected"
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/payable_templates_variable.py b/src/monite/types/payable_templates_variable.py
new file mode 100644
index 0000000..2d4eef3
--- /dev/null
+++ b/src/monite/types/payable_templates_variable.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PayableTemplatesVariable(UniversalBaseModel):
+ description: str
+ name: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_templates_variables_object.py b/src/monite/types/payable_templates_variables_object.py
new file mode 100644
index 0000000..5623e5b
--- /dev/null
+++ b/src/monite/types/payable_templates_variables_object.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .payables_variable_type import PayablesVariableType
+from .object_type import ObjectType
+import typing
+from .payable_templates_variable import PayableTemplatesVariable
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PayableTemplatesVariablesObject(UniversalBaseModel):
+ object_subtype: PayablesVariableType
+ object_type: ObjectType
+ variables: typing.List[PayableTemplatesVariable]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_templates_variables_object_list.py b/src/monite/types/payable_templates_variables_object_list.py
new file mode 100644
index 0000000..477f233
--- /dev/null
+++ b/src/monite/types/payable_templates_variables_object_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payable_templates_variables_object import PayableTemplatesVariablesObject
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PayableTemplatesVariablesObjectList(UniversalBaseModel):
+ data: typing.List[PayableTemplatesVariablesObject]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_validation_response.py b/src/monite/types/payable_validation_response.py
new file mode 100644
index 0000000..3bf4111
--- /dev/null
+++ b/src/monite/types/payable_validation_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PayableValidationResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ A unique ID assigned to this payable.
+ """
+
+ validation_errors: typing.Optional[typing.List[typing.Dict[str, typing.Optional[typing.Any]]]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payable_validations_resource.py b/src/monite/types/payable_validations_resource.py
new file mode 100644
index 0000000..288169d
--- /dev/null
+++ b/src/monite/types/payable_validations_resource.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payables_fields_allowed_for_validate import PayablesFieldsAllowedForValidate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PayableValidationsResource(UniversalBaseModel):
+ required_fields: typing.List[PayablesFieldsAllowedForValidate]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payables_fields_allowed_for_validate.py b/src/monite/types/payables_fields_allowed_for_validate.py
new file mode 100644
index 0000000..cc1012f
--- /dev/null
+++ b/src/monite/types/payables_fields_allowed_for_validate.py
@@ -0,0 +1,38 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PayablesFieldsAllowedForValidate = typing.Union[
+ typing.Literal[
+ "currency",
+ "document_id",
+ "due_date",
+ "issued_at",
+ "tax_amount",
+ "total_amount",
+ "subtotal",
+ "description",
+ "suggested_payment_term",
+ "payment_terms",
+ "tax",
+ "sender",
+ "file_id",
+ "counterpart_id",
+ "counterpart_bank_account_id",
+ "counterpart_address_id",
+ "counterpart_vat_id_id",
+ "line_items",
+ "line_items.quantity",
+ "line_items.unit_price",
+ "line_items.tax",
+ "line_items.ledger_account_id",
+ "line_items.accounting_tax_rate_id",
+ "line_items.unit",
+ "line_items.name",
+ "line_items.description",
+ "line_items.subtotal",
+ "line_items.total",
+ "line_items.tax_amount",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/payables_variable_type.py b/src/monite/types/payables_variable_type.py
new file mode 100644
index 0000000..8b5e9f2
--- /dev/null
+++ b/src/monite/types/payables_variable_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PayablesVariableType = typing.Union[typing.Literal["payables_purchase_order", "payables_notify_approver"], typing.Any]
diff --git a/src/monite/types/payment_account_object.py b/src/monite/types/payment_account_object.py
new file mode 100644
index 0000000..1d94575
--- /dev/null
+++ b/src/monite/types/payment_account_object.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .payment_account_type import PaymentAccountType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PaymentAccountObject(UniversalBaseModel):
+ id: str
+ type: PaymentAccountType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_account_type.py b/src/monite/types/payment_account_type.py
new file mode 100644
index 0000000..6e6c50a
--- /dev/null
+++ b/src/monite/types/payment_account_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentAccountType = typing.Union[typing.Literal["entity", "counterpart"], typing.Any]
diff --git a/src/monite/types/payment_intent.py b/src/monite/types/payment_intent.py
new file mode 100644
index 0000000..d0abf2c
--- /dev/null
+++ b/src/monite/types/payment_intent.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+from .payment_object import PaymentObject
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentIntent(UniversalBaseModel):
+ id: str
+ updated_at: dt.datetime
+ application_fee_amount: typing.Optional[int] = None
+ object: typing.Optional[PaymentObject] = None
+ provider: typing.Optional[str] = None
+ selected_payment_method: typing.Optional[str] = None
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_intent_cursor_fields.py b/src/monite/types/payment_intent_cursor_fields.py
new file mode 100644
index 0000000..dd852ff
--- /dev/null
+++ b/src/monite/types/payment_intent_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentIntentCursorFields = typing.Union[typing.Literal["id", "created_at"], typing.Any]
diff --git a/src/monite/types/payment_intent_history.py b/src/monite/types/payment_intent_history.py
new file mode 100644
index 0000000..303b433
--- /dev/null
+++ b/src/monite/types/payment_intent_history.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PaymentIntentHistory(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ payment_intent_id: str
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_intent_history_response.py b/src/monite/types/payment_intent_history_response.py
new file mode 100644
index 0000000..7e714d8
--- /dev/null
+++ b/src/monite/types/payment_intent_history_response.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_intent_history import PaymentIntentHistory
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentIntentHistoryResponse(UniversalBaseModel):
+ data: typing.List[PaymentIntentHistory] = pydantic.Field()
+ """
+ Payment intent history
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_intent_payout_method.py b/src/monite/types/payment_intent_payout_method.py
new file mode 100644
index 0000000..07947e6
--- /dev/null
+++ b/src/monite/types/payment_intent_payout_method.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentIntentPayoutMethod = typing.Union[typing.Literal["bank_account", "paper_check"], typing.Any]
diff --git a/src/monite/types/payment_intent_response.py b/src/monite/types/payment_intent_response.py
new file mode 100644
index 0000000..839b77a
--- /dev/null
+++ b/src/monite/types/payment_intent_response.py
@@ -0,0 +1,40 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+from .invoice import Invoice
+from .payment_object import PaymentObject
+from .account_response import AccountResponse
+from .monite_all_payment_methods_types import MoniteAllPaymentMethodsTypes
+from .recipient_account_response import RecipientAccountResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentIntentResponse(UniversalBaseModel):
+ id: str
+ updated_at: dt.datetime
+ amount: int
+ application_fee_amount: typing.Optional[int] = None
+ batch_payment_id: typing.Optional[str] = None
+ currency: str
+ invoice: typing.Optional[Invoice] = None
+ object: typing.Optional[PaymentObject] = None
+ payer: typing.Optional[AccountResponse] = None
+ payment_link_id: typing.Optional[str] = None
+ payment_methods: typing.List[MoniteAllPaymentMethodsTypes]
+ payment_reference: typing.Optional[str] = None
+ provider: typing.Optional[str] = None
+ recipient: RecipientAccountResponse
+ selected_payment_method: typing.Optional[MoniteAllPaymentMethodsTypes] = None
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_intents_list_response.py b/src/monite/types/payment_intents_list_response.py
new file mode 100644
index 0000000..bc944a1
--- /dev/null
+++ b/src/monite/types/payment_intents_list_response.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_intent_response import PaymentIntentResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentIntentsListResponse(UniversalBaseModel):
+ data: typing.List[PaymentIntentResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_intents_recipient.py b/src/monite/types/payment_intents_recipient.py
new file mode 100644
index 0000000..eea8469
--- /dev/null
+++ b/src/monite/types/payment_intents_recipient.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_intent_payout_method import PaymentIntentPayoutMethod
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentIntentsRecipient(UniversalBaseModel):
+ id: str
+ bank_account_id: typing.Optional[str] = None
+ payout_method: typing.Optional[PaymentIntentPayoutMethod] = None
+ type: typing.Literal["counterpart"] = "counterpart"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_method.py b/src/monite/types/payment_method.py
new file mode 100644
index 0000000..0c6ce6e
--- /dev/null
+++ b/src/monite/types/payment_method.py
@@ -0,0 +1,26 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .payment_method_direction import PaymentMethodDirection
+from .monite_all_payment_methods import MoniteAllPaymentMethods
+from .payment_method_status import PaymentMethodStatus
+from .monite_all_payment_methods_types import MoniteAllPaymentMethodsTypes
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PaymentMethod(UniversalBaseModel):
+ direction: PaymentMethodDirection
+ name: MoniteAllPaymentMethods
+ status: PaymentMethodStatus
+ type: MoniteAllPaymentMethodsTypes
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_method_direction.py b/src/monite/types/payment_method_direction.py
new file mode 100644
index 0000000..e2490ba
--- /dev/null
+++ b/src/monite/types/payment_method_direction.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentMethodDirection = typing.Union[typing.Literal["receive", "send"], typing.Any]
diff --git a/src/monite/types/payment_method_requirements.py b/src/monite/types/payment_method_requirements.py
new file mode 100644
index 0000000..547af68
--- /dev/null
+++ b/src/monite/types/payment_method_requirements.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentMethodRequirements(UniversalBaseModel):
+ current_deadline: typing.Optional[dt.datetime] = None
+ currently_due: typing.List[str]
+ eventually_due: typing.List[str]
+ past_due: typing.List[str]
+ pending_verification: typing.List[str]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_method_status.py b/src/monite/types/payment_method_status.py
new file mode 100644
index 0000000..d1961bf
--- /dev/null
+++ b/src/monite/types/payment_method_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentMethodStatus = typing.Union[typing.Literal["active", "inactive"], typing.Any]
diff --git a/src/monite/types/payment_object.py b/src/monite/types/payment_object.py
new file mode 100644
index 0000000..b83db37
--- /dev/null
+++ b/src/monite/types/payment_object.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .payment_object_type import PaymentObjectType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PaymentObject(UniversalBaseModel):
+ id: str
+ type: PaymentObjectType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_object_payable.py b/src/monite/types/payment_object_payable.py
new file mode 100644
index 0000000..6fc4b6b
--- /dev/null
+++ b/src/monite/types/payment_object_payable.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentObjectPayable(UniversalBaseModel):
+ id: str
+ type: typing.Literal["payable"] = "payable"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_object_type.py b/src/monite/types/payment_object_type.py
new file mode 100644
index 0000000..9ec3b66
--- /dev/null
+++ b/src/monite/types/payment_object_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentObjectType = typing.Union[typing.Literal["payable", "receivable"], typing.Any]
diff --git a/src/monite/types/payment_page_theme_payload.py b/src/monite/types/payment_page_theme_payload.py
new file mode 100644
index 0000000..28aed66
--- /dev/null
+++ b/src/monite/types/payment_page_theme_payload.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .button_theme_payload import ButtonThemePayload
+from .card_theme_payload import CardThemePayload
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentPageThemePayload(UniversalBaseModel):
+ background_color: typing.Optional[str] = None
+ border_radius: typing.Optional[str] = None
+ button: typing.Optional[ButtonThemePayload] = None
+ card: typing.Optional[CardThemePayload] = None
+ font_color: typing.Optional[str] = None
+ font_family: typing.Optional[str] = None
+ font_link_href: typing.Optional[str] = None
+ logo_src: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_page_theme_response.py b/src/monite/types/payment_page_theme_response.py
new file mode 100644
index 0000000..24f7b02
--- /dev/null
+++ b/src/monite/types/payment_page_theme_response.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .button_theme_response import ButtonThemeResponse
+from .card_theme_response import CardThemeResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentPageThemeResponse(UniversalBaseModel):
+ background_color: typing.Optional[str] = None
+ border_radius: typing.Optional[str] = None
+ button: typing.Optional[ButtonThemeResponse] = None
+ card: typing.Optional[CardThemeResponse] = None
+ font_color: typing.Optional[str] = None
+ font_family: typing.Optional[str] = None
+ font_link_href: typing.Optional[str] = None
+ logo_src: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_priority_enum.py b/src/monite/types/payment_priority_enum.py
new file mode 100644
index 0000000..f54304c
--- /dev/null
+++ b/src/monite/types/payment_priority_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentPriorityEnum = typing.Union[typing.Literal["working_capital", "balanced", "bottom_line"], typing.Any]
diff --git a/src/monite/types/payment_received_event_data.py b/src/monite/types/payment_received_event_data.py
new file mode 100644
index 0000000..d19bb9c
--- /dev/null
+++ b/src/monite/types/payment_received_event_data.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentReceivedEventData(UniversalBaseModel):
+ amount_due: int
+ amount_paid: int
+ comment: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_record_cursor_fields.py b/src/monite/types/payment_record_cursor_fields.py
new file mode 100644
index 0000000..a471d37
--- /dev/null
+++ b/src/monite/types/payment_record_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentRecordCursorFields = typing.Union[typing.Literal["paid_at", "amount", "overpaid_amount"], typing.Any]
diff --git a/src/monite/types/payment_record_object_request.py b/src/monite/types/payment_record_object_request.py
new file mode 100644
index 0000000..59bfa84
--- /dev/null
+++ b/src/monite/types/payment_record_object_request.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .object_type_enum import ObjectTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PaymentRecordObjectRequest(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ ID of the invoice
+ """
+
+ type: ObjectTypeEnum
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_record_object_response.py b/src/monite/types/payment_record_object_response.py
new file mode 100644
index 0000000..4e60326
--- /dev/null
+++ b/src/monite/types/payment_record_object_response.py
@@ -0,0 +1,35 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .object_type_enum import ObjectTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PaymentRecordObjectResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ ID of the invoice
+ """
+
+ new_status: str = pydantic.Field()
+ """
+ Status, in which object has been moved
+ """
+
+ old_status: str = pydantic.Field()
+ """
+ Status, in which object was before payment
+ """
+
+ type: ObjectTypeEnum
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_record_response.py b/src/monite/types/payment_record_response.py
new file mode 100644
index 0000000..358f612
--- /dev/null
+++ b/src/monite/types/payment_record_response.py
@@ -0,0 +1,34 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .currency_enum import CurrencyEnum
+import typing
+from .payment_record_object_response import PaymentRecordObjectResponse
+import pydantic
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentRecordResponse(UniversalBaseModel):
+ id: str
+ amount: int
+ currency: CurrencyEnum
+ entity_user_id: typing.Optional[str] = None
+ is_external: bool
+ object: PaymentRecordObjectResponse
+ overpaid_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Filled in a case, if payment amount is more, than total_amount
+ """
+
+ paid_at: dt.datetime
+ payment_intent_id: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_record_response_list.py b/src/monite/types/payment_record_response_list.py
new file mode 100644
index 0000000..88aab15
--- /dev/null
+++ b/src/monite/types/payment_record_response_list.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_record_response import PaymentRecordResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentRecordResponseList(UniversalBaseModel):
+ data: typing.List[PaymentRecordResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_reminder_response.py b/src/monite/types/payment_reminder_response.py
new file mode 100644
index 0000000..3754919
--- /dev/null
+++ b/src/monite/types/payment_reminder_response.py
@@ -0,0 +1,57 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import pydantic
+import typing
+from .recipients import Recipients
+from .status_enum import StatusEnum
+import typing_extensions
+from .reminder import Reminder
+from ..core.serialization import FieldMetadata
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentReminderResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the PaymentReminder was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the PaymentReminder was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ entity_id: str
+ name: str
+ recipients: typing.Optional[Recipients] = None
+ status: StatusEnum
+ term1reminder: typing_extensions.Annotated[typing.Optional[Reminder], FieldMetadata(alias="term_1_reminder")] = (
+ pydantic.Field(default=None)
+ )
+ """
+ Reminder to send for first payment term
+ """
+
+ term2reminder: typing_extensions.Annotated[typing.Optional[Reminder], FieldMetadata(alias="term_2_reminder")] = (
+ pydantic.Field(default=None)
+ )
+ """
+ Reminder to send for second payment term
+ """
+
+ term_final_reminder: typing.Optional[Reminder] = pydantic.Field(default=None)
+ """
+ Reminder to send for final payment term
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_requirements.py b/src/monite/types/payment_requirements.py
new file mode 100644
index 0000000..6b79dce
--- /dev/null
+++ b/src/monite/types/payment_requirements.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentRequirements(UniversalBaseModel):
+ current_deadline: typing.Optional[dt.datetime] = None
+ currently_due: typing.List[str]
+ eventually_due: typing.List[str]
+ pending_verification: typing.List[str]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_term.py b/src/monite/types/payment_term.py
new file mode 100644
index 0000000..15e9467
--- /dev/null
+++ b/src/monite/types/payment_term.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PaymentTerm(UniversalBaseModel):
+ number_of_days: int = pydantic.Field()
+ """
+ The amount of days after the invoice issue date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_term_discount.py b/src/monite/types/payment_term_discount.py
new file mode 100644
index 0000000..a9f7e71
--- /dev/null
+++ b/src/monite/types/payment_term_discount.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PaymentTermDiscount(UniversalBaseModel):
+ discount: int = pydantic.Field()
+ """
+ The discount percentage in minor units. E.g., 200 means 2%. 1050 means 10.5%.
+ """
+
+ number_of_days: int = pydantic.Field()
+ """
+ The amount of days after the invoice issue date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_term_discount_with_date.py b/src/monite/types/payment_term_discount_with_date.py
new file mode 100644
index 0000000..77a33c2
--- /dev/null
+++ b/src/monite/types/payment_term_discount_with_date.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentTermDiscountWithDate(UniversalBaseModel):
+ discount: int = pydantic.Field()
+ """
+ The discount percentage in minor units. E.g., 200 means 2%. 1050 means 10.5%.
+ """
+
+ end_date: typing.Optional[str] = None
+ number_of_days: int = pydantic.Field()
+ """
+ The amount of days after the invoice issue date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_terms.py b/src/monite/types/payment_terms.py
new file mode 100644
index 0000000..e9c4445
--- /dev/null
+++ b/src/monite/types/payment_terms.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import typing_extensions
+from .payment_term_discount_with_date import PaymentTermDiscountWithDate
+from ..core.serialization import FieldMetadata
+import pydantic
+from .term_final_with_date import TermFinalWithDate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentTerms(UniversalBaseModel):
+ id: str
+ name: typing.Optional[str] = None
+ term1: typing_extensions.Annotated[typing.Optional[PaymentTermDiscountWithDate], FieldMetadata(alias="term_1")] = (
+ pydantic.Field(default=None)
+ )
+ """
+ The first tier of the payment term. Represents the terms of the first early discount.
+ """
+
+ term2: typing_extensions.Annotated[typing.Optional[PaymentTermDiscountWithDate], FieldMetadata(alias="term_2")] = (
+ pydantic.Field(default=None)
+ )
+ """
+ The second tier of the payment term. Defines the terms of the second early discount.
+ """
+
+ term_final: TermFinalWithDate = pydantic.Field()
+ """
+ The final tier of the payment term. Defines the invoice due date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_terms_list_response.py b/src/monite/types/payment_terms_list_response.py
new file mode 100644
index 0000000..abf9c82
--- /dev/null
+++ b/src/monite/types/payment_terms_list_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_terms_response import PaymentTermsResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentTermsListResponse(UniversalBaseModel):
+ data: typing.Optional[typing.List[PaymentTermsResponse]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payment_terms_response.py b/src/monite/types/payment_terms_response.py
new file mode 100644
index 0000000..47eeec3
--- /dev/null
+++ b/src/monite/types/payment_terms_response.py
@@ -0,0 +1,43 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import typing_extensions
+from .payment_term_discount import PaymentTermDiscount
+from ..core.serialization import FieldMetadata
+import pydantic
+from .payment_term import PaymentTerm
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentTermsResponse(UniversalBaseModel):
+ id: str
+ description: typing.Optional[str] = None
+ name: str
+ term1: typing_extensions.Annotated[typing.Optional[PaymentTermDiscount], FieldMetadata(alias="term_1")] = (
+ pydantic.Field(default=None)
+ )
+ """
+ The first tier of the payment term. Represents the terms of the first early discount.
+ """
+
+ term2: typing_extensions.Annotated[typing.Optional[PaymentTermDiscount], FieldMetadata(alias="term_2")] = (
+ pydantic.Field(default=None)
+ )
+ """
+ The second tier of the payment term. Defines the terms of the second early discount.
+ """
+
+ term_final: PaymentTerm = pydantic.Field()
+ """
+ The final tier of the payment term. Defines the invoice due date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payments_batch_payment_response.py b/src/monite/types/payments_batch_payment_response.py
new file mode 100644
index 0000000..df440d5
--- /dev/null
+++ b/src/monite/types/payments_batch_payment_response.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+from .single_payment_intent_response import SinglePaymentIntentResponse
+from .payments_batch_payment_status import PaymentsBatchPaymentStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PaymentsBatchPaymentResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ error: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ payer_bank_account_id: str
+ payment_intents: typing.List[SinglePaymentIntentResponse]
+ payment_method: typing.Literal["us_ach"] = "us_ach"
+ status: PaymentsBatchPaymentStatus
+ total_amount: typing.Optional[int] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payments_batch_payment_status.py b/src/monite/types/payments_batch_payment_status.py
new file mode 100644
index 0000000..b83294f
--- /dev/null
+++ b/src/monite/types/payments_batch_payment_status.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PaymentsBatchPaymentStatus = typing.Union[
+ typing.Literal["created", "processing", "partially_successful", "succeeded", "failed"], typing.Any
+]
diff --git a/src/monite/types/payments_settings_payload.py b/src/monite/types/payments_settings_payload.py
new file mode 100644
index 0000000..66ba704
--- /dev/null
+++ b/src/monite/types/payments_settings_payload.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_page_theme_payload import PaymentPageThemePayload
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentsSettingsPayload(UniversalBaseModel):
+ payment_page_domain: typing.Optional[str] = None
+ payment_page_theme: typing.Optional[PaymentPageThemePayload] = None
+ support_email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The support email address
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/payments_settings_response.py b/src/monite/types/payments_settings_response.py
new file mode 100644
index 0000000..ead82b0
--- /dev/null
+++ b/src/monite/types/payments_settings_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_page_theme_response import PaymentPageThemeResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PaymentsSettingsResponse(UniversalBaseModel):
+ payment_page_domain: typing.Optional[str] = None
+ payment_page_theme: typing.Optional[PaymentPageThemeResponse] = None
+ support_email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The support email address
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/permission_enum.py b/src/monite/types/permission_enum.py
new file mode 100644
index 0000000..d6e90de
--- /dev/null
+++ b/src/monite/types/permission_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PermissionEnum = typing.Union[typing.Literal["allowed", "allowed_for_own", "not_allowed"], typing.Any]
diff --git a/src/monite/types/person_address_request.py b/src/monite/types/person_address_request.py
new file mode 100644
index 0000000..e17aaa0
--- /dev/null
+++ b/src/monite/types/person_address_request.py
@@ -0,0 +1,48 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .allowed_countries import AllowedCountries
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PersonAddressRequest(UniversalBaseModel):
+ city: str = pydantic.Field()
+ """
+ City, district, suburb, town, or village
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ Two-letter country code (ISO 3166-1 alpha-2)
+ """
+
+ line1: str = pydantic.Field()
+ """
+ Address line 1 (e.g., street, PO Box, or company name)
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address line 2 (e.g., apartment, suite, unit, or building)
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ ZIP or postal code
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, county, province, or region
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/person_address_response.py b/src/monite/types/person_address_response.py
new file mode 100644
index 0000000..cdbdb86
--- /dev/null
+++ b/src/monite/types/person_address_response.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PersonAddressResponse(UniversalBaseModel):
+ city: str = pydantic.Field()
+ """
+ City, district, suburb, town, or village
+ """
+
+ country: str = pydantic.Field()
+ """
+ Two-letter country code (ISO 3166-1 alpha-2)
+ """
+
+ line1: str = pydantic.Field()
+ """
+ Address line 1 (e.g., street, PO Box, or company name)
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address line 2 (e.g., apartment, suite, unit, or building)
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ ZIP or postal code
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, county, province, or region
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/person_onboarding_documents.py b/src/monite/types/person_onboarding_documents.py
new file mode 100644
index 0000000..884ba53
--- /dev/null
+++ b/src/monite/types/person_onboarding_documents.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PersonOnboardingDocuments(UniversalBaseModel):
+ verification_document_front: typing.Optional[str] = None
+ verification_document_back: typing.Optional[str] = None
+ additional_verification_document_front: typing.Optional[str] = None
+ additional_verification_document_back: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/person_relationship_request.py b/src/monite/types/person_relationship_request.py
new file mode 100644
index 0000000..3a35298
--- /dev/null
+++ b/src/monite/types/person_relationship_request.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PersonRelationshipRequest(UniversalBaseModel):
+ director: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is a director of the account's legal entity
+ """
+
+ executive: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person has significant responsibility to control, manage, or direct the organization
+ """
+
+ owner: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is an owner of the account's legal entity
+ """
+
+ percent_ownership: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The percent owned by the person of the account's legal entity
+ """
+
+ representative: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is authorized as the primary representative of the account
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's title (e.g., CEO, Support Engineer)
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/person_relationship_response.py b/src/monite/types/person_relationship_response.py
new file mode 100644
index 0000000..d38c761
--- /dev/null
+++ b/src/monite/types/person_relationship_response.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PersonRelationshipResponse(UniversalBaseModel):
+ director: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is a director of the account's legal entity
+ """
+
+ executive: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person has significant responsibility to control, manage, or direct the organization
+ """
+
+ owner: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is an owner of the account's legal entity
+ """
+
+ percent_ownership: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The percent owned by the person of the account's legal entity
+ """
+
+ representative: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether the person is authorized as the primary representative of the account
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's title (e.g., CEO, Support Engineer)
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/person_response.py b/src/monite/types/person_response.py
new file mode 100644
index 0000000..d82547a
--- /dev/null
+++ b/src/monite/types/person_response.py
@@ -0,0 +1,100 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .person_address_response import PersonAddressResponse
+from .allowed_countries import AllowedCountries
+from .person_relationship_response import PersonRelationshipResponse
+import typing_extensions
+from ..core.serialization import FieldMetadata
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PersonResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ The person's unique identifier
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the person was created
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the person was updated
+ """
+
+ address: typing.Optional[PersonAddressResponse] = pydantic.Field(default=None)
+ """
+ The person's address
+ """
+
+ citizenship: typing.Optional[AllowedCountries] = pydantic.Field(default=None)
+ """
+ Required for persons of US entities. The country of the person's citizenship, as a two-letter country code (ISO 3166-1 alpha-2). In case of dual or multiple citizenship, specify any.
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the entity user who created this person, or null if the person was created using a partner access token.
+ """
+
+ date_of_birth: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's date of birth
+ """
+
+ email: str = pydantic.Field()
+ """
+ The person's email address
+ """
+
+ entity_id: str = pydantic.Field()
+ """
+ Entity ID
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The person's first name
+ """
+
+ id_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's ID number, as appropriate for their country
+ """
+
+ last_name: str = pydantic.Field()
+ """
+ The person's last name
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's phone number
+ """
+
+ relationship: PersonRelationshipResponse = pydantic.Field()
+ """
+ Describes the person's relationship to the entity
+ """
+
+ ssn_last4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="ssn_last_4")] = pydantic.Field(
+ default=None
+ )
+ """
+ The last four digits of the person's Social Security number
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/persons_response.py b/src/monite/types/persons_response.py
new file mode 100644
index 0000000..55a1f5a
--- /dev/null
+++ b/src/monite/types/persons_response.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .person_response import PersonResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PersonsResponse(UniversalBaseModel):
+ data: typing.List[PersonResponse] = pydantic.Field()
+ """
+ array of objects of type person
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/platform.py b/src/monite/types/platform.py
new file mode 100644
index 0000000..067fe3f
--- /dev/null
+++ b/src/monite/types/platform.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+Platform = typing.Union[typing.Literal["xero", "quickbooks_online", "quickbooks_online_sandbox"], typing.Any]
diff --git a/src/monite/types/preview_schema.py b/src/monite/types/preview_schema.py
new file mode 100644
index 0000000..d59bbb8
--- /dev/null
+++ b/src/monite/types/preview_schema.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PreviewSchema(UniversalBaseModel):
+ """
+ A preview image generated for a file.
+ """
+
+ height: int = pydantic.Field()
+ """
+ The image height in pixels.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The image URL.
+ """
+
+ width: int = pydantic.Field()
+ """
+ The image width in pixels.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/preview_schema2.py b/src/monite/types/preview_schema2.py
new file mode 100644
index 0000000..ef5f5ff
--- /dev/null
+++ b/src/monite/types/preview_schema2.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PreviewSchema2(UniversalBaseModel):
+ """
+ A preview image generated for a file.
+ """
+
+ height: int = pydantic.Field()
+ """
+ The image height in pixels.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The image URL.
+ """
+
+ width: int = pydantic.Field()
+ """
+ The image width in pixels.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/preview_schema3.py b/src/monite/types/preview_schema3.py
new file mode 100644
index 0000000..dc4b6db
--- /dev/null
+++ b/src/monite/types/preview_schema3.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PreviewSchema3(UniversalBaseModel):
+ """
+ A preview image generated for a file.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The image URL.
+ """
+
+ width: int = pydantic.Field()
+ """
+ The image width in pixels.
+ """
+
+ height: int = pydantic.Field()
+ """
+ The image height in pixels.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/preview_schema4.py b/src/monite/types/preview_schema4.py
new file mode 100644
index 0000000..6e99d6c
--- /dev/null
+++ b/src/monite/types/preview_schema4.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PreviewSchema4(UniversalBaseModel):
+ """
+ A preview image generated for a file.
+ """
+
+ height: int = pydantic.Field()
+ """
+ The image height in pixels.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The image URL.
+ """
+
+ width: int = pydantic.Field()
+ """
+ The image width in pixels.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/preview_template_response.py b/src/monite/types/preview_template_response.py
new file mode 100644
index 0000000..7c73039
--- /dev/null
+++ b/src/monite/types/preview_template_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PreviewTemplateResponse(UniversalBaseModel):
+ body_preview: str
+ subject_preview: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/price.py b/src/monite/types/price.py
new file mode 100644
index 0000000..3afec56
--- /dev/null
+++ b/src/monite/types/price.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .currency_enum import CurrencyEnum
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class Price(UniversalBaseModel):
+ currency: CurrencyEnum = pydantic.Field()
+ """
+ The currency in which the price of the product is set.
+ """
+
+ value: int = pydantic.Field()
+ """
+ The actual price of the product.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/process_resource.py b/src/monite/types/process_resource.py
new file mode 100644
index 0000000..e7e6b68
--- /dev/null
+++ b/src/monite/types/process_resource.py
@@ -0,0 +1,51 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .process_status_enum import ProcessStatusEnum
+import pydantic
+import typing
+from .process_resource_script_snapshot import ProcessResourceScriptSnapshot
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ProcessResource(UniversalBaseModel):
+ id: str
+ status: ProcessStatusEnum = pydantic.Field()
+ """
+ Tthe current status of the approval policy process.
+ """
+
+ input: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ """
+ The input for the script.
+ """
+
+ error: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ The error for the process.
+ """
+
+ script_snapshot: typing.Optional[ProcessResourceScriptSnapshot] = pydantic.Field(default=None)
+ """
+ The script snapshot taken when script started.
+ """
+
+ metadata: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
+ """
+ The metadata for the process.
+ """
+
+ created_at: dt.datetime
+ updated_at: typing.Optional[dt.datetime] = None
+ created_by: typing.Optional[str] = None
+ updated_by: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/process_resource_script_snapshot.py b/src/monite/types/process_resource_script_snapshot.py
new file mode 100644
index 0000000..8261c62
--- /dev/null
+++ b/src/monite/types/process_resource_script_snapshot.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ProcessResourceScriptSnapshot = typing.Union[
+ bool, float, str, typing.List[typing.Optional[typing.Any]], typing.Dict[str, typing.Optional[typing.Any]]
+]
diff --git a/src/monite/types/process_status_enum.py b/src/monite/types/process_status_enum.py
new file mode 100644
index 0000000..64df239
--- /dev/null
+++ b/src/monite/types/process_status_enum.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ProcessStatusEnum = typing.Union[
+ typing.Literal["succeeded", "waiting", "failed", "running", "canceled", "timed_out"], typing.Any
+]
diff --git a/src/monite/types/product_cursor_fields.py b/src/monite/types/product_cursor_fields.py
new file mode 100644
index 0000000..efc0962
--- /dev/null
+++ b/src/monite/types/product_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ProductCursorFields = typing.Literal["name"]
diff --git a/src/monite/types/product_service_pagination_response.py b/src/monite/types/product_service_pagination_response.py
new file mode 100644
index 0000000..ca123fb
--- /dev/null
+++ b/src/monite/types/product_service_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .product_service_response import ProductServiceResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ProductServicePaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of products and services
+ """
+
+ data: typing.List[ProductServiceResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/product_service_response.py b/src/monite/types/product_service_response.py
new file mode 100644
index 0000000..dc4936b
--- /dev/null
+++ b/src/monite/types/product_service_response.py
@@ -0,0 +1,64 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .price import Price
+from .product_service_type_enum import ProductServiceTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ProductServiceResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Unique ID of the product.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the product was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the product was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Description of the product.
+ """
+
+ entity_id: str
+ entity_user_id: typing.Optional[str] = None
+ ledger_account_id: typing.Optional[str] = None
+ measure_unit_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique ID reference of the unit used to measure the quantity of this product (e.g. items, meters, kilograms).
+ """
+
+ name: str = pydantic.Field()
+ """
+ Name of the product.
+ """
+
+ price: typing.Optional[Price] = None
+ smallest_amount: typing.Optional[float] = pydantic.Field(default=None)
+ """
+ The smallest amount allowed for this product.
+ """
+
+ type: typing.Optional[ProductServiceTypeEnum] = pydantic.Field(default=None)
+ """
+ Specifies whether this offering is a product or service. This may affect the applicable tax rates.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/product_service_type_enum.py b/src/monite/types/product_service_type_enum.py
new file mode 100644
index 0000000..5472bf8
--- /dev/null
+++ b/src/monite/types/product_service_type_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ProductServiceTypeEnum = typing.Union[typing.Literal["product", "service"], typing.Any]
diff --git a/src/monite/types/project_cursor_fields.py b/src/monite/types/project_cursor_fields.py
new file mode 100644
index 0000000..7ea5529
--- /dev/null
+++ b/src/monite/types/project_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ProjectCursorFields = typing.Union[typing.Literal["id", "created_at"], typing.Any]
diff --git a/src/monite/types/project_pagination_response.py b/src/monite/types/project_pagination_response.py
new file mode 100644
index 0000000..34d9703
--- /dev/null
+++ b/src/monite/types/project_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .project_resource import ProjectResource
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ProjectPaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of projects.
+ """
+
+ data: typing.List[ProjectResource]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/project_resource.py b/src/monite/types/project_resource.py
new file mode 100644
index 0000000..0a87e22
--- /dev/null
+++ b/src/monite/types/project_resource.py
@@ -0,0 +1,89 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .tag_read_schema import TagReadSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ProjectResource(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ A unique ID assigned to this project.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Project created at
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Last time project was updated at
+ """
+
+ code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Project code
+ """
+
+ color: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Project color
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Project created by entity user
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Description of project
+ """
+
+ end_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Project end date
+ """
+
+ entity_id: str = pydantic.Field()
+ """
+ The ID of the entity to which the project was issued.
+ """
+
+ name: str = pydantic.Field()
+ """
+ The project name.
+ """
+
+ parent_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Parent project ID
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Project metadata
+ """
+
+ start_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Project start date
+ """
+
+ tags: typing.Optional[typing.List[TagReadSchema]] = pydantic.Field(default=None)
+ """
+ A list of user-defined tags (labels) assigned to this project.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/public_payment_link_response.py b/src/monite/types/public_payment_link_response.py
new file mode 100644
index 0000000..ab59473
--- /dev/null
+++ b/src/monite/types/public_payment_link_response.py
@@ -0,0 +1,38 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .currency_enum import CurrencyEnum
+import datetime as dt
+import typing
+from .invoice import Invoice
+from .account_response import AccountResponse
+from .payment_intent import PaymentIntent
+from .recipient_account_response import RecipientAccountResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class PublicPaymentLinkResponse(UniversalBaseModel):
+ id: str
+ amount: int
+ currency: CurrencyEnum
+ expires_at: dt.datetime
+ invoice: typing.Optional[Invoice] = None
+ payer: typing.Optional[AccountResponse] = None
+ payment_intent: typing.Optional[PaymentIntent] = None
+ payment_intent_id: str
+ payment_methods: typing.List[str]
+ payment_page_url: str
+ payment_reference: typing.Optional[str] = None
+ recipient: RecipientAccountResponse
+ return_url: typing.Optional[str] = None
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_counterpart_address_schema.py b/src/monite/types/purchase_order_counterpart_address_schema.py
new file mode 100644
index 0000000..a5b0c21
--- /dev/null
+++ b/src/monite/types/purchase_order_counterpart_address_schema.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from .allowed_countries import AllowedCountries
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PurchaseOrderCounterpartAddressSchema(UniversalBaseModel):
+ """
+ Address information.
+ """
+
+ city: str = pydantic.Field()
+ """
+ City name.
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ line1: str = pydantic.Field()
+ """
+ Street address.
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Additional address information (if any).
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ ZIP or postal code.
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, region, province, or county.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_counterpart_individual_response.py b/src/monite/types/purchase_order_counterpart_individual_response.py
new file mode 100644
index 0000000..76915f8
--- /dev/null
+++ b/src/monite/types/purchase_order_counterpart_individual_response.py
@@ -0,0 +1,56 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PurchaseOrderCounterpartIndividualResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are individuals (natural persons).
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's email address.
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The person's first name.
+ """
+
+ is_customer: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ last_name: str = pydantic.Field()
+ """
+ The person's last name.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's phone number.
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The person's title or honorific. Examples: Mr., Ms., Dr., Prof.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_counterpart_individual_root_response.py b/src/monite/types/purchase_order_counterpart_individual_root_response.py
new file mode 100644
index 0000000..9b8528c
--- /dev/null
+++ b/src/monite/types/purchase_order_counterpart_individual_root_response.py
@@ -0,0 +1,77 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .purchase_order_counterpart_individual_response import PurchaseOrderCounterpartIndividualResponse
+from .language_code_enum import LanguageCodeEnum
+from .counterpart_type import CounterpartType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PurchaseOrderCounterpartIndividualRootResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are individuals (natural persons).
+ """
+
+ id: str = pydantic.Field()
+ """
+ Unique ID of the counterpart.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was created. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was last updated. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ created_automatically: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ `true` if the counterpart was created automatically by Monite when processing incoming invoices with OCR. `false` if the counterpart was created by the API client.
+ """
+
+ default_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the counterpart's billing address. If the counterpart is US-based and needs to accept ACH payments, this address must have all fields filled in. If `default_billing_address_id` is not defined, the default address is instead used as the billing address for ACH payments.
+ """
+
+ default_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the shipping address.
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity user ID of counterpart creator.
+ """
+
+ individual: PurchaseOrderCounterpartIndividualResponse
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ type: CounterpartType = pydantic.Field()
+ """
+ The counterpart type: `organization` (juridical person) or `individual` (natural person).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_counterpart_organization_response.py b/src/monite/types/purchase_order_counterpart_organization_response.py
new file mode 100644
index 0000000..0a2cfd9
--- /dev/null
+++ b/src/monite/types/purchase_order_counterpart_organization_response.py
@@ -0,0 +1,46 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PurchaseOrderCounterpartOrganizationResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are organizations (juridical persons).
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The email address of the organization
+ """
+
+ is_customer: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a customer.
+ """
+
+ is_vendor: bool = pydantic.Field()
+ """
+ Indicates if the counterpart is a vendor.
+ """
+
+ legal_name: str = pydantic.Field()
+ """
+ The legal name of the organization.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The phone number of the organization
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_counterpart_organization_root_response.py b/src/monite/types/purchase_order_counterpart_organization_root_response.py
new file mode 100644
index 0000000..99d3b69
--- /dev/null
+++ b/src/monite/types/purchase_order_counterpart_organization_root_response.py
@@ -0,0 +1,77 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .language_code_enum import LanguageCodeEnum
+from .purchase_order_counterpart_organization_response import PurchaseOrderCounterpartOrganizationResponse
+from .counterpart_type import CounterpartType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PurchaseOrderCounterpartOrganizationRootResponse(UniversalBaseModel):
+ """
+ Represents counterparts that are organizations (juridical persons).
+ """
+
+ id: str = pydantic.Field()
+ """
+ Unique ID of the counterpart.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was created. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the counterpart was last updated. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ created_automatically: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ `true` if the counterpart was created automatically by Monite when processing incoming invoices with OCR. `false` if the counterpart was created by the API client.
+ """
+
+ default_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the counterpart's billing address. If the counterpart is US-based and needs to accept ACH payments, this address must have all fields filled in. If `default_billing_address_id` is not defined, the default address is instead used as the billing address for ACH payments.
+ """
+
+ default_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the shipping address.
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity user ID of counterpart creator.
+ """
+
+ language: typing.Optional[LanguageCodeEnum] = pydantic.Field(default=None)
+ """
+ The language used to generate pdf documents for this counterpart.
+ """
+
+ organization: PurchaseOrderCounterpartOrganizationResponse
+ reminders_enabled: typing.Optional[bool] = None
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart's taxpayer identification number or tax ID. This field is required for counterparts that are non-VAT registered.
+ """
+
+ type: CounterpartType = pydantic.Field()
+ """
+ The counterpart type: `organization` (juridical person) or `individual` (natural person).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_counterpart_schema.py b/src/monite/types/purchase_order_counterpart_schema.py
new file mode 100644
index 0000000..7db2620
--- /dev/null
+++ b/src/monite/types/purchase_order_counterpart_schema.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .purchase_order_counterpart_individual_root_response import PurchaseOrderCounterpartIndividualRootResponse
+from .purchase_order_counterpart_organization_root_response import PurchaseOrderCounterpartOrganizationRootResponse
+
+PurchaseOrderCounterpartSchema = typing.Union[
+ PurchaseOrderCounterpartIndividualRootResponse, PurchaseOrderCounterpartOrganizationRootResponse
+]
diff --git a/src/monite/types/purchase_order_cursor_fields.py b/src/monite/types/purchase_order_cursor_fields.py
new file mode 100644
index 0000000..70b51ef
--- /dev/null
+++ b/src/monite/types/purchase_order_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PurchaseOrderCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/purchase_order_email_preview_response.py b/src/monite/types/purchase_order_email_preview_response.py
new file mode 100644
index 0000000..232286a
--- /dev/null
+++ b/src/monite/types/purchase_order_email_preview_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PurchaseOrderEmailPreviewResponse(UniversalBaseModel):
+ """
+ A schema for returning a response for email preview
+ """
+
+ body_preview: str
+ subject_preview: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_email_sent_response.py b/src/monite/types/purchase_order_email_sent_response.py
new file mode 100644
index 0000000..4a53e6a
--- /dev/null
+++ b/src/monite/types/purchase_order_email_sent_response.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PurchaseOrderEmailSentResponse(UniversalBaseModel):
+ """
+ A schema for returning a response an email with a link to purchase order document has been sent
+ """
+
+ mail_id: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_item.py b/src/monite/types/purchase_order_item.py
new file mode 100644
index 0000000..d580cc4
--- /dev/null
+++ b/src/monite/types/purchase_order_item.py
@@ -0,0 +1,48 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .currency_enum import CurrencyEnum
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class PurchaseOrderItem(UniversalBaseModel):
+ currency: CurrencyEnum = pydantic.Field()
+ """
+ The currency in which the price of the product is set.
+ """
+
+ name: str = pydantic.Field()
+ """
+ The name of the product to purchase
+ """
+
+ price: int = pydantic.Field()
+ """
+ The subtotal cost (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ quantity: int = pydantic.Field()
+ """
+ Number (quantity) of products
+ """
+
+ unit: str = pydantic.Field()
+ """
+ Units (hours, meters, unit)
+ """
+
+ vat_rate: int = pydantic.Field()
+ """
+ Percent minor units. Example: 12.5% is 1250
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_pagination_response.py b/src/monite/types/purchase_order_pagination_response.py
new file mode 100644
index 0000000..0ddc670
--- /dev/null
+++ b/src/monite/types/purchase_order_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .purchase_order_response_schema import PurchaseOrderResponseSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PurchaseOrderPaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of purchase orders.
+ """
+
+ data: typing.List[PurchaseOrderResponseSchema]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_response_schema.py b/src/monite/types/purchase_order_response_schema.py
new file mode 100644
index 0000000..54a030c
--- /dev/null
+++ b/src/monite/types/purchase_order_response_schema.py
@@ -0,0 +1,112 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from .purchase_order_counterpart_schema import PurchaseOrderCounterpartSchema
+import typing
+from .purchase_order_counterpart_address_schema import PurchaseOrderCounterpartAddressSchema
+from .currency_enum import CurrencyEnum
+from .purchase_order_response_schema_entity import PurchaseOrderResponseSchemaEntity
+from .purchase_order_vat_id import PurchaseOrderVatId
+from .purchase_order_item import PurchaseOrderItem
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class PurchaseOrderResponseSchema(UniversalBaseModel):
+ """
+ Represents response for an Accounts Purchase Order document created by entity.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID assigned to this purchase order.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ counterpart: PurchaseOrderCounterpartSchema = pydantic.Field()
+ """
+ Counterpart information about an organization (juridical person) or individual (natural person) that provides goods and services to or buys them from an
+ """
+
+ counterpart_address: typing.Optional[PurchaseOrderCounterpartAddressSchema] = pydantic.Field(default=None)
+ """
+ Counterpart address data saved on creation or update of the purchase order.
+ """
+
+ counterpart_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The ID of counterpart address object stored in counterparts service. If not provided, counterpart's default address is used.
+ """
+
+ counterpart_id: str = pydantic.Field()
+ """
+ Counterpart unique ID.
+ """
+
+ created_by_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the creator of the purchase order
+ """
+
+ currency: CurrencyEnum = pydantic.Field()
+ """
+ The currency in which the price of the product is set. (all items need to have the same currency)
+ """
+
+ document_id: str
+ entity: PurchaseOrderResponseSchemaEntity = pydantic.Field()
+ """
+ Data of the entity (address, name, contact)
+ """
+
+ entity_id: str = pydantic.Field()
+ """
+ The ID of the entity which issued the purchase order.
+ """
+
+ entity_vat_id: typing.Optional[PurchaseOrderVatId] = None
+ file_id: typing.Optional[str] = None
+ file_url: typing.Optional[str] = None
+ issued_at: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ When status changed from 'draft' to 'send', so after sending purchase order
+ """
+
+ items: typing.List[PurchaseOrderItem] = pydantic.Field()
+ """
+ List of item to purchase
+ """
+
+ message: str = pydantic.Field()
+ """
+ Msg which will be send to counterpart for who the purchase order is issued.
+ """
+
+ status: str = pydantic.Field()
+ """
+ Purchase order can be in 'draft' state before sending it to counterpart. After that state is 'issued'
+ """
+
+ valid_for_days: int = pydantic.Field()
+ """
+ Number of days for which purchase order is valid
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/purchase_order_response_schema_entity.py b/src/monite/types/purchase_order_response_schema_entity.py
new file mode 100644
index 0000000..f2d0764
--- /dev/null
+++ b/src/monite/types/purchase_order_response_schema_entity.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .payable_entity_individual_response import PayableEntityIndividualResponse
+from .payable_entity_organization_response import PayableEntityOrganizationResponse
+
+PurchaseOrderResponseSchemaEntity = typing.Union[PayableEntityIndividualResponse, PayableEntityOrganizationResponse]
diff --git a/src/monite/types/purchase_order_status_enum.py b/src/monite/types/purchase_order_status_enum.py
new file mode 100644
index 0000000..f6ace2a
--- /dev/null
+++ b/src/monite/types/purchase_order_status_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+PurchaseOrderStatusEnum = typing.Union[typing.Literal["draft", "issued"], typing.Any]
diff --git a/src/monite/types/purchase_order_vat_id.py b/src/monite/types/purchase_order_vat_id.py
new file mode 100644
index 0000000..673d9dd
--- /dev/null
+++ b/src/monite/types/purchase_order_vat_id.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class PurchaseOrderVatId(UniversalBaseModel):
+ id: str
+ country: str
+ entity_id: str
+ type: str
+ value: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/quote_response_payload.py b/src/monite/types/quote_response_payload.py
new file mode 100644
index 0000000..ae07503
--- /dev/null
+++ b/src/monite/types/quote_response_payload.py
@@ -0,0 +1,272 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import pydantic
+import typing
+from .receivables_representation_of_counterpart_address import ReceivablesRepresentationOfCounterpartAddress
+from .receivable_counterpart_contact import ReceivableCounterpartContact
+from .receivable_counterpart_type import ReceivableCounterpartType
+from .receivable_counterpart_vat_id_response import ReceivableCounterpartVatIdResponse
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .quote_response_payload_entity import QuoteResponsePayloadEntity
+from .receivable_entity_address_schema import ReceivableEntityAddressSchema
+from .receivables_representation_of_entity_bank_account import ReceivablesRepresentationOfEntityBankAccount
+from .receivable_entity_vat_id_response import ReceivableEntityVatIdResponse
+from .receivable_file_schema import ReceivableFileSchema
+from .language_code_enum import LanguageCodeEnum
+from .response_item import ResponseItem
+from .quote_state_enum import QuoteStateEnum
+from .tag_read_schema import TagReadSchema
+from .total_vat_amount_item import TotalVatAmountItem
+from .vat_mode_enum import VatModeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class QuoteResponsePayload(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ based_on: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique ID of a previous document related to the receivable if applicable.
+ """
+
+ based_on_document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The unique document ID of a previous document related to the receivable if applicable.
+ """
+
+ comment: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Field with a comment on why the client declined this Quote
+ """
+
+ commercial_condition_description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The commercial terms of the receivable (e.g. The products must be delivered in X days).
+ """
+
+ counterpart_billing_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = pydantic.Field(
+ default=None
+ )
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_business_type: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Different types of companies for different countries, ex. GmbH, SAS, SNC, etc.
+ """
+
+ counterpart_contact: typing.Optional[ReceivableCounterpartContact] = pydantic.Field(default=None)
+ """
+ Additional information about counterpart contacts.
+ """
+
+ counterpart_id: str = pydantic.Field()
+ """
+ Unique ID of the counterpart.
+ """
+
+ counterpart_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A legal name of a counterpart it is an organization or first and last name if it is an individual
+ """
+
+ counterpart_shipping_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = pydantic.Field(
+ default=None
+ )
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ counterpart_tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The VAT/TAX ID of the counterpart.
+ """
+
+ counterpart_type: ReceivableCounterpartType = pydantic.Field()
+ """
+ The type of the counterpart.
+ """
+
+ counterpart_vat_id: typing.Optional[ReceivableCounterpartVatIdResponse] = None
+ currency: CurrencyEnum = pydantic.Field()
+ """
+ The currency used in the receivable.
+ """
+
+ deduction_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax deducted in minor units
+ """
+
+ deduction_memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information about a tax deduction
+ """
+
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a receivable.
+ """
+
+ discounted_subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable with discounts before taxes [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ document_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The sequential code systematically assigned to invoices.
+ """
+
+ due_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Optional field representing date until which invoice should be paid
+ """
+
+ entity: QuoteResponsePayloadEntity
+ entity_address: ReceivableEntityAddressSchema
+ entity_bank_account: typing.Optional[ReceivablesRepresentationOfEntityBankAccount] = None
+ entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity user who created this document.
+ """
+
+ entity_vat_id: typing.Optional[ReceivableEntityVatIdResponse] = None
+ expiry_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date (in ISO 8601 format) until which the quote is valid.
+ """
+
+ file: typing.Optional[ReceivableFileSchema] = None
+ file_language: LanguageCodeEnum = pydantic.Field()
+ """
+ The language of the customer-facing PDF file (`file_url`). The value matches the counterpart's `language` at the time when this PDF file was generated.
+ """
+
+ file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the counterpart's default language.
+ """
+
+ issue_date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ Optional field for the issue of the entry.
+ """
+
+ line_items: typing.List[ResponseItem]
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable.
+ """
+
+ original_file_language: LanguageCodeEnum = pydantic.Field()
+ """
+ The language of the entity's copy of the PDF file (`original_file_url`). The value matches the entity's `language` at the time when this PDF file was generated.
+ """
+
+ original_file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the entity's default language.
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ quote_accept_page_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Link for custom quote accept page
+ """
+
+ signature_required: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether acceptance a quote requires a signature.
+ """
+
+ status: QuoteStateEnum = pydantic.Field()
+ """
+ The status of the Quote inside the receivable workflow.
+ """
+
+ subtotal: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The subtotal (excluding VAT), in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ tags: typing.Optional[typing.List[TagReadSchema]] = pydantic.Field(default=None)
+ """
+ The list of tags for this receivable.
+ """
+
+ total_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable in [minor units](https://docs.monite.com/docs/currencies#minor-units). Calculated as a subtotal + total_vat_amount.
+ """
+
+ total_vat_amount: int = pydantic.Field()
+ """
+ The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ total_vat_amounts: typing.Optional[typing.List[TotalVatAmountItem]] = pydantic.Field(default=None)
+ """
+ List of total vat amount for each VAT, presented in receivable
+ """
+
+ total_withholding_tax: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total price of the receivable with tax withheld in minor units
+ """
+
+ trade_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Trade name of the entity
+ """
+
+ vat_exempt: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the goods, materials, or services listed in the receivable are exempt from VAT or not.
+ """
+
+ vat_exemption_rationale: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The reason for the VAT exemption, if applicable.
+ """
+
+ vat_mode: typing.Optional[VatModeEnum] = pydantic.Field(default=None)
+ """
+ Defines whether the prices of products in receivable will already include VAT or not.
+ """
+
+ withholding_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax withheld in percent minor units
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/quote_response_payload_entity.py b/src/monite/types/quote_response_payload_entity.py
new file mode 100644
index 0000000..f7e42f7
--- /dev/null
+++ b/src/monite/types/quote_response_payload_entity.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class QuoteResponsePayloadEntity_Organization(UniversalBaseModel):
+ type: typing.Literal["organization"] = "organization"
+ email: typing.Optional[str] = None
+ logo: typing.Optional[str] = None
+ name: str
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ vat_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class QuoteResponsePayloadEntity_Individual(UniversalBaseModel):
+ type: typing.Literal["individual"] = "individual"
+ email: typing.Optional[str] = None
+ first_name: str
+ last_name: str
+ logo: typing.Optional[str] = None
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+QuoteResponsePayloadEntity = typing.Union[
+ QuoteResponsePayloadEntity_Organization, QuoteResponsePayloadEntity_Individual
+]
diff --git a/src/monite/types/quote_state_enum.py b/src/monite/types/quote_state_enum.py
new file mode 100644
index 0000000..773dd72
--- /dev/null
+++ b/src/monite/types/quote_state_enum.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+QuoteStateEnum = typing.Union[
+ typing.Literal["draft", "issued", "accepted", "expired", "declined", "deleted"], typing.Any
+]
diff --git a/src/monite/types/receivable_counterpart_contact.py b/src/monite/types/receivable_counterpart_contact.py
new file mode 100644
index 0000000..a908f5d
--- /dev/null
+++ b/src/monite/types/receivable_counterpart_contact.py
@@ -0,0 +1,48 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .receivables_representation_of_counterpart_address import ReceivablesRepresentationOfCounterpartAddress
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableCounterpartContact(UniversalBaseModel):
+ address: ReceivablesRepresentationOfCounterpartAddress = pydantic.Field()
+ """
+ The contact address of the counterpart
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The contact email of the counterpart.
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The first name of the counterpart contact.
+ """
+
+ last_name: str = pydantic.Field()
+ """
+ The last name of the counterpart contact.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The contact phone number of the counterpart.
+ """
+
+ title: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The counterpart contact title (e.g. Dr., Mr., Mrs., Ms., etc).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_counterpart_type.py b/src/monite/types/receivable_counterpart_type.py
new file mode 100644
index 0000000..a00bc79
--- /dev/null
+++ b/src/monite/types/receivable_counterpart_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableCounterpartType = typing.Union[typing.Literal["individual", "organization"], typing.Any]
diff --git a/src/monite/types/receivable_counterpart_vat_id_response.py b/src/monite/types/receivable_counterpart_vat_id_response.py
new file mode 100644
index 0000000..35ec2b4
--- /dev/null
+++ b/src/monite/types/receivable_counterpart_vat_id_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .allowed_countries import AllowedCountries
+from .vat_id_type_enum import VatIdTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivableCounterpartVatIdResponse(UniversalBaseModel):
+ id: str
+ counterpart_id: str
+ country: typing.Optional[AllowedCountries] = None
+ type: typing.Optional[VatIdTypeEnum] = None
+ value: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_create_based_on_payload.py b/src/monite/types/receivable_create_based_on_payload.py
new file mode 100644
index 0000000..8bf7cb5
--- /dev/null
+++ b/src/monite/types/receivable_create_based_on_payload.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .based_on_transition_type import BasedOnTransitionType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableCreateBasedOnPayload(UniversalBaseModel):
+ based_on: str = pydantic.Field()
+ """
+ The unique ID of a previous document related to the receivable if applicable.
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this receivable.
+ """
+
+ type: BasedOnTransitionType = pydantic.Field()
+ """
+ The type of a created receivable. Currently supported transitions:quote -> invoice; invoice -> credit_note
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_cursor_fields.py b/src/monite/types/receivable_cursor_fields.py
new file mode 100644
index 0000000..09bf827
--- /dev/null
+++ b/src/monite/types/receivable_cursor_fields.py
@@ -0,0 +1,18 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableCursorFields = typing.Union[
+ typing.Literal[
+ "counterpart_name",
+ "counterpart_id",
+ "amount",
+ "status",
+ "due_date",
+ "issue_date",
+ "document_id",
+ "created_at",
+ "project_id",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/receivable_edit_flow.py b/src/monite/types/receivable_edit_flow.py
new file mode 100644
index 0000000..b31f805
--- /dev/null
+++ b/src/monite/types/receivable_edit_flow.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableEditFlow = typing.Union[typing.Literal["compliant", "partially_compliant", "non_compliant"], typing.Any]
diff --git a/src/monite/types/receivable_entity_address_schema.py b/src/monite/types/receivable_entity_address_schema.py
new file mode 100644
index 0000000..dcc2022
--- /dev/null
+++ b/src/monite/types/receivable_entity_address_schema.py
@@ -0,0 +1,52 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableEntityAddressSchema(UniversalBaseModel):
+ """
+ A schema represents address info of the entity
+ """
+
+ city: str = pydantic.Field()
+ """
+ A city (a full name) where the entity is registered
+ """
+
+ country: typing.Optional[AllowedCountries] = pydantic.Field(default=None)
+ """
+ A country name (as ISO code) where the entity is registered
+ """
+
+ line1: str = pydantic.Field()
+ """
+ A street where the entity is registered
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An alternative street used by the entity
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ A postal code of the address where the entity is registered
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A state in a country where the entity is registered
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_entity_base.py b/src/monite/types/receivable_entity_base.py
new file mode 100644
index 0000000..f75698a
--- /dev/null
+++ b/src/monite/types/receivable_entity_base.py
@@ -0,0 +1,41 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableEntityBase(UniversalBaseModel):
+ """
+ A base schemas for an entity
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An email of the entity
+ """
+
+ logo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A link to the entity logo
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_entity_individual.py b/src/monite/types/receivable_entity_individual.py
new file mode 100644
index 0000000..2214f10
--- /dev/null
+++ b/src/monite/types/receivable_entity_individual.py
@@ -0,0 +1,56 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableEntityIndividual(UniversalBaseModel):
+ """
+ A Response schema for an entity of individual type
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An email of the entity
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The first name of the entity issuing the receivable
+ """
+
+ last_name: str = pydantic.Field()
+ """
+ The last name of the entity issuing the receivable
+ """
+
+ logo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A link to the entity logo
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The Tax ID of the entity issuing the receivable
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_entity_individual_request.py b/src/monite/types/receivable_entity_individual_request.py
new file mode 100644
index 0000000..6b47aad
--- /dev/null
+++ b/src/monite/types/receivable_entity_individual_request.py
@@ -0,0 +1,56 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableEntityIndividualRequest(UniversalBaseModel):
+ """
+ A Request schema for an entity of individual type
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An email of the entity
+ """
+
+ first_name: str = pydantic.Field()
+ """
+ The first name of the entity issuing the receivable
+ """
+
+ last_name: str = pydantic.Field()
+ """
+ The last name of the entity issuing the receivable
+ """
+
+ logo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A link to the entity logo
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The Tax ID of the entity issuing the receivable
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_entity_organization.py b/src/monite/types/receivable_entity_organization.py
new file mode 100644
index 0000000..dfead7d
--- /dev/null
+++ b/src/monite/types/receivable_entity_organization.py
@@ -0,0 +1,56 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableEntityOrganization(UniversalBaseModel):
+ """
+ A Response schema for an entity of organization type
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An email of the entity
+ """
+
+ logo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A link to the entity logo
+ """
+
+ name: str = pydantic.Field()
+ """
+ The name of the entity issuing the receivable, when it is an organization.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The Tax ID of the entity issuing the receivable
+ """
+
+ vat_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The VAT ID of the entity issuing the receivable, when it is an organization.
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_entity_organization_request.py b/src/monite/types/receivable_entity_organization_request.py
new file mode 100644
index 0000000..2a03404
--- /dev/null
+++ b/src/monite/types/receivable_entity_organization_request.py
@@ -0,0 +1,51 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableEntityOrganizationRequest(UniversalBaseModel):
+ """
+ A Request schema for an entity of organization type
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An email of the entity
+ """
+
+ logo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A link to the entity logo
+ """
+
+ name: str = pydantic.Field()
+ """
+ The name of the entity issuing the receivable, when it is an organization.
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The Tax ID of the entity issuing the receivable
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_entity_vat_id_response.py b/src/monite/types/receivable_entity_vat_id_response.py
new file mode 100644
index 0000000..c40bc4d
--- /dev/null
+++ b/src/monite/types/receivable_entity_vat_id_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .allowed_countries import AllowedCountries
+import typing
+from .vat_id_type_enum import VatIdTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivableEntityVatIdResponse(UniversalBaseModel):
+ id: str
+ country: AllowedCountries
+ entity_id: str
+ type: typing.Optional[VatIdTypeEnum] = None
+ value: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_facade_create_invoice_payload.py b/src/monite/types/receivable_facade_create_invoice_payload.py
new file mode 100644
index 0000000..dadd6c4
--- /dev/null
+++ b/src/monite/types/receivable_facade_create_invoice_payload.py
@@ -0,0 +1,143 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .receivable_entity_base import ReceivableEntityBase
+from .line_item import LineItem
+from .vat_mode_enum import VatModeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableFacadeCreateInvoicePayload(UniversalBaseModel):
+ commercial_condition_description: typing.Optional[str] = None
+ counterpart_billing_address_id: str = pydantic.Field()
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_business_type: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Different types of companies for different countries, ex. GmbH, SAS, SNC, etc.
+ """
+
+ counterpart_id: str
+ counterpart_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ counterpart_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart VAT ID id
+ """
+
+ currency: CurrencyEnum
+ deduction_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax deducted in minor units
+ """
+
+ deduction_memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information about a tax deduction
+ """
+
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a receivable.
+ """
+
+ entity: typing.Optional[ReceivableEntityBase] = None
+ entity_bank_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity bank account ID
+ """
+
+ entity_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity VAT ID id
+ """
+
+ fulfillment_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date when the goods are shipped or the service is provided.
+
+ If omitted, defaults to the invoice issue date,
+ and the value is automatically set when the invoice status changes to `issued`.
+ """
+
+ line_items: typing.List[LineItem]
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable
+ """
+
+ overdue_reminder_id: typing.Optional[str] = None
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ payment_page_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Link to the invoice's payment page. Either Monite's payment links or your custom payment links.
+ """
+
+ payment_reminder_id: typing.Optional[str] = None
+ payment_terms_id: typing.Optional[str] = None
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ purchase_order: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Contain purchase order number.
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this receivable.
+ """
+
+ trade_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Trade name of the entity
+ """
+
+ type: typing.Literal["invoice"] = pydantic.Field(default="invoice")
+ """
+ The type of the document uploaded.
+ """
+
+ vat_exempt: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the goods, materials, or services listed in the receivable are exempt from VAT or not.
+ """
+
+ vat_exemption_rationale: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The reason for the VAT exemption, if applicable.
+ """
+
+ vat_mode: typing.Optional[VatModeEnum] = pydantic.Field(default=None)
+ """
+ Defines whether the prices of products in receivable will already include VAT or not.
+ """
+
+ withholding_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax withheld in percent minor units
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_facade_create_payload.py b/src/monite/types/receivable_facade_create_payload.py
new file mode 100644
index 0000000..7df4bf6
--- /dev/null
+++ b/src/monite/types/receivable_facade_create_payload.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .receivable_facade_create_quote_payload import ReceivableFacadeCreateQuotePayload
+from .receivable_facade_create_invoice_payload import ReceivableFacadeCreateInvoicePayload
+from .receivable_create_based_on_payload import ReceivableCreateBasedOnPayload
+
+ReceivableFacadeCreatePayload = typing.Union[
+ ReceivableFacadeCreateQuotePayload, ReceivableFacadeCreateInvoicePayload, ReceivableCreateBasedOnPayload
+]
diff --git a/src/monite/types/receivable_facade_create_quote_payload.py b/src/monite/types/receivable_facade_create_quote_payload.py
new file mode 100644
index 0000000..ce6a88b
--- /dev/null
+++ b/src/monite/types/receivable_facade_create_quote_payload.py
@@ -0,0 +1,137 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .receivable_entity_base import ReceivableEntityBase
+from .line_item import LineItem
+from .vat_mode_enum import VatModeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableFacadeCreateQuotePayload(UniversalBaseModel):
+ commercial_condition_description: typing.Optional[str] = None
+ counterpart_billing_address_id: str = pydantic.Field()
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_business_type: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Different types of companies for different countries, ex. GmbH, SAS, SNC, etc.
+ """
+
+ counterpart_id: str
+ counterpart_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ counterpart_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart VAT ID id
+ """
+
+ currency: CurrencyEnum
+ deduction_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax deducted in minor units
+ """
+
+ deduction_memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information about a tax deduction
+ """
+
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a receivable.
+ """
+
+ entity: typing.Optional[ReceivableEntityBase] = None
+ entity_bank_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity bank account ID
+ """
+
+ entity_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity VAT ID id
+ """
+
+ expiry_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date (in ISO 8601 format) until which the quote is valid.
+ """
+
+ line_items: typing.List[LineItem]
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ quote_accept_page_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Link for custom quote accept page
+ """
+
+ signature_required: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether acceptance a quote requires a signature.
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this receivable.
+ """
+
+ trade_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Trade name of the entity
+ """
+
+ type: typing.Literal["quote"] = pydantic.Field(default="quote")
+ """
+ The type of the document uploaded.
+ """
+
+ vat_exempt: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the goods, materials, or services listed in the receivable are exempt from VAT or not.
+ """
+
+ vat_exemption_rationale: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The reason for the VAT exemption, if applicable.
+ """
+
+ vat_mode: typing.Optional[VatModeEnum] = pydantic.Field(default=None)
+ """
+ Defines whether the prices of products in receivable will already include VAT or not.
+ """
+
+ withholding_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax withheld in percent minor units
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_file_schema.py b/src/monite/types/receivable_file_schema.py
new file mode 100644
index 0000000..d26d2df
--- /dev/null
+++ b/src/monite/types/receivable_file_schema.py
@@ -0,0 +1,79 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .receivable_page_schema import ReceivablePageSchema
+from .receivable_preview_schema import ReceivablePreviewSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableFileSchema(UniversalBaseModel):
+ """
+ Represents a file (such as a PDF invoice) that was uploaded to Monite.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of this file.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC date and time when this workflow was uploaded to Monite. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
+ """
+
+ file_type: str = pydantic.Field()
+ """
+ The type of the business object associated with this file.
+ """
+
+ md5: str = pydantic.Field()
+ """
+ The MD5 hash of the file.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The file's [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
+ """
+
+ name: str = pydantic.Field()
+ """
+ The original file name (if available).
+ """
+
+ pages: typing.Optional[typing.List[ReceivablePageSchema]] = pydantic.Field(default=None)
+ """
+ If the file is a PDF document, this property contains individual pages extracted from the file. Otherwise, an empty array.
+ """
+
+ previews: typing.Optional[typing.List[ReceivablePreviewSchema]] = pydantic.Field(default=None)
+ """
+ Preview images generated for this file. There can be multiple images with different sizes.
+ """
+
+ region: str = pydantic.Field()
+ """
+ Geographical region of the data center where the file is stored.
+ """
+
+ size: int = pydantic.Field()
+ """
+ The file size in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the file.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_file_url.py b/src/monite/types/receivable_file_url.py
new file mode 100644
index 0000000..2df03ec
--- /dev/null
+++ b/src/monite/types/receivable_file_url.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableFileUrl(UniversalBaseModel):
+ file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the counterpart's default language.
+ """
+
+ original_file_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The receivable's PDF URL in the entity's default language.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_history_cursor_fields.py b/src/monite/types/receivable_history_cursor_fields.py
new file mode 100644
index 0000000..4f07a89
--- /dev/null
+++ b/src/monite/types/receivable_history_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableHistoryCursorFields = typing.Literal["timestamp"]
diff --git a/src/monite/types/receivable_history_event_type_enum.py b/src/monite/types/receivable_history_event_type_enum.py
new file mode 100644
index 0000000..b9ca164
--- /dev/null
+++ b/src/monite/types/receivable_history_event_type_enum.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableHistoryEventTypeEnum = typing.Union[
+ typing.Literal[
+ "status_changed", "receivable_updated", "based_on_receivable_created", "payment_received", "mail_sent"
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/receivable_history_pagination_response.py b/src/monite/types/receivable_history_pagination_response.py
new file mode 100644
index 0000000..c9ee2c3
--- /dev/null
+++ b/src/monite/types/receivable_history_pagination_response.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .receivable_history_response import ReceivableHistoryResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableHistoryPaginationResponse(UniversalBaseModel):
+ data: typing.List[ReceivableHistoryResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_history_response.py b/src/monite/types/receivable_history_response.py
new file mode 100644
index 0000000..fe485cd
--- /dev/null
+++ b/src/monite/types/receivable_history_response.py
@@ -0,0 +1,51 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from .receivable_history_response_event_data import ReceivableHistoryResponseEventData
+from .receivable_history_event_type_enum import ReceivableHistoryEventTypeEnum
+import datetime as dt
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableHistoryResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ ID of the history record.
+ """
+
+ current_pdf_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Link, that will lead to the PDF that shows the state of the document after this change. If this change doesn’t change PDF - this field will be empty.
+ """
+
+ entity_user_id: typing.Optional[str] = None
+ event_data: ReceivableHistoryResponseEventData = pydantic.Field()
+ """
+ Payload of the event.
+ """
+
+ event_type: ReceivableHistoryEventTypeEnum = pydantic.Field()
+ """
+ The type of event.
+ """
+
+ receivable_id: str = pydantic.Field()
+ """
+ ID of receivable that was changed.
+ """
+
+ timestamp: dt.datetime = pydantic.Field()
+ """
+ Timestamp when the event has happened.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_history_response_event_data.py b/src/monite/types/receivable_history_response_event_data.py
new file mode 100644
index 0000000..b445801
--- /dev/null
+++ b/src/monite/types/receivable_history_response_event_data.py
@@ -0,0 +1,16 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .status_changed_event_data import StatusChangedEventData
+from .receivable_updated_event_data import ReceivableUpdatedEventData
+from .based_on_receivable_created_event_data import BasedOnReceivableCreatedEventData
+from .payment_received_event_data import PaymentReceivedEventData
+from .mail_sent_event_data import MailSentEventData
+
+ReceivableHistoryResponseEventData = typing.Union[
+ StatusChangedEventData,
+ ReceivableUpdatedEventData,
+ BasedOnReceivableCreatedEventData,
+ PaymentReceivedEventData,
+ MailSentEventData,
+]
diff --git a/src/monite/types/receivable_mail_cursor_fields.py b/src/monite/types/receivable_mail_cursor_fields.py
new file mode 100644
index 0000000..b4e251b
--- /dev/null
+++ b/src/monite/types/receivable_mail_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableMailCursorFields = typing.Union[typing.Literal["status", "created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/receivable_mail_pagination_response.py b/src/monite/types/receivable_mail_pagination_response.py
new file mode 100644
index 0000000..255fbd6
--- /dev/null
+++ b/src/monite/types/receivable_mail_pagination_response.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .receivable_mail_response import ReceivableMailResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableMailPaginationResponse(UniversalBaseModel):
+ data: typing.List[ReceivableMailResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_mail_recipient_state.py b/src/monite/types/receivable_mail_recipient_state.py
new file mode 100644
index 0000000..80de8e7
--- /dev/null
+++ b/src/monite/types/receivable_mail_recipient_state.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableMailRecipientState(UniversalBaseModel):
+ email: str = pydantic.Field()
+ """
+ An email address of the recipient.
+ """
+
+ error: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An error message in case the mailing was unsuccessful.
+ """
+
+ is_success: bool = pydantic.Field()
+ """
+ Whether mail was sent successfully.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_mail_recipients.py b/src/monite/types/receivable_mail_recipients.py
new file mode 100644
index 0000000..d733f30
--- /dev/null
+++ b/src/monite/types/receivable_mail_recipients.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .receivable_mail_recipient_state import ReceivableMailRecipientState
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivableMailRecipients(UniversalBaseModel):
+ bcc: typing.Optional[typing.List[ReceivableMailRecipientState]] = None
+ cc: typing.Optional[typing.List[ReceivableMailRecipientState]] = None
+ to: typing.Optional[typing.List[ReceivableMailRecipientState]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_mail_response.py b/src/monite/types/receivable_mail_response.py
new file mode 100644
index 0000000..082a7e7
--- /dev/null
+++ b/src/monite/types/receivable_mail_response.py
@@ -0,0 +1,37 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import pydantic
+import typing
+from .receivable_mail_recipients import ReceivableMailRecipients
+from .receivable_mail_status_enum import ReceivableMailStatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivableMailResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime = pydantic.Field()
+ """
+ The time the mail task was created
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ The time the mail task was updated
+ """
+
+ recipients: typing.Optional[ReceivableMailRecipients] = None
+ status: ReceivableMailStatusEnum = pydantic.Field()
+ """
+ The status of the mail sent by receivable
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_mail_status_enum.py b/src/monite/types/receivable_mail_status_enum.py
new file mode 100644
index 0000000..21f202d
--- /dev/null
+++ b/src/monite/types/receivable_mail_status_enum.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableMailStatusEnum = typing.Union[
+ typing.Literal["pending", "processing", "sent", "partially_sent", "failed"], typing.Any
+]
diff --git a/src/monite/types/receivable_page_schema.py b/src/monite/types/receivable_page_schema.py
new file mode 100644
index 0000000..737e947
--- /dev/null
+++ b/src/monite/types/receivable_page_schema.py
@@ -0,0 +1,47 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class ReceivablePageSchema(UniversalBaseModel):
+ """
+ When a PDF document is uploaded to Monite, it extracts individual pages from the document
+ and saves them as PNG images. This object contains the image and metadata of a single page.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of the image.
+ """
+
+ mimetype: str = pydantic.Field()
+ """
+ The [media type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the image.
+ """
+
+ number: int = pydantic.Field()
+ """
+ The page number in the PDF document, from 0.
+ """
+
+ size: int = pydantic.Field()
+ """
+ Image file size, in bytes.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The URL to download the image.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_pagination_response.py b/src/monite/types/receivable_pagination_response.py
new file mode 100644
index 0000000..5c42a46
--- /dev/null
+++ b/src/monite/types/receivable_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .receivable_response import ReceivableResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivablePaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of receivables
+ """
+
+ data: typing.List[ReceivableResponse]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_preview_response.py b/src/monite/types/receivable_preview_response.py
new file mode 100644
index 0000000..3b5579c
--- /dev/null
+++ b/src/monite/types/receivable_preview_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class ReceivablePreviewResponse(UniversalBaseModel):
+ """
+ A schema for receiving a request for previewing an email with a receivable document
+ """
+
+ body_preview: str
+ subject_preview: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_preview_schema.py b/src/monite/types/receivable_preview_schema.py
new file mode 100644
index 0000000..f083a1a
--- /dev/null
+++ b/src/monite/types/receivable_preview_schema.py
@@ -0,0 +1,36 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class ReceivablePreviewSchema(UniversalBaseModel):
+ """
+ A preview image generated for a file.
+ """
+
+ height: int = pydantic.Field()
+ """
+ The image height in pixels.
+ """
+
+ url: str = pydantic.Field()
+ """
+ The image URL.
+ """
+
+ width: int = pydantic.Field()
+ """
+ The image width in pixels.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_response.py b/src/monite/types/receivable_response.py
new file mode 100644
index 0000000..21b1f91
--- /dev/null
+++ b/src/monite/types/receivable_response.py
@@ -0,0 +1,239 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from .receivables_representation_of_counterpart_address import ReceivablesRepresentationOfCounterpartAddress
+from .receivable_counterpart_contact import ReceivableCounterpartContact
+from .receivable_counterpart_type import ReceivableCounterpartType
+from .receivable_counterpart_vat_id_response import ReceivableCounterpartVatIdResponse
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .quote_response_payload_entity import QuoteResponsePayloadEntity
+from .receivable_entity_address_schema import ReceivableEntityAddressSchema
+from .receivables_representation_of_entity_bank_account import ReceivablesRepresentationOfEntityBankAccount
+from .receivable_entity_vat_id_response import ReceivableEntityVatIdResponse
+from .receivable_file_schema import ReceivableFileSchema
+from .language_code_enum import LanguageCodeEnum
+from .response_item import ResponseItem
+from .quote_state_enum import QuoteStateEnum
+from .tag_read_schema import TagReadSchema
+from .total_vat_amount_item import TotalVatAmountItem
+from .vat_mode_enum import VatModeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+from .invoice_response_payload_entity import InvoiceResponsePayloadEntity
+from .payment_terms import PaymentTerms
+from .related_documents import RelatedDocuments
+from .receivables_status_enum import ReceivablesStatusEnum
+from .credit_note_response_payload_entity import CreditNoteResponsePayloadEntity
+from .credit_note_state_enum import CreditNoteStateEnum
+
+
+class ReceivableResponse_Quote(UniversalBaseModel):
+ type: typing.Literal["quote"] = "quote"
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ based_on: typing.Optional[str] = None
+ based_on_document_id: typing.Optional[str] = None
+ comment: typing.Optional[str] = None
+ commercial_condition_description: typing.Optional[str] = None
+ counterpart_billing_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = None
+ counterpart_business_type: typing.Optional[str] = None
+ counterpart_contact: typing.Optional[ReceivableCounterpartContact] = None
+ counterpart_id: str
+ counterpart_name: typing.Optional[str] = None
+ counterpart_shipping_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = None
+ counterpart_tax_id: typing.Optional[str] = None
+ counterpart_type: ReceivableCounterpartType
+ counterpart_vat_id: typing.Optional[ReceivableCounterpartVatIdResponse] = None
+ currency: CurrencyEnum
+ deduction_amount: typing.Optional[int] = None
+ deduction_memo: typing.Optional[str] = None
+ discount: typing.Optional[Discount] = None
+ discounted_subtotal: typing.Optional[int] = None
+ document_id: typing.Optional[str] = None
+ due_date: typing.Optional[str] = None
+ entity: QuoteResponsePayloadEntity
+ entity_address: ReceivableEntityAddressSchema
+ entity_bank_account: typing.Optional[ReceivablesRepresentationOfEntityBankAccount] = None
+ entity_user_id: typing.Optional[str] = None
+ entity_vat_id: typing.Optional[ReceivableEntityVatIdResponse] = None
+ expiry_date: typing.Optional[str] = None
+ file: typing.Optional[ReceivableFileSchema] = None
+ file_language: LanguageCodeEnum
+ file_url: typing.Optional[str] = None
+ issue_date: typing.Optional[dt.datetime] = None
+ line_items: typing.List[ResponseItem]
+ memo: typing.Optional[str] = None
+ original_file_language: LanguageCodeEnum
+ original_file_url: typing.Optional[str] = None
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ project_id: typing.Optional[str] = None
+ quote_accept_page_url: typing.Optional[str] = None
+ signature_required: typing.Optional[bool] = None
+ status: QuoteStateEnum
+ subtotal: typing.Optional[int] = None
+ tags: typing.Optional[typing.List[TagReadSchema]] = None
+ total_amount: typing.Optional[int] = None
+ total_vat_amount: int
+ total_vat_amounts: typing.Optional[typing.List[TotalVatAmountItem]] = None
+ total_withholding_tax: typing.Optional[int] = None
+ trade_name: typing.Optional[str] = None
+ vat_exempt: typing.Optional[bool] = None
+ vat_exemption_rationale: typing.Optional[str] = None
+ vat_mode: typing.Optional[VatModeEnum] = None
+ withholding_tax_rate: typing.Optional[int] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class ReceivableResponse_Invoice(UniversalBaseModel):
+ type: typing.Literal["invoice"] = "invoice"
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ amount_due: int
+ amount_paid: int
+ amount_to_pay: typing.Optional[int] = None
+ based_on: typing.Optional[str] = None
+ based_on_document_id: typing.Optional[str] = None
+ comment: typing.Optional[str] = None
+ commercial_condition_description: typing.Optional[str] = None
+ counterpart_billing_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = None
+ counterpart_business_type: typing.Optional[str] = None
+ counterpart_contact: typing.Optional[ReceivableCounterpartContact] = None
+ counterpart_id: str
+ counterpart_name: typing.Optional[str] = None
+ counterpart_shipping_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = None
+ counterpart_tax_id: typing.Optional[str] = None
+ counterpart_type: ReceivableCounterpartType
+ counterpart_vat_id: typing.Optional[ReceivableCounterpartVatIdResponse] = None
+ currency: CurrencyEnum
+ deduction_amount: typing.Optional[int] = None
+ deduction_memo: typing.Optional[str] = None
+ discount: typing.Optional[Discount] = None
+ discounted_subtotal: typing.Optional[int] = None
+ document_id: typing.Optional[str] = None
+ due_date: typing.Optional[str] = None
+ entity: InvoiceResponsePayloadEntity
+ entity_address: ReceivableEntityAddressSchema
+ entity_bank_account: typing.Optional[ReceivablesRepresentationOfEntityBankAccount] = None
+ entity_user_id: typing.Optional[str] = None
+ entity_vat_id: typing.Optional[ReceivableEntityVatIdResponse] = None
+ file: typing.Optional[ReceivableFileSchema] = None
+ file_language: LanguageCodeEnum
+ file_url: typing.Optional[str] = None
+ fulfillment_date: typing.Optional[str] = None
+ issue_date: typing.Optional[dt.datetime] = None
+ line_items: typing.List[ResponseItem]
+ memo: typing.Optional[str] = None
+ original_file_language: LanguageCodeEnum
+ original_file_url: typing.Optional[str] = None
+ overdue_reminder_id: typing.Optional[str] = None
+ paid_at: typing.Optional[dt.datetime] = None
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ payment_page_url: typing.Optional[str] = None
+ payment_reminder_id: typing.Optional[str] = None
+ payment_terms: typing.Optional[PaymentTerms] = None
+ project_id: typing.Optional[str] = None
+ purchase_order: typing.Optional[str] = None
+ recurrence_id: typing.Optional[str] = None
+ related_documents: RelatedDocuments
+ status: ReceivablesStatusEnum
+ subtotal: typing.Optional[int] = None
+ tags: typing.Optional[typing.List[TagReadSchema]] = None
+ total_amount: typing.Optional[int] = None
+ total_amount_with_credit_notes: int
+ total_vat_amount: int
+ total_vat_amounts: typing.Optional[typing.List[TotalVatAmountItem]] = None
+ total_withholding_tax: typing.Optional[int] = None
+ trade_name: typing.Optional[str] = None
+ vat_exempt: typing.Optional[bool] = None
+ vat_exemption_rationale: typing.Optional[str] = None
+ vat_mode: typing.Optional[VatModeEnum] = None
+ withholding_tax_rate: typing.Optional[int] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class ReceivableResponse_CreditNote(UniversalBaseModel):
+ type: typing.Literal["credit_note"] = "credit_note"
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ based_on: typing.Optional[str] = None
+ based_on_document_id: typing.Optional[str] = None
+ commercial_condition_description: typing.Optional[str] = None
+ counterpart_billing_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = None
+ counterpart_business_type: typing.Optional[str] = None
+ counterpart_contact: typing.Optional[ReceivableCounterpartContact] = None
+ counterpart_id: str
+ counterpart_name: typing.Optional[str] = None
+ counterpart_shipping_address: typing.Optional[ReceivablesRepresentationOfCounterpartAddress] = None
+ counterpart_tax_id: typing.Optional[str] = None
+ counterpart_type: ReceivableCounterpartType
+ counterpart_vat_id: typing.Optional[ReceivableCounterpartVatIdResponse] = None
+ currency: CurrencyEnum
+ deduction_amount: typing.Optional[int] = None
+ deduction_memo: typing.Optional[str] = None
+ discount: typing.Optional[Discount] = None
+ discounted_subtotal: typing.Optional[int] = None
+ document_id: typing.Optional[str] = None
+ due_date: typing.Optional[str] = None
+ entity: CreditNoteResponsePayloadEntity
+ entity_address: ReceivableEntityAddressSchema
+ entity_bank_account: typing.Optional[ReceivablesRepresentationOfEntityBankAccount] = None
+ entity_user_id: typing.Optional[str] = None
+ entity_vat_id: typing.Optional[ReceivableEntityVatIdResponse] = None
+ file: typing.Optional[ReceivableFileSchema] = None
+ file_language: LanguageCodeEnum
+ file_url: typing.Optional[str] = None
+ issue_date: typing.Optional[dt.datetime] = None
+ line_items: typing.List[ResponseItem]
+ memo: typing.Optional[str] = None
+ original_file_language: LanguageCodeEnum
+ original_file_url: typing.Optional[str] = None
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ project_id: typing.Optional[str] = None
+ purchase_order: typing.Optional[str] = None
+ status: CreditNoteStateEnum
+ subtotal: typing.Optional[int] = None
+ tags: typing.Optional[typing.List[TagReadSchema]] = None
+ total_amount: typing.Optional[int] = None
+ total_vat_amount: int
+ total_vat_amounts: typing.Optional[typing.List[TotalVatAmountItem]] = None
+ total_withholding_tax: typing.Optional[int] = None
+ trade_name: typing.Optional[str] = None
+ vat_exempt: typing.Optional[bool] = None
+ vat_exemption_rationale: typing.Optional[str] = None
+ vat_mode: typing.Optional[VatModeEnum] = None
+ withholding_tax_rate: typing.Optional[int] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+ReceivableResponse = typing.Union[ReceivableResponse_Quote, ReceivableResponse_Invoice, ReceivableResponse_CreditNote]
diff --git a/src/monite/types/receivable_send_response.py b/src/monite/types/receivable_send_response.py
new file mode 100644
index 0000000..7f08736
--- /dev/null
+++ b/src/monite/types/receivable_send_response.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class ReceivableSendResponse(UniversalBaseModel):
+ """
+ A schema for returning a response an email with a link to receivable document has been sent
+ """
+
+ mail_id: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_settings_payload.py b/src/monite/types/receivable_settings_payload.py
new file mode 100644
index 0000000..745ab23
--- /dev/null
+++ b/src/monite/types/receivable_settings_payload.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivableSettingsPayload(UniversalBaseModel):
+ create_without_personal_info: bool
+ deduction_title: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_settings_response.py b/src/monite/types/receivable_settings_response.py
new file mode 100644
index 0000000..dc68ca4
--- /dev/null
+++ b/src/monite/types/receivable_settings_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivableSettingsResponse(UniversalBaseModel):
+ create_without_personal_info: bool
+ deduction_title: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_templates_variable.py b/src/monite/types/receivable_templates_variable.py
new file mode 100644
index 0000000..488f9d1
--- /dev/null
+++ b/src/monite/types/receivable_templates_variable.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class ReceivableTemplatesVariable(UniversalBaseModel):
+ description: str
+ name: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_templates_variables_object.py b/src/monite/types/receivable_templates_variables_object.py
new file mode 100644
index 0000000..7a55813
--- /dev/null
+++ b/src/monite/types/receivable_templates_variables_object.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .variables_type import VariablesType
+import typing
+from .receivable_templates_variable import ReceivableTemplatesVariable
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivableTemplatesVariablesObject(UniversalBaseModel):
+ object_subtype: VariablesType
+ object_type: str
+ variables: typing.List[ReceivableTemplatesVariable]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_templates_variables_object_list.py b/src/monite/types/receivable_templates_variables_object_list.py
new file mode 100644
index 0000000..6fed53d
--- /dev/null
+++ b/src/monite/types/receivable_templates_variables_object_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .receivable_templates_variables_object import ReceivableTemplatesVariablesObject
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivableTemplatesVariablesObjectList(UniversalBaseModel):
+ data: typing.List[ReceivableTemplatesVariablesObject]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivable_type.py b/src/monite/types/receivable_type.py
new file mode 100644
index 0000000..ca399b4
--- /dev/null
+++ b/src/monite/types/receivable_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivableType = typing.Union[typing.Literal["quote", "invoice", "credit_note"], typing.Any]
diff --git a/src/monite/types/receivable_update_payload.py b/src/monite/types/receivable_update_payload.py
new file mode 100644
index 0000000..cbce319
--- /dev/null
+++ b/src/monite/types/receivable_update_payload.py
@@ -0,0 +1,11 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .update_quote_payload import UpdateQuotePayload
+from .update_invoice_payload import UpdateInvoicePayload
+from .update_credit_note_payload import UpdateCreditNotePayload
+from .update_issued_invoice_payload import UpdateIssuedInvoicePayload
+
+ReceivableUpdatePayload = typing.Union[
+ UpdateQuotePayload, UpdateInvoicePayload, UpdateCreditNotePayload, UpdateIssuedInvoicePayload
+]
diff --git a/src/monite/types/receivable_updated_event_data.py b/src/monite/types/receivable_updated_event_data.py
new file mode 100644
index 0000000..5928b8e
--- /dev/null
+++ b/src/monite/types/receivable_updated_event_data.py
@@ -0,0 +1,17 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class ReceivableUpdatedEventData(UniversalBaseModel):
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivables_preview_type_enum.py b/src/monite/types/receivables_preview_type_enum.py
new file mode 100644
index 0000000..5db92a5
--- /dev/null
+++ b/src/monite/types/receivables_preview_type_enum.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivablesPreviewTypeEnum = typing.Union[
+ typing.Literal["receivable", "discount_reminder", "final_reminder"], typing.Any
+]
diff --git a/src/monite/types/receivables_reminders_warning_message.py b/src/monite/types/receivables_reminders_warning_message.py
new file mode 100644
index 0000000..d51b140
--- /dev/null
+++ b/src/monite/types/receivables_reminders_warning_message.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivablesRemindersWarningMessage(UniversalBaseModel):
+ payment_reminders: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Warning message for payment reminder
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivables_representation_of_counterpart_address.py b/src/monite/types/receivables_representation_of_counterpart_address.py
new file mode 100644
index 0000000..11eb6e6
--- /dev/null
+++ b/src/monite/types/receivables_representation_of_counterpart_address.py
@@ -0,0 +1,53 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .allowed_countries import AllowedCountries
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivablesRepresentationOfCounterpartAddress(UniversalBaseModel):
+ id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the address in the system
+ """
+
+ city: str = pydantic.Field()
+ """
+ City name.
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ line1: str = pydantic.Field()
+ """
+ Street address.
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Additional address information (if any).
+ """
+
+ postal_code: str = pydantic.Field()
+ """
+ ZIP or postal code.
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ State, region, province, or county.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivables_representation_of_entity_bank_account.py b/src/monite/types/receivables_representation_of_entity_bank_account.py
new file mode 100644
index 0000000..1bb8923
--- /dev/null
+++ b/src/monite/types/receivables_representation_of_entity_bank_account.py
@@ -0,0 +1,57 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivablesRepresentationOfEntityBankAccount(UniversalBaseModel):
+ id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the entity bank account.
+ """
+
+ account_holder_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Account holder's name
+ """
+
+ account_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Account number (required if IBAN is not provided)
+ """
+
+ bank_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The name of the entity's bank account.
+ """
+
+ bic: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The BIC of the entity's bank account.
+ """
+
+ iban: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The IBAN of the entity's bank account.
+ """
+
+ routing_number: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Routing number (US)
+ """
+
+ sort_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Sort code (GB)
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivables_send_response.py b/src/monite/types/receivables_send_response.py
new file mode 100644
index 0000000..0aa8c9e
--- /dev/null
+++ b/src/monite/types/receivables_send_response.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ReceivablesSendResponse(UniversalBaseModel):
+ """
+ A schema for returning a response with list of ids by which user check sending status
+ """
+
+ mail_ids: typing.List[str]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/receivables_status_enum.py b/src/monite/types/receivables_status_enum.py
new file mode 100644
index 0000000..8d05ce0
--- /dev/null
+++ b/src/monite/types/receivables_status_enum.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReceivablesStatusEnum = typing.Union[
+ typing.Literal[
+ "draft",
+ "issued",
+ "accepted",
+ "expired",
+ "declined",
+ "recurring",
+ "partially_paid",
+ "paid",
+ "overdue",
+ "uncollectible",
+ "canceled",
+ "deleted",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/receivables_verify_response.py b/src/monite/types/receivables_verify_response.py
new file mode 100644
index 0000000..c52cbac
--- /dev/null
+++ b/src/monite/types/receivables_verify_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .missing_fields import MissingFields
+import pydantic
+from .receivables_reminders_warning_message import ReceivablesRemindersWarningMessage
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ReceivablesVerifyResponse(UniversalBaseModel):
+ """
+ A schema for returning a response with validation results
+ """
+
+ errors: typing.Optional[MissingFields] = pydantic.Field(default=None)
+ """
+ Missing fields of receivable
+ """
+
+ warnings: typing.Optional[ReceivablesRemindersWarningMessage] = pydantic.Field(default=None)
+ """
+ Warning message for payment reminder
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/recipient.py b/src/monite/types/recipient.py
new file mode 100644
index 0000000..f3d4a1a
--- /dev/null
+++ b/src/monite/types/recipient.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .recipient_type import RecipientType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class Recipient(UniversalBaseModel):
+ id: str
+ type: RecipientType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/recipient_account_response.py b/src/monite/types/recipient_account_response.py
new file mode 100644
index 0000000..d00a575
--- /dev/null
+++ b/src/monite/types/recipient_account_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .bank_account import BankAccount
+from .payment_account_type import PaymentAccountType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class RecipientAccountResponse(UniversalBaseModel):
+ id: str
+ bank_accounts: typing.Optional[typing.List[BankAccount]] = None
+ name: typing.Optional[str] = None
+ type: PaymentAccountType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/recipient_type.py b/src/monite/types/recipient_type.py
new file mode 100644
index 0000000..0d93383
--- /dev/null
+++ b/src/monite/types/recipient_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+RecipientType = typing.Union[typing.Literal["entity", "counterpart"], typing.Any]
diff --git a/src/monite/types/recipients.py b/src/monite/types/recipients.py
new file mode 100644
index 0000000..e0076f8
--- /dev/null
+++ b/src/monite/types/recipients.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class Recipients(UniversalBaseModel):
+ bcc: typing.Optional[typing.List[str]] = None
+ cc: typing.Optional[typing.List[str]] = None
+ to: typing.Optional[typing.List[str]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/recurrence.py b/src/monite/types/recurrence.py
new file mode 100644
index 0000000..ab3d897
--- /dev/null
+++ b/src/monite/types/recurrence.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import pydantic
+from .day_of_month import DayOfMonth
+import typing
+from .recurrence_iteration import RecurrenceIteration
+from .recurrence_status import RecurrenceStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class Recurrence(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was created. Timestamps follow the ISO 8601 standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Time at which the receivable was last updated. Timestamps follow the ISO 8601 standard.
+ """
+
+ current_iteration: int
+ day_of_month: DayOfMonth
+ end_month: int
+ end_year: int
+ invoice_id: str
+ iterations: typing.List[RecurrenceIteration]
+ start_month: int
+ start_year: int
+ status: RecurrenceStatus
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/recurrence_iteration.py b/src/monite/types/recurrence_iteration.py
new file mode 100644
index 0000000..5754648
--- /dev/null
+++ b/src/monite/types/recurrence_iteration.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .iteration_status import IterationStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class RecurrenceIteration(UniversalBaseModel):
+ issue_at: str
+ issued_invoice_id: typing.Optional[str] = None
+ iteration: typing.Optional[int] = None
+ status: IterationStatus
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/recurrence_status.py b/src/monite/types/recurrence_status.py
new file mode 100644
index 0000000..fb3e909
--- /dev/null
+++ b/src/monite/types/recurrence_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+RecurrenceStatus = typing.Union[typing.Literal["active", "canceled", "completed"], typing.Any]
diff --git a/src/monite/types/related_documents.py b/src/monite/types/related_documents.py
new file mode 100644
index 0000000..6900200
--- /dev/null
+++ b/src/monite/types/related_documents.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class RelatedDocuments(UniversalBaseModel):
+ credit_note_ids: typing.Optional[typing.List[str]] = None
+ proforma_invoice_id: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/reminder.py b/src/monite/types/reminder.py
new file mode 100644
index 0000000..7443734
--- /dev/null
+++ b/src/monite/types/reminder.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class Reminder(UniversalBaseModel):
+ body: str
+ days_before: int
+ subject: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/reminder_type_enum.py b/src/monite/types/reminder_type_enum.py
new file mode 100644
index 0000000..1653591
--- /dev/null
+++ b/src/monite/types/reminder_type_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ReminderTypeEnum = typing.Union[typing.Literal["term_1", "term_2", "term_final", "overdue"], typing.Any]
diff --git a/src/monite/types/reminders_settings.py b/src/monite/types/reminders_settings.py
new file mode 100644
index 0000000..d637d0c
--- /dev/null
+++ b/src/monite/types/reminders_settings.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class RemindersSettings(UniversalBaseModel):
+ enabled: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/requirements_error.py b/src/monite/types/requirements_error.py
new file mode 100644
index 0000000..e3a36af
--- /dev/null
+++ b/src/monite/types/requirements_error.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class RequirementsError(UniversalBaseModel):
+ code: str
+ reason: str
+ requirement: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/response_item.py b/src/monite/types/response_item.py
new file mode 100644
index 0000000..9842882
--- /dev/null
+++ b/src/monite/types/response_item.py
@@ -0,0 +1,35 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .discount import Discount
+import pydantic
+from .line_item_product import LineItemProduct
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class ResponseItem(UniversalBaseModel):
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a product.
+ """
+
+ product: LineItemProduct
+ quantity: float = pydantic.Field()
+ """
+ The quantity of each of the goods, materials, or services listed in the receivable.
+ """
+
+ total_before_vat: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Total of line_item before VAT in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/role_cursor_fields.py b/src/monite/types/role_cursor_fields.py
new file mode 100644
index 0000000..b350462
--- /dev/null
+++ b/src/monite/types/role_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+RoleCursorFields = typing.Union[typing.Literal["updated_at", "created_at"], typing.Any]
diff --git a/src/monite/types/role_pagination_response.py b/src/monite/types/role_pagination_response.py
new file mode 100644
index 0000000..7221c12
--- /dev/null
+++ b/src/monite/types/role_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .role_response import RoleResponse
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class RolePaginationResponse(UniversalBaseModel):
+ data: typing.List[RoleResponse] = pydantic.Field()
+ """
+ array of records
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/role_response.py b/src/monite/types/role_response.py
new file mode 100644
index 0000000..9721061
--- /dev/null
+++ b/src/monite/types/role_response.py
@@ -0,0 +1,50 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from .biz_objects_schema import BizObjectsSchema
+from .status_enum import StatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class RoleResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ UUID role ID
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ UTC datetime
+ """
+
+ name: str = pydantic.Field()
+ """
+ Role name
+ """
+
+ permissions: BizObjectsSchema = pydantic.Field()
+ """
+ Access permissions
+ """
+
+ status: StatusEnum = pydantic.Field()
+ """
+ record status, 'active' by default
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/root_schema.py b/src/monite/types/root_schema.py
new file mode 100644
index 0000000..2d25569
--- /dev/null
+++ b/src/monite/types/root_schema.py
@@ -0,0 +1,418 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .action_schema import ActionSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+from .payable_action_schema import PayableActionSchema
+
+
+class RootSchema_Person(UniversalBaseModel):
+ object_type: typing.Literal["person"] = "person"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Onboarding(UniversalBaseModel):
+ object_type: typing.Literal["onboarding"] = "onboarding"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Comment(UniversalBaseModel):
+ object_type: typing.Literal["comment"] = "comment"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Counterpart(UniversalBaseModel):
+ object_type: typing.Literal["counterpart"] = "counterpart"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_EntityUser(UniversalBaseModel):
+ object_type: typing.Literal["entity_user"] = "entity_user"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Entity(UniversalBaseModel):
+ object_type: typing.Literal["entity"] = "entity"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_EntityVatIds(UniversalBaseModel):
+ object_type: typing.Literal["entity_vat_ids"] = "entity_vat_ids"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_CounterpartVatId(UniversalBaseModel):
+ object_type: typing.Literal["counterpart_vat_id"] = "counterpart_vat_id"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_EntityBankAccount(UniversalBaseModel):
+ object_type: typing.Literal["entity_bank_account"] = "entity_bank_account"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Export(UniversalBaseModel):
+ object_type: typing.Literal["export"] = "export"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_PayablesPurchaseOrder(UniversalBaseModel):
+ object_type: typing.Literal["payables_purchase_order"] = "payables_purchase_order"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_PaymentReminder(UniversalBaseModel):
+ object_type: typing.Literal["payment_reminder"] = "payment_reminder"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_OverdueReminder(UniversalBaseModel):
+ object_type: typing.Literal["overdue_reminder"] = "overdue_reminder"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Product(UniversalBaseModel):
+ object_type: typing.Literal["product"] = "product"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Project(UniversalBaseModel):
+ object_type: typing.Literal["project"] = "project"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Receivable(UniversalBaseModel):
+ object_type: typing.Literal["receivable"] = "receivable"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Reconciliation(UniversalBaseModel):
+ object_type: typing.Literal["reconciliation"] = "reconciliation"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Role(UniversalBaseModel):
+ object_type: typing.Literal["role"] = "role"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Tag(UniversalBaseModel):
+ object_type: typing.Literal["tag"] = "tag"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_TodoTask(UniversalBaseModel):
+ object_type: typing.Literal["todo_task"] = "todo_task"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_TodoTaskMute(UniversalBaseModel):
+ object_type: typing.Literal["todo_task_mute"] = "todo_task_mute"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Transaction(UniversalBaseModel):
+ object_type: typing.Literal["transaction"] = "transaction"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Workflow(UniversalBaseModel):
+ object_type: typing.Literal["workflow"] = "workflow"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_ApprovalRequest(UniversalBaseModel):
+ object_type: typing.Literal["approval_request"] = "approval_request"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_ApprovalPolicy(UniversalBaseModel):
+ object_type: typing.Literal["approval_policy"] = "approval_policy"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_PaymentRecord(UniversalBaseModel):
+ object_type: typing.Literal["payment_record"] = "payment_record"
+ actions: typing.Optional[typing.List[ActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class RootSchema_Payable(UniversalBaseModel):
+ object_type: typing.Literal["payable"] = "payable"
+ actions: typing.Optional[typing.List[PayableActionSchema]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+RootSchema = typing.Union[
+ RootSchema_Person,
+ RootSchema_Onboarding,
+ RootSchema_Comment,
+ RootSchema_Counterpart,
+ RootSchema_EntityUser,
+ RootSchema_Entity,
+ RootSchema_EntityVatIds,
+ RootSchema_CounterpartVatId,
+ RootSchema_EntityBankAccount,
+ RootSchema_Export,
+ RootSchema_PayablesPurchaseOrder,
+ RootSchema_PaymentReminder,
+ RootSchema_OverdueReminder,
+ RootSchema_Product,
+ RootSchema_Project,
+ RootSchema_Receivable,
+ RootSchema_Reconciliation,
+ RootSchema_Role,
+ RootSchema_Tag,
+ RootSchema_TodoTask,
+ RootSchema_TodoTaskMute,
+ RootSchema_Transaction,
+ RootSchema_Workflow,
+ RootSchema_ApprovalRequest,
+ RootSchema_ApprovalPolicy,
+ RootSchema_PaymentRecord,
+ RootSchema_Payable,
+]
diff --git a/src/monite/types/service_providers_enum.py b/src/monite/types/service_providers_enum.py
new file mode 100644
index 0000000..3349c90
--- /dev/null
+++ b/src/monite/types/service_providers_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ServiceProvidersEnum = typing.Union[typing.Literal["codat", "railz"], typing.Any]
diff --git a/src/monite/types/signature.py b/src/monite/types/signature.py
new file mode 100644
index 0000000..7486b6e
--- /dev/null
+++ b/src/monite/types/signature.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class Signature(UniversalBaseModel):
+ email: str = pydantic.Field()
+ """
+ The email of a person who signed a quote
+ """
+
+ full_name: str = pydantic.Field()
+ """
+ The full name of a person who signed a quote
+ """
+
+ signature_image: str = pydantic.Field()
+ """
+ Base64 encoded PNG image of a signature
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/single_onboarding_requirements_response.py b/src/monite/types/single_onboarding_requirements_response.py
new file mode 100644
index 0000000..71280cf
--- /dev/null
+++ b/src/monite/types/single_onboarding_requirements_response.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .payment_method_requirements import PaymentMethodRequirements
+from .onboarding_requirements_error import OnboardingRequirementsError
+from .onboarding_verification_error import OnboardingVerificationError
+from .onboarding_verification_status_enum import OnboardingVerificationStatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class SingleOnboardingRequirementsResponse(UniversalBaseModel):
+ disabled_reason: typing.Optional[str] = None
+ payment_method: str
+ requirements: PaymentMethodRequirements
+ requirements_errors: typing.List[OnboardingRequirementsError]
+ verification_errors: typing.List[OnboardingVerificationError]
+ verification_status: OnboardingVerificationStatusEnum
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/single_payment_intent.py b/src/monite/types/single_payment_intent.py
new file mode 100644
index 0000000..451964e
--- /dev/null
+++ b/src/monite/types/single_payment_intent.py
@@ -0,0 +1,27 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .payment_object_payable import PaymentObjectPayable
+import typing
+import pydantic
+from .payment_intents_recipient import PaymentIntentsRecipient
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class SinglePaymentIntent(UniversalBaseModel):
+ object: PaymentObjectPayable
+ payment_reference: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Must be provided if payable's document id is missing.
+ """
+
+ recipient: PaymentIntentsRecipient
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/single_payment_intent_response.py b/src/monite/types/single_payment_intent_response.py
new file mode 100644
index 0000000..8ac3e85
--- /dev/null
+++ b/src/monite/types/single_payment_intent_response.py
@@ -0,0 +1,31 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+from .currency_enum import CurrencyEnum
+import typing
+from .payment_object_payable import PaymentObjectPayable
+from .payment_intents_recipient import PaymentIntentsRecipient
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class SinglePaymentIntentResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ amount: int
+ currency: CurrencyEnum
+ error: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ object: PaymentObjectPayable
+ payment_reference: str
+ recipient: PaymentIntentsRecipient
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/source_of_payable_data_enum.py b/src/monite/types/source_of_payable_data_enum.py
new file mode 100644
index 0000000..02fd020
--- /dev/null
+++ b/src/monite/types/source_of_payable_data_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+SourceOfPayableDataEnum = typing.Union[typing.Literal["ocr", "user_specified"], typing.Any]
diff --git a/src/monite/types/status_changed_event_data.py b/src/monite/types/status_changed_event_data.py
new file mode 100644
index 0000000..1f744f6
--- /dev/null
+++ b/src/monite/types/status_changed_event_data.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .receivables_status_enum import ReceivablesStatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class StatusChangedEventData(UniversalBaseModel):
+ new_status: ReceivablesStatusEnum
+ old_status: ReceivablesStatusEnum
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/status_enum.py b/src/monite/types/status_enum.py
new file mode 100644
index 0000000..813ddbe
--- /dev/null
+++ b/src/monite/types/status_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+StatusEnum = typing.Union[typing.Literal["active", "deleted"], typing.Any]
diff --git a/src/monite/types/success_result.py b/src/monite/types/success_result.py
new file mode 100644
index 0000000..48cd724
--- /dev/null
+++ b/src/monite/types/success_result.py
@@ -0,0 +1,19 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class SuccessResult(UniversalBaseModel):
+ success: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/suggested_payment_term.py b/src/monite/types/suggested_payment_term.py
new file mode 100644
index 0000000..18a73a2
--- /dev/null
+++ b/src/monite/types/suggested_payment_term.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class SuggestedPaymentTerm(UniversalBaseModel):
+ """
+ Suggested payment date and corresponding discount
+ """
+
+ date: str
+ discount: typing.Optional[int] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/supported_field_names.py b/src/monite/types/supported_field_names.py
new file mode 100644
index 0000000..0828d53
--- /dev/null
+++ b/src/monite/types/supported_field_names.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+SupportedFieldNames = typing.Union[typing.Literal["default_account_code", "default_tax_rate_code"], typing.Any]
diff --git a/src/monite/types/supported_format_schema.py b/src/monite/types/supported_format_schema.py
new file mode 100644
index 0000000..fcfc9d0
--- /dev/null
+++ b/src/monite/types/supported_format_schema.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .export_format import ExportFormat
+from .supported_format_schema_object_type import SupportedFormatSchemaObjectType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class SupportedFormatSchema(UniversalBaseModel):
+ available_types: typing.Dict[str, typing.List[ExportFormat]]
+ object_type: SupportedFormatSchemaObjectType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/supported_format_schema_object_type.py b/src/monite/types/supported_format_schema_object_type.py
new file mode 100644
index 0000000..b0444e2
--- /dev/null
+++ b/src/monite/types/supported_format_schema_object_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+SupportedFormatSchemaObjectType = typing.Union[typing.Literal["payable", "receivable"], typing.Any]
diff --git a/src/monite/types/sync_record_cursor_fields.py b/src/monite/types/sync_record_cursor_fields.py
new file mode 100644
index 0000000..93ebf14
--- /dev/null
+++ b/src/monite/types/sync_record_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+SyncRecordCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/sync_record_resource.py b/src/monite/types/sync_record_resource.py
new file mode 100644
index 0000000..41b9f4e
--- /dev/null
+++ b/src/monite/types/sync_record_resource.py
@@ -0,0 +1,38 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+from .object_match_types import ObjectMatchTypes
+from .platform import Platform
+from .service_providers_enum import ServiceProvidersEnum
+from .sync_status import SyncStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class SyncRecordResource(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ errors: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None
+ last_pulled_at: dt.datetime
+ object_id: typing.Optional[str] = None
+ object_type: ObjectMatchTypes
+ object_updated_at: typing.Optional[dt.datetime] = None
+ platform: typing.Optional[Platform] = None
+ platform_object_id: typing.Optional[str] = None
+ platform_updated_at: typing.Optional[dt.datetime] = None
+ provider: typing.Optional[ServiceProvidersEnum] = None
+ provider_object_id: typing.Optional[str] = None
+ provider_updated_at: typing.Optional[dt.datetime] = None
+ sync_status: SyncStatus
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/sync_record_resource_list.py b/src/monite/types/sync_record_resource_list.py
new file mode 100644
index 0000000..9642f09
--- /dev/null
+++ b/src/monite/types/sync_record_resource_list.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .sync_record_resource import SyncRecordResource
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class SyncRecordResourceList(UniversalBaseModel):
+ data: typing.List[SyncRecordResource]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/sync_status.py b/src/monite/types/sync_status.py
new file mode 100644
index 0000000..c2f809b
--- /dev/null
+++ b/src/monite/types/sync_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+SyncStatus = typing.Union[typing.Literal["pending", "error", "done"], typing.Any]
diff --git a/src/monite/types/system_template_data_schema.py b/src/monite/types/system_template_data_schema.py
new file mode 100644
index 0000000..f056cf8
--- /dev/null
+++ b/src/monite/types/system_template_data_schema.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .template_data_schema import TemplateDataSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class SystemTemplateDataSchema(UniversalBaseModel):
+ available_templates: typing.List[TemplateDataSchema] = pydantic.Field()
+ """
+ Array of templates
+ """
+
+ template_name: str = pydantic.Field()
+ """
+ Name of the template
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/system_templates.py b/src/monite/types/system_templates.py
new file mode 100644
index 0000000..6e24479
--- /dev/null
+++ b/src/monite/types/system_templates.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .system_template_data_schema import SystemTemplateDataSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class SystemTemplates(UniversalBaseModel):
+ data: typing.List[SystemTemplateDataSchema] = pydantic.Field()
+ """
+ All pre-defined email templates
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/tag_category.py b/src/monite/types/tag_category.py
new file mode 100644
index 0000000..1ce323d
--- /dev/null
+++ b/src/monite/types/tag_category.py
@@ -0,0 +1,10 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+TagCategory = typing.Union[
+ typing.Literal[
+ "document_type", "department", "project", "cost_center", "vendor_type", "payment_method", "approval_status"
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/tag_cursor_fields.py b/src/monite/types/tag_cursor_fields.py
new file mode 100644
index 0000000..fe4c5fd
--- /dev/null
+++ b/src/monite/types/tag_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+TagCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/tag_read_schema.py b/src/monite/types/tag_read_schema.py
new file mode 100644
index 0000000..d07e05b
--- /dev/null
+++ b/src/monite/types/tag_read_schema.py
@@ -0,0 +1,58 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from .tag_category import TagCategory
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class TagReadSchema(UniversalBaseModel):
+ """
+ Represents a user-defined tag that can be assigned to resources to filter them.
+ """
+
+ id: str = pydantic.Field()
+ """
+ A unique ID of this tag.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the tag was created. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Date and time when the tag was last updated. Timestamps follow the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) standard.
+ """
+
+ category: typing.Optional[TagCategory] = pydantic.Field(default=None)
+ """
+ The tag category.
+ """
+
+ created_by_entity_user_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ ID of the user who created the tag.
+ """
+
+ description: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The tag description.
+ """
+
+ name: str = pydantic.Field()
+ """
+ The tag name.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/tags_pagination_response.py b/src/monite/types/tags_pagination_response.py
new file mode 100644
index 0000000..4631c56
--- /dev/null
+++ b/src/monite/types/tags_pagination_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .tag_read_schema import TagReadSchema
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class TagsPaginationResponse(UniversalBaseModel):
+ """
+ A paginated list of tags.
+ """
+
+ data: typing.List[TagReadSchema]
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/tax_component_response.py b/src/monite/types/tax_component_response.py
new file mode 100644
index 0000000..23d31c9
--- /dev/null
+++ b/src/monite/types/tax_component_response.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class TaxComponentResponse(UniversalBaseModel):
+ is_compound: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ A flag to indicate with the tax is calculated using the principle of compounding.
+ """
+
+ name: typing.Optional[str] = None
+ rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ Component tax rate in percent [minor units](https://docs.monite.com/docs/currencies#minor-units). Example: 12.5% is 1250.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/tax_rate_account_cursor_fields.py b/src/monite/types/tax_rate_account_cursor_fields.py
new file mode 100644
index 0000000..33ec01a
--- /dev/null
+++ b/src/monite/types/tax_rate_account_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+TaxRateAccountCursorFields = typing.Literal["name"]
diff --git a/src/monite/types/template_data_schema.py b/src/monite/types/template_data_schema.py
new file mode 100644
index 0000000..93e8217
--- /dev/null
+++ b/src/monite/types/template_data_schema.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class TemplateDataSchema(UniversalBaseModel):
+ body_template: str = pydantic.Field()
+ """
+ Jinja2 compatible email body template
+ """
+
+ language: str = pydantic.Field()
+ """
+ Lowercase ISO code of language
+ """
+
+ subject_template: str = pydantic.Field()
+ """
+ Jinja2 compatible email subject template
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/template_list_response.py b/src/monite/types/template_list_response.py
new file mode 100644
index 0000000..281cb1b
--- /dev/null
+++ b/src/monite/types/template_list_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .template_receivable_response import TemplateReceivableResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class TemplateListResponse(UniversalBaseModel):
+ data: typing.Optional[typing.List[TemplateReceivableResponse]] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/template_receivable_response.py b/src/monite/types/template_receivable_response.py
new file mode 100644
index 0000000..d204244
--- /dev/null
+++ b/src/monite/types/template_receivable_response.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+from .document_type_enum import DocumentTypeEnum
+from .file_schema import FileSchema
+from .template_type_enum import TemplateTypeEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class TemplateReceivableResponse(UniversalBaseModel):
+ id: str
+ created_at: typing.Optional[dt.datetime] = None
+ updated_at: typing.Optional[dt.datetime] = None
+ blocks: typing.Optional[typing.List[str]] = None
+ document_type: DocumentTypeEnum
+ is_default: bool
+ language: str
+ name: str
+ preview: typing.Optional[FileSchema] = None
+ template: str
+ template_type: typing.Optional[TemplateTypeEnum] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/template_type_enum.py b/src/monite/types/template_type_enum.py
new file mode 100644
index 0000000..47a9f47
--- /dev/null
+++ b/src/monite/types/template_type_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+TemplateTypeEnum = typing.Union[typing.Literal["block", "source_object"], typing.Any]
diff --git a/src/monite/types/term_final_with_date.py b/src/monite/types/term_final_with_date.py
new file mode 100644
index 0000000..5abbca8
--- /dev/null
+++ b/src/monite/types/term_final_with_date.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class TermFinalWithDate(UniversalBaseModel):
+ end_date: typing.Optional[str] = None
+ number_of_days: int = pydantic.Field()
+ """
+ The amount of days after the invoice issue date.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/terms_of_service_acceptance.py b/src/monite/types/terms_of_service_acceptance.py
new file mode 100644
index 0000000..c6a3c69
--- /dev/null
+++ b/src/monite/types/terms_of_service_acceptance.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import datetime as dt
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class TermsOfServiceAcceptance(UniversalBaseModel):
+ date: typing.Optional[dt.datetime] = pydantic.Field(default=None)
+ """
+ The date and time (in the ISO 8601 format) when the entity representative accepted the service agreement.
+ """
+
+ ip: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The IP address from which the entity representative accepted the service agreement. If omitted or set to `null` in the request, the IP address is inferred from the request origin or the `X-Forwarded-For` request header.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/text_template_response.py b/src/monite/types/text_template_response.py
new file mode 100644
index 0000000..1bab1da
--- /dev/null
+++ b/src/monite/types/text_template_response.py
@@ -0,0 +1,29 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+from .document_type_enum import DocumentTypeEnum
+from .text_template_type import TextTemplateType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class TextTemplateResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ document_type: DocumentTypeEnum
+ is_default: bool
+ name: str
+ template: str
+ type: TextTemplateType
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/text_template_response_list.py b/src/monite/types/text_template_response_list.py
new file mode 100644
index 0000000..45d7900
--- /dev/null
+++ b/src/monite/types/text_template_response_list.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .text_template_response import TextTemplateResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class TextTemplateResponseList(UniversalBaseModel):
+ data: typing.List[TextTemplateResponse]
+ next_pagination_token: typing.Optional[str] = None
+ prev_pagination_token: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/text_template_type.py b/src/monite/types/text_template_type.py
new file mode 100644
index 0000000..0119287
--- /dev/null
+++ b/src/monite/types/text_template_type.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+TextTemplateType = typing.Union[typing.Literal["email_header", "email_body", "memo"], typing.Any]
diff --git a/src/monite/types/total_vat_amount_item.py b/src/monite/types/total_vat_amount_item.py
new file mode 100644
index 0000000..3afa2d2
--- /dev/null
+++ b/src/monite/types/total_vat_amount_item.py
@@ -0,0 +1,28 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class TotalVatAmountItem(UniversalBaseModel):
+ id: typing.Optional[str] = None
+ amount: int = pydantic.Field()
+ """
+ The total VAT of all line items, in [minor units](https://docs.monite.com/docs/currencies#minor-units).
+ """
+
+ value: int = pydantic.Field()
+ """
+ Percent minor units. Example: 12.5% is 1250.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/unit.py b/src/monite/types/unit.py
new file mode 100644
index 0000000..ea37df5
--- /dev/null
+++ b/src/monite/types/unit.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class Unit(UniversalBaseModel):
+ designation: str
+ name: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/unit_list_response.py b/src/monite/types/unit_list_response.py
new file mode 100644
index 0000000..e3c75f7
--- /dev/null
+++ b/src/monite/types/unit_list_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .unit_response import UnitResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class UnitListResponse(UniversalBaseModel):
+ data: typing.List[UnitResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/unit_request.py b/src/monite/types/unit_request.py
new file mode 100644
index 0000000..676252f
--- /dev/null
+++ b/src/monite/types/unit_request.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class UnitRequest(UniversalBaseModel):
+ description: typing.Optional[str] = None
+ name: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/unit_response.py b/src/monite/types/unit_response.py
new file mode 100644
index 0000000..32d7f1f
--- /dev/null
+++ b/src/monite/types/unit_response.py
@@ -0,0 +1,24 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import datetime as dt
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class UnitResponse(UniversalBaseModel):
+ id: str
+ created_at: dt.datetime
+ updated_at: dt.datetime
+ description: typing.Optional[str] = None
+ name: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_credit_note.py b/src/monite/types/update_credit_note.py
new file mode 100644
index 0000000..e213f84
--- /dev/null
+++ b/src/monite/types/update_credit_note.py
@@ -0,0 +1,57 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .receivable_counterpart_contact import ReceivableCounterpartContact
+from .receivable_entity_base import ReceivableEntityBase
+from .update_line_item_for_credit_note import UpdateLineItemForCreditNote
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class UpdateCreditNote(UniversalBaseModel):
+ counterpart_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_contact: typing.Optional[ReceivableCounterpartContact] = pydantic.Field(default=None)
+ """
+ Additional information about counterpart contacts.
+ """
+
+ counterpart_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ entity: typing.Optional[ReceivableEntityBase] = None
+ line_items: typing.Optional[UpdateLineItemForCreditNote] = None
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this receivable.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_credit_note_payload.py b/src/monite/types/update_credit_note_payload.py
new file mode 100644
index 0000000..c799b76
--- /dev/null
+++ b/src/monite/types/update_credit_note_payload.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .update_credit_note import UpdateCreditNote
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class UpdateCreditNotePayload(UniversalBaseModel):
+ credit_note: UpdateCreditNote
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_entity_address_schema.py b/src/monite/types/update_entity_address_schema.py
new file mode 100644
index 0000000..6f55db9
--- /dev/null
+++ b/src/monite/types/update_entity_address_schema.py
@@ -0,0 +1,42 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class UpdateEntityAddressSchema(UniversalBaseModel):
+ city: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A city (a full name) where the entity is registered
+ """
+
+ line1: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A street where the entity is registered
+ """
+
+ line2: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An alternative street used by the entity
+ """
+
+ postal_code: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A postal code of the address where the entity is registered
+ """
+
+ state: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A state in a country where the entity is registered
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_entity_request.py b/src/monite/types/update_entity_request.py
new file mode 100644
index 0000000..99b4acd
--- /dev/null
+++ b/src/monite/types/update_entity_request.py
@@ -0,0 +1,59 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .update_entity_address_schema import UpdateEntityAddressSchema
+import pydantic
+from .optional_individual_schema import OptionalIndividualSchema
+from .optional_organization_schema import OptionalOrganizationSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class UpdateEntityRequest(UniversalBaseModel):
+ """
+ A schema for a request to update an entity
+ """
+
+ address: typing.Optional[UpdateEntityAddressSchema] = pydantic.Field(default=None)
+ """
+ An address description of the entity
+ """
+
+ email: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ An official email address of the entity
+ """
+
+ individual: typing.Optional[OptionalIndividualSchema] = pydantic.Field(default=None)
+ """
+ A set of meta data describing the individual
+ """
+
+ organization: typing.Optional[OptionalOrganizationSchema] = pydantic.Field(default=None)
+ """
+ A set of meta data describing the organization
+ """
+
+ phone: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A phone number of the entity
+ """
+
+ tax_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The entity's taxpayer identification number or tax ID. This field is required for entities that are non-VAT registered.
+ """
+
+ website: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A website of the entity
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_invoice.py b/src/monite/types/update_invoice.py
new file mode 100644
index 0000000..f949dda
--- /dev/null
+++ b/src/monite/types/update_invoice.py
@@ -0,0 +1,138 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .receivable_entity_base import ReceivableEntityBase
+from .line_item_update import LineItemUpdate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class UpdateInvoice(UniversalBaseModel):
+ """
+ Raise if None was explicitly passed to given fields
+ """
+
+ contact_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the counterpart contact.
+ """
+
+ counterpart_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the counterpart.
+ """
+
+ counterpart_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ counterpart_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart VAT ID id
+ """
+
+ currency: typing.Optional[CurrencyEnum] = None
+ deduction_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax deducted in minor units
+ """
+
+ deduction_memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information about a tax deduction
+ """
+
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a receivable.
+ """
+
+ entity: typing.Optional[ReceivableEntityBase] = None
+ entity_bank_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity bank account ID
+ """
+
+ entity_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity VAT ID id
+ """
+
+ fulfillment_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date when the goods are shipped or the service is provided.
+
+ If omitted, defaults to the invoice issue date,
+ and the value is automatically set when the invoice status changes to `issued`.
+ """
+
+ line_items: typing.Optional[typing.List[LineItemUpdate]] = None
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable
+ """
+
+ overdue_reminder_id: typing.Optional[str] = None
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ payment_page_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Link to your invoice's custom payment rails or external payment link.
+ """
+
+ payment_reminder_id: typing.Optional[str] = None
+ payment_terms_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the payment terms.
+ """
+
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this receivable.
+ """
+
+ trade_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Trade name of the entity
+ """
+
+ vat_exempt: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the goods, materials, or services listed in the receivable are exempt from VAT or not.
+ """
+
+ vat_exemption_rationale: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The reason for the VAT exemption, if applicable.
+ """
+
+ withholding_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax withheld in percent minor units
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_invoice_payload.py b/src/monite/types/update_invoice_payload.py
new file mode 100644
index 0000000..9746985
--- /dev/null
+++ b/src/monite/types/update_invoice_payload.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .update_invoice import UpdateInvoice
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class UpdateInvoicePayload(UniversalBaseModel):
+ invoice: UpdateInvoice
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_issued_invoice.py b/src/monite/types/update_issued_invoice.py
new file mode 100644
index 0000000..10bce87
--- /dev/null
+++ b/src/monite/types/update_issued_invoice.py
@@ -0,0 +1,76 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .update_issued_invoice_entity import UpdateIssuedInvoiceEntity
+from .receivable_entity_address_schema import ReceivableEntityAddressSchema
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class UpdateIssuedInvoice(UniversalBaseModel):
+ """
+ Raise if None was explicitly passed to given fields
+ """
+
+ contact_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the counterpart contact.
+ """
+
+ counterpart_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Id of a new or updated counterpart
+ """
+
+ counterpart_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart VAT ID id
+ """
+
+ entity: typing.Optional[UpdateIssuedInvoiceEntity] = None
+ entity_address: typing.Optional[ReceivableEntityAddressSchema] = None
+ entity_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity VAT ID id
+ """
+
+ fulfillment_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date when the goods are shipped or the service is provided.
+
+ If omitted, defaults to the invoice issue date,
+ and the value is automatically set when the invoice status changes to `issued`.
+ """
+
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable
+ """
+
+ overdue_reminder_id: typing.Optional[str] = None
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ payment_reminder_id: typing.Optional[str] = None
+ payment_terms_id: typing.Optional[str] = None
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this receivable.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_issued_invoice_entity.py b/src/monite/types/update_issued_invoice_entity.py
new file mode 100644
index 0000000..8626c5c
--- /dev/null
+++ b/src/monite/types/update_issued_invoice_entity.py
@@ -0,0 +1,49 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class UpdateIssuedInvoiceEntity_Organization(UniversalBaseModel):
+ type: typing.Literal["organization"] = "organization"
+ email: typing.Optional[str] = None
+ logo: typing.Optional[str] = None
+ name: str
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+class UpdateIssuedInvoiceEntity_Individual(UniversalBaseModel):
+ type: typing.Literal["individual"] = "individual"
+ email: typing.Optional[str] = None
+ first_name: str
+ last_name: str
+ logo: typing.Optional[str] = None
+ phone: typing.Optional[str] = None
+ tax_id: typing.Optional[str] = None
+ website: typing.Optional[str] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
+
+
+UpdateIssuedInvoiceEntity = typing.Union[UpdateIssuedInvoiceEntity_Organization, UpdateIssuedInvoiceEntity_Individual]
diff --git a/src/monite/types/update_issued_invoice_payload.py b/src/monite/types/update_issued_invoice_payload.py
new file mode 100644
index 0000000..a8753d2
--- /dev/null
+++ b/src/monite/types/update_issued_invoice_payload.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .update_issued_invoice import UpdateIssuedInvoice
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class UpdateIssuedInvoicePayload(UniversalBaseModel):
+ issued_invoice: UpdateIssuedInvoice
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_line_item_for_credit_note.py b/src/monite/types/update_line_item_for_credit_note.py
new file mode 100644
index 0000000..4a5630f
--- /dev/null
+++ b/src/monite/types/update_line_item_for_credit_note.py
@@ -0,0 +1,6 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .update_product_for_credit_note import UpdateProductForCreditNote
+
+UpdateLineItemForCreditNote = typing.Dict[str, UpdateProductForCreditNote]
diff --git a/src/monite/types/update_product_for_credit_note.py b/src/monite/types/update_product_for_credit_note.py
new file mode 100644
index 0000000..bc10f98
--- /dev/null
+++ b/src/monite/types/update_product_for_credit_note.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class UpdateProductForCreditNote(UniversalBaseModel):
+ old_price: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The old price of the line item. Used to choose for which line item new price should be applied
+ """
+
+ price_diff: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The price diff of the line item, i.e. applied discount
+ """
+
+ quantity: float = pydantic.Field()
+ """
+ The quantity of each of the goods, materials, or services listed in the receivable.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_quote.py b/src/monite/types/update_quote.py
new file mode 100644
index 0000000..8a952ed
--- /dev/null
+++ b/src/monite/types/update_quote.py
@@ -0,0 +1,138 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+import pydantic
+from .currency_enum import CurrencyEnum
+from .discount import Discount
+from .receivable_entity_base import ReceivableEntityBase
+from .line_item_update import LineItemUpdate
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class UpdateQuote(UniversalBaseModel):
+ """
+ Raise if None was explicitly passed to given fields
+ """
+
+ contact_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the counterpart contact.
+ """
+
+ counterpart_billing_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address of invoicing, need to state as a separate fields for some countries if it differs from address of a company.
+ """
+
+ counterpart_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the counterpart.
+ """
+
+ counterpart_shipping_address_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Address where goods were shipped / where services were provided.
+ """
+
+ counterpart_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Counterpart VAT ID id
+ """
+
+ currency: typing.Optional[CurrencyEnum] = None
+ deduction_amount: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax deducted in minor units
+ """
+
+ deduction_memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information about a tax deduction
+ """
+
+ discount: typing.Optional[Discount] = pydantic.Field(default=None)
+ """
+ The discount for a receivable.
+ """
+
+ entity: typing.Optional[ReceivableEntityBase] = None
+ entity_bank_account_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity bank account ID
+ """
+
+ entity_vat_id_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Entity VAT ID id
+ """
+
+ expiry_date: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The date (in ISO 8601 format) until which the quote is valid.
+ """
+
+ line_items: typing.Optional[typing.List[LineItemUpdate]] = None
+ memo: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A note with additional information for a receivable
+ """
+
+ partner_metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
+ """
+ Metadata for partner needs
+ """
+
+ payment_terms_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Unique ID of the payment terms.
+ """
+
+ project_id: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A project related to current receivable
+ """
+
+ quote_accept_page_url: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Link for custom quote accept page
+ """
+
+ signature_required: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Whether acceptance a quote requires a signature.
+ """
+
+ tag_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
+ """
+ A list of IDs of user-defined tags (labels) assigned to this receivable.
+ """
+
+ trade_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Trade name of the entity
+ """
+
+ vat_exempt: typing.Optional[bool] = pydantic.Field(default=None)
+ """
+ Indicates whether the goods, materials, or services listed in the receivable are exempt from VAT or not.
+ """
+
+ vat_exemption_rationale: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The reason for the VAT exemption, if applicable.
+ """
+
+ withholding_tax_rate: typing.Optional[int] = pydantic.Field(default=None)
+ """
+ The amount of tax withheld in percent minor units
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/update_quote_payload.py b/src/monite/types/update_quote_payload.py
new file mode 100644
index 0000000..6582bf2
--- /dev/null
+++ b/src/monite/types/update_quote_payload.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .update_quote import UpdateQuote
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class UpdateQuotePayload(UniversalBaseModel):
+ quote: UpdateQuote
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/validation_error.py b/src/monite/types/validation_error.py
new file mode 100644
index 0000000..93a2d80
--- /dev/null
+++ b/src/monite/types/validation_error.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .validation_error_loc_item import ValidationErrorLocItem
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class ValidationError(UniversalBaseModel):
+ loc: typing.List[ValidationErrorLocItem]
+ msg: str
+ type: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/validation_error_loc_item.py b/src/monite/types/validation_error_loc_item.py
new file mode 100644
index 0000000..9a0a83f
--- /dev/null
+++ b/src/monite/types/validation_error_loc_item.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+ValidationErrorLocItem = typing.Union[str, int]
diff --git a/src/monite/types/variable.py b/src/monite/types/variable.py
new file mode 100644
index 0000000..9d456ce
--- /dev/null
+++ b/src/monite/types/variable.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class Variable(UniversalBaseModel):
+ description: str
+ name: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/variables_object.py b/src/monite/types/variables_object.py
new file mode 100644
index 0000000..0bf59c3
--- /dev/null
+++ b/src/monite/types/variables_object.py
@@ -0,0 +1,23 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .document_type_enum import DocumentTypeEnum
+import typing
+from .variable import Variable
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class VariablesObject(UniversalBaseModel):
+ object_subtype: DocumentTypeEnum
+ object_type: str
+ variables: typing.List[Variable]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/variables_object_list.py b/src/monite/types/variables_object_list.py
new file mode 100644
index 0000000..24daa65
--- /dev/null
+++ b/src/monite/types/variables_object_list.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .variables_object import VariablesObject
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class VariablesObjectList(UniversalBaseModel):
+ data: typing.List[VariablesObject]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/variables_type.py b/src/monite/types/variables_type.py
new file mode 100644
index 0000000..427a07d
--- /dev/null
+++ b/src/monite/types/variables_type.py
@@ -0,0 +1,8 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+VariablesType = typing.Union[
+ typing.Literal["quote", "invoice", "credit_note", "discount_reminder", "final_reminder", "overdue_reminder"],
+ typing.Any,
+]
diff --git a/src/monite/types/vat_id_type_enum.py b/src/monite/types/vat_id_type_enum.py
new file mode 100644
index 0000000..b4ef21e
--- /dev/null
+++ b/src/monite/types/vat_id_type_enum.py
@@ -0,0 +1,56 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+VatIdTypeEnum = typing.Union[
+ typing.Literal[
+ "ae_trn",
+ "au_abn",
+ "au_arn",
+ "bg_uic",
+ "br_cnpj",
+ "br_cpf",
+ "ca_bn",
+ "ca_gst_hst",
+ "ca_pst_bc",
+ "ca_pst_mb",
+ "ca_pst_sk",
+ "ca_qst",
+ "ch_vat",
+ "cl_tin",
+ "es_cif",
+ "eu_oss_vat",
+ "eu_vat",
+ "gb_vat",
+ "ge_vat",
+ "hk_br",
+ "hu_tin",
+ "id_npwp",
+ "il_vat",
+ "in_gst",
+ "is_vat",
+ "jp_cn",
+ "jp_rn",
+ "kr_brn",
+ "li_uid",
+ "mx_rfc",
+ "my_frp",
+ "my_itn",
+ "my_sst",
+ "no_vat",
+ "nz_gst",
+ "ru_inn",
+ "ru_kpp",
+ "sa_vat",
+ "sg_gst",
+ "sg_uen",
+ "si_tin",
+ "th_vat",
+ "tw_vat",
+ "ua_vat",
+ "us_ein",
+ "za_vat",
+ "unknown",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/vat_mode_enum.py b/src/monite/types/vat_mode_enum.py
new file mode 100644
index 0000000..566e35f
--- /dev/null
+++ b/src/monite/types/vat_mode_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+VatModeEnum = typing.Union[typing.Literal["exclusive", "inclusive"], typing.Any]
diff --git a/src/monite/types/vat_rate_creator.py b/src/monite/types/vat_rate_creator.py
new file mode 100644
index 0000000..bb890f3
--- /dev/null
+++ b/src/monite/types/vat_rate_creator.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+VatRateCreator = typing.Union[typing.Literal["monite", "accounting"], typing.Any]
diff --git a/src/monite/types/vat_rate_list_response.py b/src/monite/types/vat_rate_list_response.py
new file mode 100644
index 0000000..ce99ebd
--- /dev/null
+++ b/src/monite/types/vat_rate_list_response.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .vat_rate_response import VatRateResponse
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class VatRateListResponse(UniversalBaseModel):
+ data: typing.List[VatRateResponse]
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/vat_rate_response.py b/src/monite/types/vat_rate_response.py
new file mode 100644
index 0000000..ed21e99
--- /dev/null
+++ b/src/monite/types/vat_rate_response.py
@@ -0,0 +1,66 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+from .allowed_countries import AllowedCountries
+import typing
+from .vat_rate_creator import VatRateCreator
+from .vat_rate_status_enum import VatRateStatusEnum
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class VatRateResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Unique identifier of the vat rate object.
+ """
+
+ created_at: dt.datetime = pydantic.Field()
+ """
+ Date/time when this rate was recorded in the table.
+ """
+
+ updated_at: dt.datetime = pydantic.Field()
+ """
+ Date/time when this rate was updated in the table.
+ """
+
+ country: AllowedCountries = pydantic.Field()
+ """
+ Two-letter ISO country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
+ """
+
+ created_by: typing.Optional[VatRateCreator] = pydantic.Field(default=None)
+ """
+ By whom this rate was recorded: monite employee | accounting system.
+ """
+
+ status: typing.Optional[VatRateStatusEnum] = pydantic.Field(default=None)
+ """
+ Status for this vat rate: active | inactive.
+ """
+
+ valid_from: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Date starting from when this rate can be used.
+ """
+
+ valid_until: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Date when this rate was depreciated, after this date rate cannot be used.
+ """
+
+ value: int = pydantic.Field()
+ """
+ Percent minor units. Example: 12.5% is 1250.
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/vat_rate_status_enum.py b/src/monite/types/vat_rate_status_enum.py
new file mode 100644
index 0000000..7636267
--- /dev/null
+++ b/src/monite/types/vat_rate_status_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+VatRateStatusEnum = typing.Union[typing.Literal["active", "inactive"], typing.Any]
diff --git a/src/monite/types/verification_airwallex_plaid_request.py b/src/monite/types/verification_airwallex_plaid_request.py
new file mode 100644
index 0000000..3abb74a
--- /dev/null
+++ b/src/monite/types/verification_airwallex_plaid_request.py
@@ -0,0 +1,32 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class VerificationAirwallexPlaidRequest(UniversalBaseModel):
+ client_name: str = pydantic.Field()
+ """
+ The name of your application to be displayed in Plaid Modal
+ """
+
+ link_customization_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ The name of the Link customization configured on the Plaid Dashboard. If not specified, the default customization will be applied
+ """
+
+ redirect_url: str = pydantic.Field()
+ """
+ URL to handle the OAuth verification flow
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/verification_airwallex_plaid_response.py b/src/monite/types/verification_airwallex_plaid_response.py
new file mode 100644
index 0000000..db42b74
--- /dev/null
+++ b/src/monite/types/verification_airwallex_plaid_response.py
@@ -0,0 +1,39 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+import datetime as dt
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class VerificationAirwallexPlaidResponse(UniversalBaseModel):
+ client_name: str = pydantic.Field()
+ """
+ Client name from the request
+ """
+
+ expires_at: dt.datetime
+ link_customization_name: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ Customization name from the request
+ """
+
+ link_token: str = pydantic.Field()
+ """
+ Link token that should be used to init Plaid SDK
+ """
+
+ redirect_url: str = pydantic.Field()
+ """
+ URL from the request
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/verification_error.py b/src/monite/types/verification_error.py
new file mode 100644
index 0000000..e477333
--- /dev/null
+++ b/src/monite/types/verification_error.py
@@ -0,0 +1,20 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class VerificationError(UniversalBaseModel):
+ code: str
+ details: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/verification_request.py b/src/monite/types/verification_request.py
new file mode 100644
index 0000000..886e2db
--- /dev/null
+++ b/src/monite/types/verification_request.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .verification_airwallex_plaid_request import VerificationAirwallexPlaidRequest
+from .bank_account_verification_type import BankAccountVerificationType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class VerificationRequest(UniversalBaseModel):
+ airwallex_plaid: VerificationAirwallexPlaidRequest
+ type: BankAccountVerificationType = "airwallex_plaid"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/verification_response.py b/src/monite/types/verification_response.py
new file mode 100644
index 0000000..4dc7770
--- /dev/null
+++ b/src/monite/types/verification_response.py
@@ -0,0 +1,22 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+from .verification_airwallex_plaid_response import VerificationAirwallexPlaidResponse
+from .bank_account_verification_type import BankAccountVerificationType
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+import pydantic
+
+
+class VerificationResponse(UniversalBaseModel):
+ airwallex_plaid: VerificationAirwallexPlaidResponse
+ type: BankAccountVerificationType = "airwallex_plaid"
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/verification_status_enum.py b/src/monite/types/verification_status_enum.py
new file mode 100644
index 0000000..7ffbcbf
--- /dev/null
+++ b/src/monite/types/verification_status_enum.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+VerificationStatusEnum = typing.Union[typing.Literal["enabled", "disabled", "pending"], typing.Any]
diff --git a/src/monite/types/verify_response.py b/src/monite/types/verify_response.py
new file mode 100644
index 0000000..4703692
--- /dev/null
+++ b/src/monite/types/verify_response.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import typing
+
+
+class VerifyResponse(UniversalBaseModel):
+ id: str = pydantic.Field()
+ """
+ Entry UUID
+ """
+
+ domain: str
+ status: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/webhook_delivery_cursor_fields.py b/src/monite/types/webhook_delivery_cursor_fields.py
new file mode 100644
index 0000000..c36783f
--- /dev/null
+++ b/src/monite/types/webhook_delivery_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+WebhookDeliveryCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/webhook_delivery_pagination_resource.py b/src/monite/types/webhook_delivery_pagination_resource.py
new file mode 100644
index 0000000..d711765
--- /dev/null
+++ b/src/monite/types/webhook_delivery_pagination_resource.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .webhook_delivery_resource import WebhookDeliveryResource
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class WebhookDeliveryPaginationResource(UniversalBaseModel):
+ data: typing.List[WebhookDeliveryResource] = pydantic.Field()
+ """
+ A set of webhooks returned per page
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/webhook_delivery_resource.py b/src/monite/types/webhook_delivery_resource.py
new file mode 100644
index 0000000..c16ef74
--- /dev/null
+++ b/src/monite/types/webhook_delivery_resource.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class WebhookDeliveryResource(UniversalBaseModel):
+ id: str
+ event_id: str
+ requests_made_count: int
+ response: typing.Optional[str] = None
+ response_status_code: typing.Optional[int] = None
+ url: str
+ was_successful: typing.Optional[bool] = None
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/webhook_object_type.py b/src/monite/types/webhook_object_type.py
new file mode 100644
index 0000000..70fa1be
--- /dev/null
+++ b/src/monite/types/webhook_object_type.py
@@ -0,0 +1,45 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+WebhookObjectType = typing.Union[
+ typing.Literal[
+ "account",
+ "approval",
+ "approval_request",
+ "approval_policy",
+ "batch_payment",
+ "comment",
+ "counterpart",
+ "counterpart_address",
+ "counterpart_bank_account",
+ "counterpart_contact_person",
+ "counterpart_partner_metadata",
+ "counterpart_tax_id",
+ "entity",
+ "entity_bank_account",
+ "entity_settings",
+ "entity_user",
+ "export",
+ "partner_settings",
+ "payable",
+ "payables_purchase_order",
+ "payable.line_item",
+ "payment",
+ "payment_intent",
+ "payment_link",
+ "product",
+ "receivable",
+ "recurrence",
+ "role",
+ "tag",
+ "todo_task",
+ "workflow",
+ "workflow_pipeline",
+ "overdue_reminder",
+ "payment_reminder",
+ "accounting_connection",
+ "project",
+ ],
+ typing.Any,
+]
diff --git a/src/monite/types/webhook_subscription_cursor_fields.py b/src/monite/types/webhook_subscription_cursor_fields.py
new file mode 100644
index 0000000..9db641e
--- /dev/null
+++ b/src/monite/types/webhook_subscription_cursor_fields.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+WebhookSubscriptionCursorFields = typing.Union[typing.Literal["created_at", "updated_at"], typing.Any]
diff --git a/src/monite/types/webhook_subscription_pagination_resource.py b/src/monite/types/webhook_subscription_pagination_resource.py
new file mode 100644
index 0000000..7ca5973
--- /dev/null
+++ b/src/monite/types/webhook_subscription_pagination_resource.py
@@ -0,0 +1,33 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .webhook_subscription_resource import WebhookSubscriptionResource
+import pydantic
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+
+
+class WebhookSubscriptionPaginationResource(UniversalBaseModel):
+ data: typing.List[WebhookSubscriptionResource] = pydantic.Field()
+ """
+ A set of webhook settings of different types returned per page
+ """
+
+ next_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the next page of results, or `null` if there is no next page (i.e. you've reached the last page).
+ """
+
+ prev_pagination_token: typing.Optional[str] = pydantic.Field(default=None)
+ """
+ A token that can be sent in the `pagination_token` query parameter to get the previous page of results, or `null` if there is no previous page (i.e. you've reached the first page).
+ """
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/webhook_subscription_resource.py b/src/monite/types/webhook_subscription_resource.py
new file mode 100644
index 0000000..a7d4b31
--- /dev/null
+++ b/src/monite/types/webhook_subscription_resource.py
@@ -0,0 +1,25 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .webhook_object_type import WebhookObjectType
+from .webhook_subscription_status import WebhookSubscriptionStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class WebhookSubscriptionResource(UniversalBaseModel):
+ id: str
+ event_types: typing.List[str]
+ object_type: WebhookObjectType
+ status: WebhookSubscriptionStatus
+ url: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/webhook_subscription_resource_with_secret.py b/src/monite/types/webhook_subscription_resource_with_secret.py
new file mode 100644
index 0000000..6ac1058
--- /dev/null
+++ b/src/monite/types/webhook_subscription_resource_with_secret.py
@@ -0,0 +1,26 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.pydantic_utilities import UniversalBaseModel
+import typing
+from .webhook_object_type import WebhookObjectType
+from .webhook_subscription_status import WebhookSubscriptionStatus
+from ..core.pydantic_utilities import IS_PYDANTIC_V2
+import pydantic
+
+
+class WebhookSubscriptionResourceWithSecret(UniversalBaseModel):
+ id: str
+ event_types: typing.List[str]
+ object_type: WebhookObjectType
+ secret: str
+ status: WebhookSubscriptionStatus
+ url: str
+
+ if IS_PYDANTIC_V2:
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
+ else:
+
+ class Config:
+ frozen = True
+ smart_union = True
+ extra = pydantic.Extra.allow
diff --git a/src/monite/types/webhook_subscription_status.py b/src/monite/types/webhook_subscription_status.py
new file mode 100644
index 0000000..4748063
--- /dev/null
+++ b/src/monite/types/webhook_subscription_status.py
@@ -0,0 +1,5 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+WebhookSubscriptionStatus = typing.Union[typing.Literal["enabled", "disabled"], typing.Any]
diff --git a/src/monite/vat_rates/__init__.py b/src/monite/vat_rates/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/vat_rates/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/vat_rates/client.py b/src/monite/vat_rates/client.py
new file mode 100644
index 0000000..df8e38a
--- /dev/null
+++ b/src/monite/vat_rates/client.py
@@ -0,0 +1,293 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.client_wrapper import SyncClientWrapper
+import typing
+from ..types.product_service_type_enum import ProductServiceTypeEnum
+from ..core.request_options import RequestOptions
+from ..types.vat_rate_list_response import VatRateListResponse
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.bad_request_error import BadRequestError
+from ..types.error_schema_response import ErrorSchemaResponse
+from ..errors.unauthorized_error import UnauthorizedError
+from ..errors.forbidden_error import ForbiddenError
+from ..errors.not_found_error import NotFoundError
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..core.client_wrapper import AsyncClientWrapper
+
+
+class VatRatesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ counterpart_address_id: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ counterpart_vat_id_id: typing.Optional[str] = None,
+ entity_vat_id_id: typing.Optional[str] = None,
+ product_type: typing.Optional[ProductServiceTypeEnum] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VatRateListResponse:
+ """
+ Parameters
+ ----------
+ counterpart_address_id : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ counterpart_vat_id_id : typing.Optional[str]
+
+ entity_vat_id_id : typing.Optional[str]
+
+ product_type : typing.Optional[ProductServiceTypeEnum]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VatRateListResponse
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.vat_rates.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "vat_rates",
+ method="GET",
+ params={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_id": counterpart_id,
+ "counterpart_vat_id_id": counterpart_vat_id_id,
+ "entity_vat_id_id": entity_vat_id_id,
+ "product_type": product_type,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VatRateListResponse,
+ parse_obj_as(
+ type_=VatRateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncVatRatesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ counterpart_address_id: typing.Optional[str] = None,
+ counterpart_id: typing.Optional[str] = None,
+ counterpart_vat_id_id: typing.Optional[str] = None,
+ entity_vat_id_id: typing.Optional[str] = None,
+ product_type: typing.Optional[ProductServiceTypeEnum] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> VatRateListResponse:
+ """
+ Parameters
+ ----------
+ counterpart_address_id : typing.Optional[str]
+
+ counterpart_id : typing.Optional[str]
+
+ counterpart_vat_id_id : typing.Optional[str]
+
+ entity_vat_id_id : typing.Optional[str]
+
+ product_type : typing.Optional[ProductServiceTypeEnum]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ VatRateListResponse
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.vat_rates.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "vat_rates",
+ method="GET",
+ params={
+ "counterpart_address_id": counterpart_address_id,
+ "counterpart_id": counterpart_id,
+ "counterpart_vat_id_id": counterpart_vat_id_id,
+ "entity_vat_id_id": entity_vat_id_id,
+ "product_type": product_type,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ VatRateListResponse,
+ parse_obj_as(
+ type_=VatRateListResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 400:
+ raise BadRequestError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 401:
+ raise UnauthorizedError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 403:
+ raise ForbiddenError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 404:
+ raise NotFoundError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/version.py b/src/monite/version.py
new file mode 100644
index 0000000..3630726
--- /dev/null
+++ b/src/monite/version.py
@@ -0,0 +1,3 @@
+from importlib import metadata
+
+__version__ = metadata.version("monite")
diff --git a/src/monite/webhook_deliveries/__init__.py b/src/monite/webhook_deliveries/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/webhook_deliveries/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/webhook_deliveries/client.py b/src/monite/webhook_deliveries/client.py
new file mode 100644
index 0000000..163e71c
--- /dev/null
+++ b/src/monite/webhook_deliveries/client.py
@@ -0,0 +1,269 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from ..core.client_wrapper import SyncClientWrapper
+import typing
+from ..types.order_enum import OrderEnum
+from ..types.webhook_delivery_cursor_fields import WebhookDeliveryCursorFields
+from ..types.webhook_object_type import WebhookObjectType
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.webhook_delivery_pagination_resource import WebhookDeliveryPaginationResource
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..core.client_wrapper import AsyncClientWrapper
+
+
+class WebhookDeliveriesClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[WebhookDeliveryCursorFields] = None,
+ event_id: typing.Optional[str] = None,
+ object_type: typing.Optional[WebhookObjectType] = None,
+ event_action: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookDeliveryPaginationResource:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[WebhookDeliveryCursorFields]
+ Allowed sort fields
+
+ event_id : typing.Optional[str]
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ event_action : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookDeliveryPaginationResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_deliveries.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "webhook_deliveries",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "event_id": event_id,
+ "object_type": object_type,
+ "event_action": event_action,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookDeliveryPaginationResource,
+ parse_obj_as(
+ type_=WebhookDeliveryPaginationResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncWebhookDeliveriesClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[WebhookDeliveryCursorFields] = None,
+ event_id: typing.Optional[str] = None,
+ object_type: typing.Optional[WebhookObjectType] = None,
+ event_action: typing.Optional[str] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookDeliveryPaginationResource:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[WebhookDeliveryCursorFields]
+ Allowed sort fields
+
+ event_id : typing.Optional[str]
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ event_action : typing.Optional[str]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookDeliveryPaginationResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_deliveries.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "webhook_deliveries",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "event_id": event_id,
+ "object_type": object_type,
+ "event_action": event_action,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookDeliveryPaginationResource,
+ parse_obj_as(
+ type_=WebhookDeliveryPaginationResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/src/monite/webhook_subscriptions/__init__.py b/src/monite/webhook_subscriptions/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/src/monite/webhook_subscriptions/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/src/monite/webhook_subscriptions/client.py b/src/monite/webhook_subscriptions/client.py
new file mode 100644
index 0000000..f0e841f
--- /dev/null
+++ b/src/monite/webhook_subscriptions/client.py
@@ -0,0 +1,1321 @@
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from ..core.client_wrapper import SyncClientWrapper
+from ..types.order_enum import OrderEnum
+from ..types.webhook_subscription_cursor_fields import WebhookSubscriptionCursorFields
+from ..types.webhook_object_type import WebhookObjectType
+import datetime as dt
+from ..core.request_options import RequestOptions
+from ..types.webhook_subscription_pagination_resource import WebhookSubscriptionPaginationResource
+from ..core.datetime_utils import serialize_datetime
+from ..core.pydantic_utilities import parse_obj_as
+from ..errors.unprocessable_entity_error import UnprocessableEntityError
+from ..types.http_validation_error import HttpValidationError
+from ..errors.internal_server_error import InternalServerError
+from ..types.error_schema_response import ErrorSchemaResponse
+from json.decoder import JSONDecodeError
+from ..core.api_error import ApiError
+from ..types.webhook_subscription_resource_with_secret import WebhookSubscriptionResourceWithSecret
+from ..types.webhook_subscription_resource import WebhookSubscriptionResource
+from ..core.jsonable_encoder import jsonable_encoder
+from ..core.client_wrapper import AsyncClientWrapper
+
+# this is used as the default value for optional parameters
+OMIT = typing.cast(typing.Any, ...)
+
+
+class WebhookSubscriptionsClient:
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[WebhookSubscriptionCursorFields] = None,
+ object_type: typing.Optional[WebhookObjectType] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookSubscriptionPaginationResource:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[WebhookSubscriptionCursorFields]
+ Allowed sort fields
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionPaginationResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.get()
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "webhook_subscriptions",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_type": object_type,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionPaginationResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionPaginationResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def create(
+ self,
+ *,
+ object_type: WebhookObjectType,
+ url: str,
+ event_types: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookSubscriptionResourceWithSecret:
+ """
+ Parameters
+ ----------
+ object_type : WebhookObjectType
+
+ url : str
+
+ event_types : typing.Optional[typing.Sequence[str]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResourceWithSecret
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.create(
+ object_type="account",
+ url="url",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ "webhook_subscriptions",
+ method="POST",
+ json={
+ "event_types": event_types,
+ "object_type": object_type,
+ "url": url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResourceWithSecret,
+ parse_obj_as(
+ type_=WebhookSubscriptionResourceWithSecret, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def get_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.get_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def delete_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.delete_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def update_by_id(
+ self,
+ webhook_subscription_id: str,
+ *,
+ event_types: typing.Optional[typing.Sequence[str]] = OMIT,
+ object_type: typing.Optional[WebhookObjectType] = OMIT,
+ url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ event_types : typing.Optional[typing.Sequence[str]]
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.update_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}",
+ method="PATCH",
+ json={
+ "event_types": event_types,
+ "object_type": object_type,
+ "url": url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def disable_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.disable_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}/disable",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def enable_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.enable_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}/enable",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ def regenerate_secret_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResourceWithSecret:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResourceWithSecret
+ Successful Response
+
+ Examples
+ --------
+ from monite import Monite
+
+ client = Monite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+ client.webhook_subscriptions.regenerate_secret_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+ """
+ _response = self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}/regenerate_secret",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResourceWithSecret,
+ parse_obj_as(
+ type_=WebhookSubscriptionResourceWithSecret, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+
+class AsyncWebhookSubscriptionsClient:
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
+ self._client_wrapper = client_wrapper
+
+ async def get(
+ self,
+ *,
+ order: typing.Optional[OrderEnum] = None,
+ limit: typing.Optional[int] = None,
+ pagination_token: typing.Optional[str] = None,
+ sort: typing.Optional[WebhookSubscriptionCursorFields] = None,
+ object_type: typing.Optional[WebhookObjectType] = None,
+ created_at_gt: typing.Optional[dt.datetime] = None,
+ created_at_lt: typing.Optional[dt.datetime] = None,
+ created_at_gte: typing.Optional[dt.datetime] = None,
+ created_at_lte: typing.Optional[dt.datetime] = None,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookSubscriptionPaginationResource:
+ """
+ Parameters
+ ----------
+ order : typing.Optional[OrderEnum]
+ Order by
+
+ limit : typing.Optional[int]
+ Max is 100
+
+ pagination_token : typing.Optional[str]
+ A token, obtained from previous page. Prior over other filters
+
+ sort : typing.Optional[WebhookSubscriptionCursorFields]
+ Allowed sort fields
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ created_at_gt : typing.Optional[dt.datetime]
+
+ created_at_lt : typing.Optional[dt.datetime]
+
+ created_at_gte : typing.Optional[dt.datetime]
+
+ created_at_lte : typing.Optional[dt.datetime]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionPaginationResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.get()
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "webhook_subscriptions",
+ method="GET",
+ params={
+ "order": order,
+ "limit": limit,
+ "pagination_token": pagination_token,
+ "sort": sort,
+ "object_type": object_type,
+ "created_at__gt": serialize_datetime(created_at_gt) if created_at_gt is not None else None,
+ "created_at__lt": serialize_datetime(created_at_lt) if created_at_lt is not None else None,
+ "created_at__gte": serialize_datetime(created_at_gte) if created_at_gte is not None else None,
+ "created_at__lte": serialize_datetime(created_at_lte) if created_at_lte is not None else None,
+ },
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionPaginationResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionPaginationResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def create(
+ self,
+ *,
+ object_type: WebhookObjectType,
+ url: str,
+ event_types: typing.Optional[typing.Sequence[str]] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookSubscriptionResourceWithSecret:
+ """
+ Parameters
+ ----------
+ object_type : WebhookObjectType
+
+ url : str
+
+ event_types : typing.Optional[typing.Sequence[str]]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResourceWithSecret
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.create(
+ object_type="account",
+ url="url",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ "webhook_subscriptions",
+ method="POST",
+ json={
+ "event_types": event_types,
+ "object_type": object_type,
+ "url": url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResourceWithSecret,
+ parse_obj_as(
+ type_=WebhookSubscriptionResourceWithSecret, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def get_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.get_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}",
+ method="GET",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def delete_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> None:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ None
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.delete_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}",
+ method="DELETE",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def update_by_id(
+ self,
+ webhook_subscription_id: str,
+ *,
+ event_types: typing.Optional[typing.Sequence[str]] = OMIT,
+ object_type: typing.Optional[WebhookObjectType] = OMIT,
+ url: typing.Optional[str] = OMIT,
+ request_options: typing.Optional[RequestOptions] = None,
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ event_types : typing.Optional[typing.Sequence[str]]
+
+ object_type : typing.Optional[WebhookObjectType]
+
+ url : typing.Optional[str]
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.update_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}",
+ method="PATCH",
+ json={
+ "event_types": event_types,
+ "object_type": object_type,
+ "url": url,
+ },
+ request_options=request_options,
+ omit=OMIT,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def disable_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.disable_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}/disable",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def enable_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResource:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResource
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.enable_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}/enable",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResource,
+ parse_obj_as(
+ type_=WebhookSubscriptionResource, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
+
+ async def regenerate_secret_by_id(
+ self, webhook_subscription_id: str, *, request_options: typing.Optional[RequestOptions] = None
+ ) -> WebhookSubscriptionResourceWithSecret:
+ """
+ Parameters
+ ----------
+ webhook_subscription_id : str
+
+ request_options : typing.Optional[RequestOptions]
+ Request-specific configuration.
+
+ Returns
+ -------
+ WebhookSubscriptionResourceWithSecret
+ Successful Response
+
+ Examples
+ --------
+ import asyncio
+
+ from monite import AsyncMonite
+
+ client = AsyncMonite(
+ monite_version="YOUR_MONITE_VERSION",
+ monite_entity_id="YOUR_MONITE_ENTITY_ID",
+ token="YOUR_TOKEN",
+ )
+
+
+ async def main() -> None:
+ await client.webhook_subscriptions.regenerate_secret_by_id(
+ webhook_subscription_id="webhook_subscription_id",
+ )
+
+
+ asyncio.run(main())
+ """
+ _response = await self._client_wrapper.httpx_client.request(
+ f"webhook_subscriptions/{jsonable_encoder(webhook_subscription_id)}/regenerate_secret",
+ method="POST",
+ request_options=request_options,
+ )
+ try:
+ if 200 <= _response.status_code < 300:
+ return typing.cast(
+ WebhookSubscriptionResourceWithSecret,
+ parse_obj_as(
+ type_=WebhookSubscriptionResourceWithSecret, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ if _response.status_code == 422:
+ raise UnprocessableEntityError(
+ typing.cast(
+ HttpValidationError,
+ parse_obj_as(
+ type_=HttpValidationError, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ if _response.status_code == 500:
+ raise InternalServerError(
+ typing.cast(
+ ErrorSchemaResponse,
+ parse_obj_as(
+ type_=ErrorSchemaResponse, # type: ignore
+ object_=_response.json(),
+ ),
+ )
+ )
+ _response_json = _response.json()
+ except JSONDecodeError:
+ raise ApiError(status_code=_response.status_code, body=_response.text)
+ raise ApiError(status_code=_response.status_code, body=_response_json)
diff --git a/tests/custom/test_client.py b/tests/custom/test_client.py
new file mode 100644
index 0000000..73f811f
--- /dev/null
+++ b/tests/custom/test_client.py
@@ -0,0 +1,7 @@
+import pytest
+
+
+# Get started with writing tests with pytest at https://docs.pytest.org
+@pytest.mark.skip(reason="Unimplemented")
+def test_client() -> None:
+ assert True == True
diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py
new file mode 100644
index 0000000..f3ea265
--- /dev/null
+++ b/tests/utils/__init__.py
@@ -0,0 +1,2 @@
+# This file was auto-generated by Fern from our API Definition.
+
diff --git a/tests/utils/assets/models/__init__.py b/tests/utils/assets/models/__init__.py
new file mode 100644
index 0000000..3a1c852
--- /dev/null
+++ b/tests/utils/assets/models/__init__.py
@@ -0,0 +1,21 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+from .circle import CircleParams
+from .object_with_defaults import ObjectWithDefaultsParams
+from .object_with_optional_field import ObjectWithOptionalFieldParams
+from .shape import ShapeParams, Shape_CircleParams, Shape_SquareParams
+from .square import SquareParams
+from .undiscriminated_shape import UndiscriminatedShapeParams
+
+__all__ = [
+ "CircleParams",
+ "ObjectWithDefaultsParams",
+ "ObjectWithOptionalFieldParams",
+ "ShapeParams",
+ "Shape_CircleParams",
+ "Shape_SquareParams",
+ "SquareParams",
+ "UndiscriminatedShapeParams",
+]
diff --git a/tests/utils/assets/models/circle.py b/tests/utils/assets/models/circle.py
new file mode 100644
index 0000000..f92b8c5
--- /dev/null
+++ b/tests/utils/assets/models/circle.py
@@ -0,0 +1,11 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+import typing_extensions
+import typing_extensions
+from monite.core.serialization import FieldMetadata
+
+
+class CircleParams(typing_extensions.TypedDict):
+ radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")]
diff --git a/tests/utils/assets/models/color.py b/tests/utils/assets/models/color.py
new file mode 100644
index 0000000..2aa2c4c
--- /dev/null
+++ b/tests/utils/assets/models/color.py
@@ -0,0 +1,7 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+
+Color = typing.Union[typing.Literal["red", "blue"], typing.Any]
diff --git a/tests/utils/assets/models/object_with_defaults.py b/tests/utils/assets/models/object_with_defaults.py
new file mode 100644
index 0000000..ef14f7b
--- /dev/null
+++ b/tests/utils/assets/models/object_with_defaults.py
@@ -0,0 +1,16 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+import typing_extensions
+import typing_extensions
+
+
+class ObjectWithDefaultsParams(typing_extensions.TypedDict):
+ """
+ Defines properties with default values and validation rules.
+ """
+
+ decimal: typing_extensions.NotRequired[float]
+ string: typing_extensions.NotRequired[str]
+ required_string: str
diff --git a/tests/utils/assets/models/object_with_optional_field.py b/tests/utils/assets/models/object_with_optional_field.py
new file mode 100644
index 0000000..bd1aefa
--- /dev/null
+++ b/tests/utils/assets/models/object_with_optional_field.py
@@ -0,0 +1,34 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+import typing_extensions
+import typing
+import typing_extensions
+from monite.core.serialization import FieldMetadata
+import datetime as dt
+import uuid
+from .color import Color
+from .shape import ShapeParams
+from .undiscriminated_shape import UndiscriminatedShapeParams
+
+
+class ObjectWithOptionalFieldParams(typing_extensions.TypedDict):
+ literal: typing.Literal["lit_one"]
+ string: typing_extensions.NotRequired[str]
+ integer: typing_extensions.NotRequired[int]
+ long_: typing_extensions.NotRequired[typing_extensions.Annotated[int, FieldMetadata(alias="long")]]
+ double: typing_extensions.NotRequired[float]
+ bool_: typing_extensions.NotRequired[typing_extensions.Annotated[bool, FieldMetadata(alias="bool")]]
+ datetime: typing_extensions.NotRequired[dt.datetime]
+ date: typing_extensions.NotRequired[dt.date]
+ uuid_: typing_extensions.NotRequired[typing_extensions.Annotated[uuid.UUID, FieldMetadata(alias="uuid")]]
+ base_64: typing_extensions.NotRequired[typing_extensions.Annotated[str, FieldMetadata(alias="base64")]]
+ list_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Sequence[str], FieldMetadata(alias="list")]]
+ set_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Set[str], FieldMetadata(alias="set")]]
+ map_: typing_extensions.NotRequired[typing_extensions.Annotated[typing.Dict[int, str], FieldMetadata(alias="map")]]
+ enum: typing_extensions.NotRequired[Color]
+ union: typing_extensions.NotRequired[ShapeParams]
+ second_union: typing_extensions.NotRequired[ShapeParams]
+ undiscriminated_union: typing_extensions.NotRequired[UndiscriminatedShapeParams]
+ any: typing.Optional[typing.Any]
diff --git a/tests/utils/assets/models/shape.py b/tests/utils/assets/models/shape.py
new file mode 100644
index 0000000..c9d037e
--- /dev/null
+++ b/tests/utils/assets/models/shape.py
@@ -0,0 +1,26 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+from __future__ import annotations
+import typing_extensions
+import typing_extensions
+import typing
+from monite.core.serialization import FieldMetadata
+
+
+class Base(typing_extensions.TypedDict):
+ id: str
+
+
+class Shape_CircleParams(Base):
+ shape_type: typing_extensions.Annotated[typing.Literal["circle"], FieldMetadata(alias="shapeType")]
+ radius_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="radiusMeasurement")]
+
+
+class Shape_SquareParams(Base):
+ shape_type: typing_extensions.Annotated[typing.Literal["square"], FieldMetadata(alias="shapeType")]
+ length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")]
+
+
+ShapeParams = typing.Union[Shape_CircleParams, Shape_SquareParams]
diff --git a/tests/utils/assets/models/square.py b/tests/utils/assets/models/square.py
new file mode 100644
index 0000000..e8300cf
--- /dev/null
+++ b/tests/utils/assets/models/square.py
@@ -0,0 +1,11 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+import typing_extensions
+import typing_extensions
+from monite.core.serialization import FieldMetadata
+
+
+class SquareParams(typing_extensions.TypedDict):
+ length_measurement: typing_extensions.Annotated[float, FieldMetadata(alias="lengthMeasurement")]
diff --git a/tests/utils/assets/models/undiscriminated_shape.py b/tests/utils/assets/models/undiscriminated_shape.py
new file mode 100644
index 0000000..68876a2
--- /dev/null
+++ b/tests/utils/assets/models/undiscriminated_shape.py
@@ -0,0 +1,9 @@
+# This file was auto-generated by Fern from our API Definition.
+
+# This file was auto-generated by Fern from our API Definition.
+
+import typing
+from .circle import CircleParams
+from .square import SquareParams
+
+UndiscriminatedShapeParams = typing.Union[CircleParams, SquareParams]
diff --git a/tests/utils/test_http_client.py b/tests/utils/test_http_client.py
new file mode 100644
index 0000000..ce53223
--- /dev/null
+++ b/tests/utils/test_http_client.py
@@ -0,0 +1,61 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from monite.core.http_client import get_request_body
+from monite.core.request_options import RequestOptions
+
+
+def get_request_options() -> RequestOptions:
+ return {"additional_body_parameters": {"see you": "later"}}
+
+
+def test_get_json_request_body() -> None:
+ json_body, data_body = get_request_body(json={"hello": "world"}, data=None, request_options=None, omit=None)
+ assert json_body == {"hello": "world"}
+ assert data_body is None
+
+ json_body_extras, data_body_extras = get_request_body(
+ json={"goodbye": "world"}, data=None, request_options=get_request_options(), omit=None
+ )
+
+ assert json_body_extras == {"goodbye": "world", "see you": "later"}
+ assert data_body_extras is None
+
+
+def test_get_files_request_body() -> None:
+ json_body, data_body = get_request_body(json=None, data={"hello": "world"}, request_options=None, omit=None)
+ assert data_body == {"hello": "world"}
+ assert json_body is None
+
+ json_body_extras, data_body_extras = get_request_body(
+ json=None, data={"goodbye": "world"}, request_options=get_request_options(), omit=None
+ )
+
+ assert data_body_extras == {"goodbye": "world", "see you": "later"}
+ assert json_body_extras is None
+
+
+def test_get_none_request_body() -> None:
+ json_body, data_body = get_request_body(json=None, data=None, request_options=None, omit=None)
+ assert data_body is None
+ assert json_body is None
+
+ json_body_extras, data_body_extras = get_request_body(
+ json=None, data=None, request_options=get_request_options(), omit=None
+ )
+
+ assert json_body_extras == {"see you": "later"}
+ assert data_body_extras is None
+
+
+def test_get_empty_json_request_body() -> None:
+ unrelated_request_options: RequestOptions = {"max_retries": 3}
+ json_body, data_body = get_request_body(json=None, data=None, request_options=unrelated_request_options, omit=None)
+ assert json_body is None
+ assert data_body is None
+
+ json_body_extras, data_body_extras = get_request_body(
+ json={}, data=None, request_options=unrelated_request_options, omit=None
+ )
+
+ assert json_body_extras is None
+ assert data_body_extras is None
diff --git a/tests/utils/test_query_encoding.py b/tests/utils/test_query_encoding.py
new file mode 100644
index 0000000..e0235d8
--- /dev/null
+++ b/tests/utils/test_query_encoding.py
@@ -0,0 +1,37 @@
+# This file was auto-generated by Fern from our API Definition.
+
+
+from monite.core.query_encoder import encode_query
+
+
+def test_query_encoding_deep_objects() -> None:
+ assert encode_query({"hello world": "hello world"}) == [("hello world", "hello world")]
+ assert encode_query({"hello_world": {"hello": "world"}}) == [("hello_world[hello]", "world")]
+ assert encode_query({"hello_world": {"hello": {"world": "today"}, "test": "this"}, "hi": "there"}) == [
+ ("hello_world[hello][world]", "today"),
+ ("hello_world[test]", "this"),
+ ("hi", "there"),
+ ]
+
+
+def test_query_encoding_deep_object_arrays() -> None:
+ assert encode_query({"objects": [{"key": "hello", "value": "world"}, {"key": "foo", "value": "bar"}]}) == [
+ ("objects[key]", "hello"),
+ ("objects[value]", "world"),
+ ("objects[key]", "foo"),
+ ("objects[value]", "bar"),
+ ]
+ assert encode_query(
+ {"users": [{"name": "string", "tags": ["string"]}, {"name": "string2", "tags": ["string2", "string3"]}]}
+ ) == [
+ ("users[name]", "string"),
+ ("users[tags]", "string"),
+ ("users[name]", "string2"),
+ ("users[tags]", "string2"),
+ ("users[tags]", "string3"),
+ ]
+
+
+def test_encode_query_with_none() -> None:
+ encoded = encode_query(None)
+ assert encoded == None
diff --git a/tests/utils/test_serialization.py b/tests/utils/test_serialization.py
new file mode 100644
index 0000000..35fd032
--- /dev/null
+++ b/tests/utils/test_serialization.py
@@ -0,0 +1,72 @@
+# This file was auto-generated by Fern from our API Definition.
+
+from typing import List, Any
+
+from monite.core.serialization import convert_and_respect_annotation_metadata
+from .assets.models import ShapeParams, ObjectWithOptionalFieldParams
+
+
+UNION_TEST: ShapeParams = {"radius_measurement": 1.0, "shape_type": "circle", "id": "1"}
+UNION_TEST_CONVERTED = {"shapeType": "circle", "radiusMeasurement": 1.0, "id": "1"}
+
+
+def test_convert_and_respect_annotation_metadata() -> None:
+ data: ObjectWithOptionalFieldParams = {
+ "string": "string",
+ "long_": 12345,
+ "bool_": True,
+ "literal": "lit_one",
+ "any": "any",
+ }
+ converted = convert_and_respect_annotation_metadata(
+ object_=data, annotation=ObjectWithOptionalFieldParams, direction="write"
+ )
+ assert converted == {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"}
+
+
+def test_convert_and_respect_annotation_metadata_in_list() -> None:
+ data: List[ObjectWithOptionalFieldParams] = [
+ {"string": "string", "long_": 12345, "bool_": True, "literal": "lit_one", "any": "any"},
+ {"string": "another string", "long_": 67890, "list_": [], "literal": "lit_one", "any": "any"},
+ ]
+ converted = convert_and_respect_annotation_metadata(
+ object_=data, annotation=List[ObjectWithOptionalFieldParams], direction="write"
+ )
+
+ assert converted == [
+ {"string": "string", "long": 12345, "bool": True, "literal": "lit_one", "any": "any"},
+ {"string": "another string", "long": 67890, "list": [], "literal": "lit_one", "any": "any"},
+ ]
+
+
+def test_convert_and_respect_annotation_metadata_in_nested_object() -> None:
+ data: ObjectWithOptionalFieldParams = {
+ "string": "string",
+ "long_": 12345,
+ "union": UNION_TEST,
+ "literal": "lit_one",
+ "any": "any",
+ }
+ converted = convert_and_respect_annotation_metadata(
+ object_=data, annotation=ObjectWithOptionalFieldParams, direction="write"
+ )
+
+ assert converted == {
+ "string": "string",
+ "long": 12345,
+ "union": UNION_TEST_CONVERTED,
+ "literal": "lit_one",
+ "any": "any",
+ }
+
+
+def test_convert_and_respect_annotation_metadata_in_union() -> None:
+ converted = convert_and_respect_annotation_metadata(object_=UNION_TEST, annotation=ShapeParams, direction="write")
+
+ assert converted == UNION_TEST_CONVERTED
+
+
+def test_convert_and_respect_annotation_metadata_with_empty_object() -> None:
+ data: Any = {}
+ converted = convert_and_respect_annotation_metadata(object_=data, annotation=ShapeParams, direction="write")
+ assert converted == data