diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 9808bab..b4bf268 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 @@ -25,13 +25,11 @@ jobs: run: | python -m pip install --upgrade pip pip install poetry - poetry install - - name: Lint with flake8 + poetry install --no-root + - name: Lint with ruff run: | - # stop the build if there are Python syntax errors or undefined names - poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + poetry run ruff check --select I pyevr --exclude pyevr/openapi_client + poetry run ruff check pyevr --exclude pyevr/openapi_client - name: Test with pytest run: | poetry run pytest diff --git a/.gitignore b/.gitignore index 90973cf..d3bd1f1 100644 --- a/.gitignore +++ b/.gitignore @@ -108,4 +108,5 @@ ENV/ # Files for patching pyevr/openapi/openapi-generator-compatible-patched.json pyevr/openapi/openapi-generator-compatible.json +pyevr/openapi/openapi-generator-compatible.json.rej pyevr/openapi/openapi-generator-compatible.json.orig diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index 9f616c5..0000000 --- a/.readthedocs.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -version: 2 -sphinx: - configuration: docs/conf.py -formats: all -python: - version: 3.8 - install: - - requirements: requirements_dev.txt diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eb5e86d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Config file for automatic testing at travis-ci.org - -language: python -python: - - 3.8 - - 3.7 - - 3.6 - -# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors -install: - - pip install -r requirements_dev.txt - - pip install -U tox-travis - - if [ $TRAVIS_PYTHON_VERSION == "3.8" ]; then pip install -U coveralls; fi - -# Command to run tests, e.g. python setup.py test -script: - - make lint - - make test-all - - if [ $TRAVIS_PYTHON_VERSION == "3.8" ]; then coverage run --source pyevr -m pytest; fi - - if [ $TRAVIS_PYTHON_VERSION == "3.8" ]; then coveralls; fi - -# Assuming you have installed the travis-ci CLI tool, after you -# create the Github repo and add it to Travis, run the -# following command to finish PyPI deployment setup: -# $ travis encrypt --add deploy.password -deploy: - provider: pypi - distributions: sdist bdist_wheel - user: thorgate - password: - secure: AxfqY940GesaqOB8UsR8rMxIOajZ9HTCD5c/ijAynluUN9vVlmokTil2EHy+sl+48gyh3PaUI4Bj+kPxKg+NehzF/zcDQvabxYrN3dvt1UO722/42N86FvBqvBfzNiXQCPBE1+53VHLSDil3Li7pPYa+AfB7WR0fEAJPoeqOTV47ca7czUJn7cXgF3VRmIHpkbErk8veeXr0Ccn7W0BvfIGhGSKnxFZa3AHHJhsf3j0OBMoxsm+acpuXP+F9OPJYEgCk0OtBqX/C94+QGg1QdPlv8XjThQi6s0BbgxNQcQMwoWDN+CW2tf4zBnoZqPJ3jowlr/MLt6PV+4Q+Fp2KpvNoQz0I9zUbfLGYBE3QO2rjgRwKL0cr0cWcpnw23yoQmPESplx9EHNfdEM8YFYCoB4/iIuuoP27IRJEAyASZp9QLIfjPuBibhbtvmNRpJqCK7dPbDW3rp4ZMIncFiJUV4y4qnjAYIyWBMsh2+uXfGslHABI8LFiZauegfJVeA6ABMwnofwxxKTp9Y1VnNTRPouNg/ouo5k0sSIA3S3uDbHOTXJ6dzByMsK1RFVPu8XR65knCbita2Ok1qzjkNLufRxKF38YkPSQ4fIIO3YLelsTPwBXkniTGbvUSILD9LnF/+4il+hr4bx+9pbnYNaUXxxqi4G0lXrOae5P+XsSISc= - on: - tags: true - repo: thorgate/pyevr - python: 3.8 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8e0664e..89322f8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,39 @@ Changelog ========= +1.0.1.dev3 + +**Generic** + +* Update EVR schema to 1.4.0.1 + +1.0.1.dev2 +---------- + +**Generic** + +* Update EVR schema to 1.35 (from EVR test server, revision 2025-09-09) + +1.0.0 +---------- + +**BREAKING** + +* Drop support for python 3.8 + +**Generic** + +* Update to use newer openapi generator (pydantic 2) +* Improve `sanitize_for_serialization` for caching the data + +**Updates** + +Use EVR schema 1.30 + +* Support for EUDR fields +* Other misc changes + + 0.7.0 ---------- diff --git a/Makefile b/Makefile index cb45832..b582b76 100644 --- a/Makefile +++ b/Makefile @@ -1,53 +1,56 @@ -.PHONY: clean clean-test clean-pyc clean-build docs help openapi .DEFAULT_GOAL := help -OPENAPI_GENERATOR_VERSION ?= v7.0.1 +OPENAPI_GENERATOR_VERSION ?= v7.12.0 +.PHONY: lint: - poetry run flake8 --select=E9,F63,F7,F82 pyevr + poetry run ruff check --select I pyevr --exclude pyevr/openapi_client + poetry run ruff check pyevr --exclude pyevr/openapi_client +.PHONY: fmt: - poetry run black pyevr - poetry run black test + poetry run ruff check --select I pyevr --fix --exclude pyevr/openapi_client + poetry run ruff check pyevr --fix --exclude pyevr/openapi_client + poetry run ruff format pyevr --exclude pyevr/openapi_client -test: ## run tests quickly with the default Python +.PHONY: +test: # run tests quickly with the default Python poetry run pytest -test-all: ## run tests on every Python version with tox +.PHONY: +test-all: # run tests on every Python version with tox tox -coverage: ## check code coverage quickly with the default Python - coverage run --source pyevr -m pytest - coverage report -m - coverage html +.PHONY: +coverage: # check code coverage quickly with the default Python + poetry run coverage run --source pyevr -m pytest + poetry run coverage report -m + poetry run coverage html -release: dist ## package and upload a release - # todo - twine upload dist/* - -dist: clean ## builds source and wheel package - # todo - python setup.py sdist - python setup.py bdist_wheel - ls -l dist - -install: clean ## install the package to the active Python's site-packages - $ todo - python setup.py install - -openapi-patch: ## create patch for openapi schema +.PHONY: +openapi-fetch: curl https://evr.veoseleht.ee/api/openapi-generator-compatible.json -o pyevr/openapi/openapi-generator-compatible.json + +.PHONY: +openapi-patch: openapi-fetch diff -Naur ./pyevr/openapi/openapi-generator-compatible.json ./pyevr/openapi/openapi-generator-compatible-patched.json > ./pyevr/openapi/patches/schema-fixes.patch || echo "Patch created" -openapi: ## generate new API client based on the OpenAPI specification +.PHONY: +openapi-apply-patch: openapi-fetch + patch -p0 < pyevr/openapi/patches/schema-fixes.patch + +.PHONY: +openapi-build: rm -rf .openapi rm -rf pyevr/openapi_client rm -rf pyevr/docs - curl https://evr.veoseleht.ee/api/openapi-generator-compatible.json -o pyevr/openapi/openapi-generator-compatible.json - patch -p0 < pyevr/openapi/patches/schema-fixes.patch docker run --rm --ulimit nofile=122880:122880 -v ${PWD}/pyevr/openapi/update_schema.sh:/helpers/update_schema.sh -v ${PWD}/pyevr/openapi/openapi-generator-compatible.json:/openapi-generator-compatible.json -v ${PWD}/.openapi/:/openapi openapitools/openapi-generator-cli:$(OPENAPI_GENERATOR_VERSION) /bin/bash /helpers/update_schema.sh /openapi-generator-compatible.json sudo chown -R ${USER} .openapi cp -r .openapi/openapi_client pyevr/openapi_client cp -r .openapi/docs pyevr/docs rm -rf .openapi - poetry run black pyevr + poetry run ruff check --select I pyevr/openapi_client --fix + poetry run ruff format pyevr/openapi_client + +.PHONY: +openapi: openapi-apply-patch openapi-build diff --git a/poetry.lock b/poetry.lock index 5735109..518e872 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,68 +1,30 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand. [[package]] -name = "aenum" -version = "3.1.15" -description = "Advanced Enumerations (compatible with Python's stdlib Enum), NamedTuples, and NamedConstants" -optional = false -python-versions = "*" -files = [ - {file = "aenum-3.1.15-py2-none-any.whl", hash = "sha256:27b1710b9d084de6e2e695dab78fe9f269de924b51ae2850170ee7e1ca6288a5"}, - {file = "aenum-3.1.15-py3-none-any.whl", hash = "sha256:e0dfaeea4c2bd362144b87377e2c61d91958c5ed0b4daf89cb6f45ae23af6288"}, - {file = "aenum-3.1.15.tar.gz", hash = "sha256:8cbd76cd18c4f870ff39b24284d3ea028fbe8731a58df3aa581e434c575b9559"}, -] - -[[package]] -name = "black" -version = "23.10.1" -description = "The uncompromising code formatter." +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "black-23.10.1-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:ec3f8e6234c4e46ff9e16d9ae96f4ef69fa328bb4ad08198c8cee45bb1f08c69"}, - {file = "black-23.10.1-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:1b917a2aa020ca600483a7b340c165970b26e9029067f019e3755b56e8dd5916"}, - {file = "black-23.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c74de4c77b849e6359c6f01987e94873c707098322b91490d24296f66d067dc"}, - {file = "black-23.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:7b4d10b0f016616a0d93d24a448100adf1699712fb7a4efd0e2c32bbb219b173"}, - {file = "black-23.10.1-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:b15b75fc53a2fbcac8a87d3e20f69874d161beef13954747e053bca7a1ce53a0"}, - {file = "black-23.10.1-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:e293e4c2f4a992b980032bbd62df07c1bcff82d6964d6c9496f2cd726e246ace"}, - {file = "black-23.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d56124b7a61d092cb52cce34182a5280e160e6aff3137172a68c2c2c4b76bcb"}, - {file = "black-23.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:3f157a8945a7b2d424da3335f7ace89c14a3b0625e6593d21139c2d8214d55ce"}, - {file = "black-23.10.1-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:cfcce6f0a384d0da692119f2d72d79ed07c7159879d0bb1bb32d2e443382bf3a"}, - {file = "black-23.10.1-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:33d40f5b06be80c1bbce17b173cda17994fbad096ce60eb22054da021bf933d1"}, - {file = "black-23.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:840015166dbdfbc47992871325799fd2dc0dcf9395e401ada6d88fe11498abad"}, - {file = "black-23.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:037e9b4664cafda5f025a1728c50a9e9aedb99a759c89f760bd83730e76ba884"}, - {file = "black-23.10.1-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:7cb5936e686e782fddb1c73f8aa6f459e1ad38a6a7b0e54b403f1f05a1507ee9"}, - {file = "black-23.10.1-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:7670242e90dc129c539e9ca17665e39a146a761e681805c54fbd86015c7c84f7"}, - {file = "black-23.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ed45ac9a613fb52dad3b61c8dea2ec9510bf3108d4db88422bacc7d1ba1243d"}, - {file = "black-23.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:6d23d7822140e3fef190734216cefb262521789367fbdc0b3f22af6744058982"}, - {file = "black-23.10.1-py3-none-any.whl", hash = "sha256:d431e6739f727bb2e0495df64a6c7a5310758e87505f5f8cde9ff6c0f2d7e4fe"}, - {file = "black-23.10.1.tar.gz", hash = "sha256:1f8ce316753428ff68749c65a5f7844631aa18c8679dfd3ca9dc1a289979c258"}, + {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] -click = ">=8.0.0" -mypy-extensions = ">=0.4.3" -packaging = ">=22.0" -pathspec = ">=0.9.0" -platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} - -[package.extras] -colorama = ["colorama (>=0.4.3)"] -d = ["aiohttp (>=3.7.4)"] -jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] -uvloop = ["uvloop (>=0.15.2)"] +typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} [[package]] name = "cachetools" -version = "5.3.2" +version = "5.5.2" description = "Extensible memoizing collections and decorators" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ - {file = "cachetools-5.3.2-py3-none-any.whl", hash = "sha256:861f35a13a451f94e301ce2bec7cac63e881232ccce7ed67fab9b5df4d3beaa1"}, - {file = "cachetools-5.3.2.tar.gz", hash = "sha256:086ee420196f7b2ab9ca2db2520aca326318b68fe5ba8bc4d49cca91add450f2"}, + {file = "cachetools-5.5.2-py3-none-any.whl", hash = "sha256:d26a22bcc62eb95c3beabd9f1ee5e820d3d2704fe2967cbe350e20c8ffcd3f0a"}, + {file = "cachetools-5.5.2.tar.gz", hash = "sha256:1a661caa9175d26759571b2e19580f9d6393969e5dfca11fdb1f947a23e640d4"}, ] [[package]] @@ -71,31 +33,19 @@ version = "5.2.0" description = "Universal encoding detector for Python 3" optional = false python-versions = ">=3.7" +groups = ["dev"] files = [ {file = "chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970"}, {file = "chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7"}, ] -[[package]] -name = "click" -version = "8.1.7" -description = "Composable command line interface toolkit" -optional = false -python-versions = ">=3.7" -files = [ - {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, - {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "platform_system == \"Windows\""} - [[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" +groups = ["dev"] files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -103,24 +53,27 @@ files = [ [[package]] name = "distlib" -version = "0.3.7" +version = "0.3.9" description = "Distribution utilities" optional = false python-versions = "*" +groups = ["dev"] files = [ - {file = "distlib-0.3.7-py2.py3-none-any.whl", hash = "sha256:2e24928bc811348f0feb63014e97aaae3037f2cf48712d51ae61df7fd6075057"}, - {file = "distlib-0.3.7.tar.gz", hash = "sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8"}, + {file = "distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87"}, + {file = "distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403"}, ] [[package]] name = "exceptiongroup" -version = "1.1.3" +version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ - {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, - {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, + {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, + {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, ] [package.extras] @@ -128,35 +81,20 @@ test = ["pytest (>=6)"] [[package]] name = "filelock" -version = "3.13.1" +version = "3.16.1" description = "A platform independent file lock." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "filelock-3.13.1-py3-none-any.whl", hash = "sha256:57dbda9b35157b05fb3e58ee91448612eb674172fab98ee235ccb0b5bee19a1c"}, - {file = "filelock-3.13.1.tar.gz", hash = "sha256:521f5f56c50f8426f5e03ad3b281b490a87ef15bc6c526f168290f0c7148d44e"}, + {file = "filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0"}, + {file = "filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435"}, ] [package.extras] -docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.24)"] -testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)"] -typing = ["typing-extensions (>=4.8)"] - -[[package]] -name = "flake8" -version = "5.0.4" -description = "the modular source code checker: pep8 pyflakes and co" -optional = false -python-versions = ">=3.6.1" -files = [ - {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, - {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, -] - -[package.dependencies] -mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.9.0,<2.10.0" -pyflakes = ">=2.5.0,<2.6.0" +docs = ["furo (>=2024.8.6)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4.1)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.6.1)", "diff-cover (>=9.2)", "pytest (>=8.3.3)", "pytest-asyncio (>=0.24)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.26.4)"] +typing = ["typing-extensions (>=4.12.2)"] [[package]] name = "iniconfig" @@ -164,187 +102,322 @@ version = "2.0.0" description = "brain-dead simple config-ini parsing" optional = false python-versions = ">=3.7" +groups = ["dev"] 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 = "mccabe" -version = "0.7.0" -description = "McCabe checker, plugin for flake8" +name = "json-stream" +version = "2.3.3" +description = "Streaming JSON encoder and decoder" optional = false -python-versions = ">=3.6" +python-versions = "<4,>=3.5" +groups = ["dev"] files = [ - {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, - {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, + {file = "json_stream-2.3.3-py3-none-any.whl", hash = "sha256:65f08c5031d7df145c6fe89e434b718c1574b2bb84b8a0eea974de90916a089d"}, + {file = "json_stream-2.3.3.tar.gz", hash = "sha256:894444c68c331174926763e224fb34b7ed3f90749d1c165afd0f5930207534c4"}, ] +[package.dependencies] +json-stream-rs-tokenizer = ">=0.4.17" + +[package.extras] +httpx = ["httpx"] +requests = ["requests"] + [[package]] -name = "mypy-extensions" -version = "1.0.0" -description = "Type system extensions for programs checked with the mypy type checker." +name = "json-stream-rs-tokenizer" +version = "0.4.27" +description = "A faster tokenizer for the json-stream Python library" optional = false -python-versions = ">=3.5" +python-versions = "<4,>=3.7" +groups = ["dev"] 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"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3d7ba1286cfd21e40d5e760d3243fed297ac96f399a7b0a023359493c88cc063"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6732b85154f8839c4d5bb72d1ac754d208cf68c4c561e11ea50215c54768732d"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aece97e3eec9b461d536b2a48730a7470300e959d9be15440d368cbd1622e5d4"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b810e58f4a60c82a135307ac4fafaeff217c5f415735e0621c01daac17928006"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19411b947aa971bea5dbc31e658fcd05e3105487baca846a8263766c05c9ef28"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:8ae6ec41d5950d6ae30b520d9cdb2fa25b3c74ad128c624c943fc6c8f4c3c679"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-win32.whl", hash = "sha256:c9ab6db6590d01b887295fef3649b7b10a63ffdc9e1a61465919396560aaa5c0"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp310-cp310-win_amd64.whl", hash = "sha256:5a93ea03d507ddae7f30f6ed848fc40f6a74287d3bedcd972feafb58246f9300"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:54c9299ffc49bf9ad28243a1de8054f84d3ecc596cf9dc546879d34b7a647040"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f228f9be80b3bcebd6f9315d444865207d3ee529bd6f5bbbdce214e45b4c345a"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e131332c33ae9c1e0080e82d4effad3f199957b7776a411d9d32ca154a25ad1f"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f1d2fcfd410ab11da02760418d4f666be7b1fa7b8fefdad5b89f6c7a6ad2534"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53971a6be4a3dc297c6b25f7da94d7d26724cdd39eced34242941c6d7b417f69"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:7a58affc3a30a1d6d0f47ec8e7bc9c6974282d8a805955dffc69b5f41706de14"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-win32.whl", hash = "sha256:8ccd75c480afa1f149b009c02dd0bd2561b92382d8dbfb1fb630d75baa517f9a"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp311-cp311-win_amd64.whl", hash = "sha256:c5146105d07886448e0994e74b9063d0476a486cd5cd64cf0de1edd16da2ecba"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:36d832c9e6cbde17ff6077a11244010a9abfc2829c3a1484f8deb60f7df49f2b"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:aed527ed830b40e41ed121432e0d938367af57aec5c78bd84f043da1dd3a93b4"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b7d8c983c9d61925960a3d5967ae5d88d556abb7e7bddb4e77dc910eee5323f1"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c115e4decb5c00266e7df98163bc27db2d1675f94fc4efc66bc1a30cf47ddbc3"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:68a39fca288c69c93cde1eca4f4ce406006dd7fb82f45f35ec03294a60df57ed"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:52738f5943ae46faf0aa9a6e9c255a862f851048e9381e03a77c9813d954506c"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-win32.whl", hash = "sha256:032443bcce5ff0d01d83118f12d73ae2719c87d6a3ae69d4e4e286c1b2eaf89a"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp312-cp312-win_amd64.whl", hash = "sha256:f6de65c96f9c89c3b1fd0017e1da7780b1a1f90e0cded56bfec6d27b797b216f"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp37-cp37m-macosx_10_12_x86_64.whl", hash = "sha256:2f44364ae4b5e436d3ce747fff87a23d727bf6e588e9362cb3baafb393eb8686"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1f5d0b3edab41c4c81d837f516af78ed2788529e20c543500178b9277715aaf"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5195a148e9f48ae124fc145b67c1e5d7b94b99e3ad93bd40f313791fa406559f"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d75ecbbbbeeadb85c7f8925150082642f028b175b497576ceb942c7c35708ac1"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:dbe20cc5f4b470b9f96fb3883af7e496e1240254f14b60c89363653969d9234b"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp37-cp37m-win32.whl", hash = "sha256:ac2fbd27df2f2b12060adad87ea4ca8ade83911384d5550ebb36c65bd669bf8c"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp37-cp37m-win_amd64.whl", hash = "sha256:7270aaf5d1ea12eed2999cf5c1c0e8d104eb4567344f92d72fe49beb151a5a8a"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:e292cf982bc6e2d08b530d7def911e10241def91abbb7c588df8a31c104b1023"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:53fc7c349aee5b9607e1e407e6ae1c3c777a90dbf983c5ed940ab263a240f931"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b29a5da95daad2754d94ad9b651af1a9344e6f53de69362d42171e52c4e1b4a9"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf5feada788eed35522193b9f8407ef94ea20f57b66dcac7b2f64ea5a0ce4665"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a84b3c818dc441e099925c6cb92f50e69752463b87773138c3f183437273a0a0"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b2423e7e9d7905699a8f94a21c1efa75123b625324649b9d0ea6d5ff733c44e3"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-win32.whl", hash = "sha256:7c88a7eb589e30d153d647b86870a4fbfc51d4b401b8cca387322f3f8df0d5bb"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp38-cp38-win_amd64.whl", hash = "sha256:65d9d3ba922044b87932570db22cde64c9c94094330189d8d5f6dddb7e6617b9"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:abfd978e12603889ba63b777eaf3bd4be7ed0763798ab180d2d26a00777b7b70"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:5534ccd989fa095b6516031d299633f160f15bad1438897adffcdb7d454abc8d"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f2aeef6be44cf3d1044686d2fb74c5bc258de4f329770bef561753f16d2bb31"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9ea6d9ef5b975b5d14750dff20bad114d2f2e363de8a28ad65a0802e59af0ea"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:97d187f2b8d53e2a3d746906b22008fc3278a5c52406bda9dd0f619815d41771"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:72edb7950dad7d7a549c54953680c6d6ed11cd2cdc4deb245d70a70922624226"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-win32.whl", hash = "sha256:2414d4e203a3645344954a00dbda321f2a9dbe1461c0a0837f3991377290891c"}, + {file = "json_stream_rs_tokenizer-0.4.27-cp39-cp39-win_amd64.whl", hash = "sha256:d1273178fe559c5fd5532ed928a4a826081b483804f37c7b5bcd9ed2b974571d"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:1141b3630c47b7bd06c65cf75c4333c43a3f9239dcd316be3ad236865407fc6a"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce7782d854469c0d618af6d3b8c4ad72880a813e826a808cbbc6ee17973c6d6d"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fad046fdf59f6bf164d7bea12bb124b9f6c5ed4873408c8bc657b329656a090d"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:83d421ab371901d2ca1d8c4645b764dd7bb72acfa1232cebb10d84fb68b4dba3"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:d5cbaf3c9c03e69b9491ce1f36c1a26c7297304870b2b619649826c622e1c8d5"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp37-pypy37_pp73-macosx_10_12_x86_64.whl", hash = "sha256:200fe73cd74ba8ecc2d7b0610026833fb687ed8ca9dc2d62ff3b91a92cd5031d"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0b65a63a564eb6f893a5e2d7db6bb7692f6b0d10f64d0bc035a5ba241ac06a1f"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd107745de8a163f535b07e5db6e0d23d3bf764efc20b4ab89f1f5c843ae015f"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5968705904c4b0033248defb90c9063f04d3dc160de5027724883200a3a0303e"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:05a68b06b7ac026435af3600d4dd6732f337f946155190b05efeb0f58469110e"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:61b29047feaf92444009a3298a79b1637a31fe00a20b30033b83051061b686f1"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5fe5273e4abc64f8a70f9dbdbb1438c004f129c5370e9746bcf76e7e9bc603c7"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6179fa11091e756cda28bc3550c6d2c131e196b9abf48858bb17aa481d4f957e"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:59b91f108745114e7d91b860f46a41e940dfd35ec86f354f050015a8b8bb44ef"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:6e1d25661feb3c38c459e0bcd72d99ff17fe357d0e845c2a774a7518506de695"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:d5b40e047521ebf00600551226abcb1e917022181f1472ea47bffcbf5b0b1101"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e926055ab7be6d864f1f8cdc13e43ece1f802d5040912d910a6c912051aa599"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:06c64404586bf49e6f782a1f5768f579fe4906d892f252d7d55d8d22360c4f0b"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f04c20485daef5b93ed33093a808eab08b9d0ead005eede96e3f972b3ae028c6"}, + {file = "json_stream_rs_tokenizer-0.4.27-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:02834ed71f2e27b11e3cc8bb37f80dcf86f00f6b69c02bc508af32be04c79e72"}, + {file = "json_stream_rs_tokenizer-0.4.27.tar.gz", hash = "sha256:8c947c72966cc9b0076e0967077defae18c49a0600974c2829d48264240e2f72"}, ] +[package.extras] +benchmark = ["contexttimer (>=0.3,<0.4)", "json-stream-to-standard-types (>=0.1,<0.2)", "si-prefix (>=1.2,<2)", "tqdm (>=4.64,<5)", "typer (>=0.6,<0.7)"] +test = ["json-stream (==2.3.2)", "json-stream-rs-tokenizer[benchmark]", "pytest (>7.1,<8)"] + [[package]] name = "packaging" -version = "23.2" +version = "24.2" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" -files = [ - {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, - {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, -] - -[[package]] -name = "pathspec" -version = "0.11.2" -description = "Utility library for gitignore style pattern matching of file paths." -optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "pathspec-0.11.2-py3-none-any.whl", hash = "sha256:1d6ed233af05e679efb96b1851550ea95bbb64b7c490b0f5aa52996c11e92a20"}, - {file = "pathspec-0.11.2.tar.gz", hash = "sha256:e0d8d0ac2f12da61956eb2306b69f9469b42f4deb0f3cb6ed47b9cce9996ced3"}, + {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, + {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, ] [[package]] name = "platformdirs" -version = "3.11.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "platformdirs-3.11.0-py3-none-any.whl", hash = "sha256:e9d171d00af68be50e9202731309c4e658fd8bc76f55c11c7dd760d023bda68e"}, - {file = "platformdirs-3.11.0.tar.gz", hash = "sha256:cf8ee52a3afdb965072dcc652433e0c7e3e40cf5ea1477cd4b3b1d2eb75495b3"}, + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, ] [package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] [[package]] name = "pluggy" -version = "1.3.0" +version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, - {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, + {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 = "pycodestyle" -version = "2.9.1" -description = "Python style guide checker" -optional = false -python-versions = ">=3.6" -files = [ - {file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"}, - {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, -] - [[package]] name = "pydantic" -version = "1.10.13" -description = "Data validation and settings management using python type hints" +version = "2.10.6" +description = "Data validation using Python type hints" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "pydantic-1.10.13-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:efff03cc7a4f29d9009d1c96ceb1e7a70a65cfe86e89d34e4a5f2ab1e5693737"}, - {file = "pydantic-1.10.13-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3ecea2b9d80e5333303eeb77e180b90e95eea8f765d08c3d278cd56b00345d01"}, - {file = "pydantic-1.10.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1740068fd8e2ef6eb27a20e5651df000978edce6da6803c2bef0bc74540f9548"}, - {file = "pydantic-1.10.13-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84bafe2e60b5e78bc64a2941b4c071a4b7404c5c907f5f5a99b0139781e69ed8"}, - {file = "pydantic-1.10.13-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bc0898c12f8e9c97f6cd44c0ed70d55749eaf783716896960b4ecce2edfd2d69"}, - {file = "pydantic-1.10.13-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:654db58ae399fe6434e55325a2c3e959836bd17a6f6a0b6ca8107ea0571d2e17"}, - {file = "pydantic-1.10.13-cp310-cp310-win_amd64.whl", hash = "sha256:75ac15385a3534d887a99c713aa3da88a30fbd6204a5cd0dc4dab3d770b9bd2f"}, - {file = "pydantic-1.10.13-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c553f6a156deb868ba38a23cf0df886c63492e9257f60a79c0fd8e7173537653"}, - {file = "pydantic-1.10.13-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5e08865bc6464df8c7d61439ef4439829e3ab62ab1669cddea8dd00cd74b9ffe"}, - {file = "pydantic-1.10.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e31647d85a2013d926ce60b84f9dd5300d44535a9941fe825dc349ae1f760df9"}, - {file = "pydantic-1.10.13-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:210ce042e8f6f7c01168b2d84d4c9eb2b009fe7bf572c2266e235edf14bacd80"}, - {file = "pydantic-1.10.13-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:8ae5dd6b721459bfa30805f4c25880e0dd78fc5b5879f9f7a692196ddcb5a580"}, - {file = "pydantic-1.10.13-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f8e81fc5fb17dae698f52bdd1c4f18b6ca674d7068242b2aff075f588301bbb0"}, - {file = "pydantic-1.10.13-cp311-cp311-win_amd64.whl", hash = "sha256:61d9dce220447fb74f45e73d7ff3b530e25db30192ad8d425166d43c5deb6df0"}, - {file = "pydantic-1.10.13-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4b03e42ec20286f052490423682016fd80fda830d8e4119f8ab13ec7464c0132"}, - {file = "pydantic-1.10.13-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f59ef915cac80275245824e9d771ee939133be38215555e9dc90c6cb148aaeb5"}, - {file = "pydantic-1.10.13-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a1f9f747851338933942db7af7b6ee8268568ef2ed86c4185c6ef4402e80ba8"}, - {file = "pydantic-1.10.13-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:97cce3ae7341f7620a0ba5ef6cf043975cd9d2b81f3aa5f4ea37928269bc1b87"}, - {file = "pydantic-1.10.13-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:854223752ba81e3abf663d685f105c64150873cc6f5d0c01d3e3220bcff7d36f"}, - {file = "pydantic-1.10.13-cp37-cp37m-win_amd64.whl", hash = "sha256:b97c1fac8c49be29486df85968682b0afa77e1b809aff74b83081cc115e52f33"}, - {file = "pydantic-1.10.13-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c958d053453a1c4b1c2062b05cd42d9d5c8eb67537b8d5a7e3c3032943ecd261"}, - {file = "pydantic-1.10.13-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4c5370a7edaac06daee3af1c8b1192e305bc102abcbf2a92374b5bc793818599"}, - {file = "pydantic-1.10.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d6f6e7305244bddb4414ba7094ce910560c907bdfa3501e9db1a7fd7eaea127"}, - {file = "pydantic-1.10.13-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d3a3c792a58e1622667a2837512099eac62490cdfd63bd407993aaf200a4cf1f"}, - {file = "pydantic-1.10.13-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:c636925f38b8db208e09d344c7aa4f29a86bb9947495dd6b6d376ad10334fb78"}, - {file = "pydantic-1.10.13-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:678bcf5591b63cc917100dc50ab6caebe597ac67e8c9ccb75e698f66038ea953"}, - {file = "pydantic-1.10.13-cp38-cp38-win_amd64.whl", hash = "sha256:6cf25c1a65c27923a17b3da28a0bdb99f62ee04230c931d83e888012851f4e7f"}, - {file = "pydantic-1.10.13-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8ef467901d7a41fa0ca6db9ae3ec0021e3f657ce2c208e98cd511f3161c762c6"}, - {file = "pydantic-1.10.13-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:968ac42970f57b8344ee08837b62f6ee6f53c33f603547a55571c954a4225691"}, - {file = "pydantic-1.10.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9849f031cf8a2f0a928fe885e5a04b08006d6d41876b8bbd2fc68a18f9f2e3fd"}, - {file = "pydantic-1.10.13-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56e3ff861c3b9c6857579de282ce8baabf443f42ffba355bf070770ed63e11e1"}, - {file = "pydantic-1.10.13-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f00790179497767aae6bcdc36355792c79e7bbb20b145ff449700eb076c5f96"}, - {file = "pydantic-1.10.13-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:75b297827b59bc229cac1a23a2f7a4ac0031068e5be0ce385be1462e7e17a35d"}, - {file = "pydantic-1.10.13-cp39-cp39-win_amd64.whl", hash = "sha256:e70ca129d2053fb8b728ee7d1af8e553a928d7e301a311094b8a0501adc8763d"}, - {file = "pydantic-1.10.13-py3-none-any.whl", hash = "sha256:b87326822e71bd5f313e7d3bfdc77ac3247035ac10b0c0618bd99dcf95b1e687"}, - {file = "pydantic-1.10.13.tar.gz", hash = "sha256:32c8b48dcd3b2ac4e78b0ba4af3a2c2eb6048cb75202f0ea7b34feb740efc340"}, + {file = "pydantic-2.10.6-py3-none-any.whl", hash = "sha256:427d664bf0b8a2b34ff5dd0f5a18df00591adcee7198fbd71981054cef37b584"}, + {file = "pydantic-2.10.6.tar.gz", hash = "sha256:ca5daa827cce33de7a42be142548b0096bf05a7e7b365aebfa5f8eeec7128236"}, ] [package.dependencies] -typing-extensions = ">=4.2.0" +annotated-types = ">=0.6.0" +pydantic-core = "2.27.2" +typing-extensions = ">=4.12.2" [package.extras] -dotenv = ["python-dotenv (>=0.10.4)"] -email = ["email-validator (>=1.0.3)"] +email = ["email-validator (>=2.0.0)"] +timezone = ["tzdata"] [[package]] -name = "pyflakes" -version = "2.5.0" -description = "passive checker of Python programs" +name = "pydantic-core" +version = "2.27.2" +description = "Core functionality for Pydantic validation and serialization" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, - {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2d367ca20b2f14095a8f4fa1210f5a7b78b8a20009ecced6b12818f455b1e9fa"}, + {file = "pydantic_core-2.27.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:491a2b73db93fab69731eaee494f320faa4e093dbed776be1a829c2eb222c34c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7969e133a6f183be60e9f6f56bfae753585680f3b7307a8e555a948d443cc05a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3de9961f2a346257caf0aa508a4da705467f53778e9ef6fe744c038119737ef5"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e2bb4d3e5873c37bb3dd58714d4cd0b0e6238cebc4177ac8fe878f8b3aa8e74c"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:280d219beebb0752699480fe8f1dc61ab6615c2046d76b7ab7ee38858de0a4e7"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47956ae78b6422cbd46f772f1746799cbb862de838fd8d1fbd34a82e05b0983a"}, + {file = "pydantic_core-2.27.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:14d4a5c49d2f009d62a2a7140d3064f686d17a5d1a268bc641954ba181880236"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:337b443af21d488716f8d0b6164de833e788aa6bd7e3a39c005febc1284f4962"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:03d0f86ea3184a12f41a2d23f7ccb79cdb5a18e06993f8a45baa8dfec746f0e9"}, + {file = "pydantic_core-2.27.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7041c36f5680c6e0f08d922aed302e98b3745d97fe1589db0a3eebf6624523af"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win32.whl", hash = "sha256:50a68f3e3819077be2c98110c1f9dcb3817e93f267ba80a2c05bb4f8799e2ff4"}, + {file = "pydantic_core-2.27.2-cp310-cp310-win_amd64.whl", hash = "sha256:e0fd26b16394ead34a424eecf8a31a1f5137094cabe84a1bcb10fa6ba39d3d31"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:8e10c99ef58cfdf2a66fc15d66b16c4a04f62bca39db589ae8cba08bc55331bc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:26f32e0adf166a84d0cb63be85c562ca8a6fa8de28e5f0d92250c6b7e9e2aff7"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8c19d1ea0673cd13cc2f872f6c9ab42acc4e4f492a7ca9d3795ce2b112dd7e15"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5e68c4446fe0810e959cdff46ab0a41ce2f2c86d227d96dc3847af0ba7def306"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d9640b0059ff4f14d1f37321b94061c6db164fbe49b334b31643e0528d100d99"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:40d02e7d45c9f8af700f3452f329ead92da4c5f4317ca9b896de7ce7199ea459"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1c1fd185014191700554795c99b347d64f2bb637966c4cfc16998a0ca700d048"}, + {file = "pydantic_core-2.27.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d81d2068e1c1228a565af076598f9e7451712700b673de8f502f0334f281387d"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:1a4207639fb02ec2dbb76227d7c751a20b1a6b4bc52850568e52260cae64ca3b"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:3de3ce3c9ddc8bbd88f6e0e304dea0e66d843ec9de1b0042b0911c1663ffd474"}, + {file = "pydantic_core-2.27.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:30c5f68ded0c36466acede341551106821043e9afaad516adfb6e8fa80a4e6a6"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win32.whl", hash = "sha256:c70c26d2c99f78b125a3459f8afe1aed4d9687c24fd677c6a4436bc042e50d6c"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_amd64.whl", hash = "sha256:08e125dbdc505fa69ca7d9c499639ab6407cfa909214d500897d02afb816e7cc"}, + {file = "pydantic_core-2.27.2-cp311-cp311-win_arm64.whl", hash = "sha256:26f0d68d4b235a2bae0c3fc585c585b4ecc51382db0e3ba402a22cbc440915e4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9e0c8cfefa0ef83b4da9588448b6d8d2a2bf1a53c3f1ae5fca39eb3061e2f0b0"}, + {file = "pydantic_core-2.27.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:83097677b8e3bd7eaa6775720ec8e0405f1575015a463285a92bfdfe254529ef"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:172fce187655fece0c90d90a678424b013f8fbb0ca8b036ac266749c09438cb7"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:519f29f5213271eeeeb3093f662ba2fd512b91c5f188f3bb7b27bc5973816934"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:05e3a55d124407fffba0dd6b0c0cd056d10e983ceb4e5dbd10dda135c31071d6"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9c3ed807c7b91de05e63930188f19e921d1fe90de6b4f5cd43ee7fcc3525cb8c"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6fb4aadc0b9a0c063206846d603b92030eb6f03069151a625667f982887153e2"}, + {file = "pydantic_core-2.27.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28ccb213807e037460326424ceb8b5245acb88f32f3d2777427476e1b32c48c4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:de3cd1899e2c279b140adde9357c4495ed9d47131b4a4eaff9052f23398076b3"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:220f892729375e2d736b97d0e51466252ad84c51857d4d15f5e9692f9ef12be4"}, + {file = "pydantic_core-2.27.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a0fcd29cd6b4e74fe8ddd2c90330fd8edf2e30cb52acda47f06dd615ae72da57"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win32.whl", hash = "sha256:1e2cb691ed9834cd6a8be61228471d0a503731abfb42f82458ff27be7b2186fc"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_amd64.whl", hash = "sha256:cc3f1a99a4f4f9dd1de4fe0312c114e740b5ddead65bb4102884b384c15d8bc9"}, + {file = "pydantic_core-2.27.2-cp312-cp312-win_arm64.whl", hash = "sha256:3911ac9284cd8a1792d3cb26a2da18f3ca26c6908cc434a18f730dc0db7bfa3b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7d14bd329640e63852364c306f4d23eb744e0f8193148d4044dd3dacdaacbd8b"}, + {file = "pydantic_core-2.27.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:82f91663004eb8ed30ff478d77c4d1179b3563df6cdb15c0817cd1cdaf34d154"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71b24c7d61131bb83df10cc7e687433609963a944ccf45190cfc21e0887b08c9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:fa8e459d4954f608fa26116118bb67f56b93b209c39b008277ace29937453dc9"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ce8918cbebc8da707ba805b7fd0b382816858728ae7fe19a942080c24e5b7cd1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:eda3f5c2a021bbc5d976107bb302e0131351c2ba54343f8a496dc8783d3d3a6a"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd8086fa684c4775c27f03f062cbb9eaa6e17f064307e86b21b9e0abc9c0f02e"}, + {file = "pydantic_core-2.27.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8d9b3388db186ba0c099a6d20f0604a44eabdeef1777ddd94786cdae158729e4"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7a66efda2387de898c8f38c0cf7f14fca0b51a8ef0b24bfea5849f1b3c95af27"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:18a101c168e4e092ab40dbc2503bdc0f62010e95d292b27827871dc85450d7ee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ba5dd002f88b78a4215ed2f8ddbdf85e8513382820ba15ad5ad8955ce0ca19a1"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win32.whl", hash = "sha256:1ebaf1d0481914d004a573394f4be3a7616334be70261007e47c2a6fe7e50130"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_amd64.whl", hash = "sha256:953101387ecf2f5652883208769a79e48db18c6df442568a0b5ccd8c2723abee"}, + {file = "pydantic_core-2.27.2-cp313-cp313-win_arm64.whl", hash = "sha256:ac4dbfd1691affb8f48c2c13241a2e3b60ff23247cbcf981759c768b6633cf8b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d3e8d504bdd3f10835468f29008d72fc8359d95c9c415ce6e767203db6127506"}, + {file = "pydantic_core-2.27.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:521eb9b7f036c9b6187f0b47318ab0d7ca14bd87f776240b90b21c1f4f149320"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85210c4d99a0114f5a9481b44560d7d1e35e32cc5634c656bc48e590b669b145"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:d716e2e30c6f140d7560ef1538953a5cd1a87264c737643d481f2779fc247fe1"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f66d89ba397d92f840f8654756196d93804278457b5fbede59598a1f9f90b228"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:669e193c1c576a58f132e3158f9dfa9662969edb1a250c54d8fa52590045f046"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9fdbe7629b996647b99c01b37f11170a57ae675375b14b8c13b8518b8320ced5"}, + {file = "pydantic_core-2.27.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d262606bf386a5ba0b0af3b97f37c83d7011439e3dc1a9298f21efb292e42f1a"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cabb9bcb7e0d97f74df8646f34fc76fbf793b7f6dc2438517d7a9e50eee4f14d"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_armv7l.whl", hash = "sha256:d2d63f1215638d28221f664596b1ccb3944f6e25dd18cd3b86b0a4c408d5ebb9"}, + {file = "pydantic_core-2.27.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bca101c00bff0adb45a833f8451b9105d9df18accb8743b08107d7ada14bd7da"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win32.whl", hash = "sha256:f6f8e111843bbb0dee4cb6594cdc73e79b3329b526037ec242a3e49012495b3b"}, + {file = "pydantic_core-2.27.2-cp38-cp38-win_amd64.whl", hash = "sha256:fd1aea04935a508f62e0d0ef1f5ae968774a32afc306fb8545e06f5ff5cdf3ad"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c10eb4f1659290b523af58fa7cffb452a61ad6ae5613404519aee4bfbf1df993"}, + {file = "pydantic_core-2.27.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef592d4bad47296fb11f96cd7dc898b92e795032b4894dfb4076cfccd43a9308"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c61709a844acc6bf0b7dce7daae75195a10aac96a596ea1b776996414791ede4"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c5f762659e47fdb7b16956c71598292f60a03aa92f8b6351504359dbdba6cf"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4c9775e339e42e79ec99c441d9730fccf07414af63eac2f0e48e08fd38a64d76"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:57762139821c31847cfb2df63c12f725788bd9f04bc2fb392790959b8f70f118"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d1e85068e818c73e048fe28cfc769040bb1f475524f4745a5dc621f75ac7630"}, + {file = "pydantic_core-2.27.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:097830ed52fd9e427942ff3b9bc17fab52913b2f50f2880dc4a5611446606a54"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:044a50963a614ecfae59bb1eaf7ea7efc4bc62f49ed594e18fa1e5d953c40e9f"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:4e0b4220ba5b40d727c7f879eac379b822eee5d8fff418e9d3381ee45b3b0362"}, + {file = "pydantic_core-2.27.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5e4f4bb20d75e9325cc9696c6802657b58bc1dbbe3022f32cc2b2b632c3fbb96"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win32.whl", hash = "sha256:cca63613e90d001b9f2f9a9ceb276c308bfa2a43fafb75c8031c4f66039e8c6e"}, + {file = "pydantic_core-2.27.2-cp39-cp39-win_amd64.whl", hash = "sha256:77d1bca19b0f7021b3a982e6f903dcd5b2b06076def36a652e3907f596e29f67"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:2bf14caea37e91198329b828eae1618c068dfb8ef17bb33287a7ad4b61ac314e"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:b0cb791f5b45307caae8810c2023a184c74605ec3bcbb67d13846c28ff731ff8"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:688d3fd9fcb71f41c4c015c023d12a79d1c4c0732ec9eb35d96e3388a120dcf3"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d591580c34f4d731592f0e9fe40f9cc1b430d297eecc70b962e93c5c668f15f"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:82f986faf4e644ffc189a7f1aafc86e46ef70372bb153e7001e8afccc6e54133"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:bec317a27290e2537f922639cafd54990551725fc844249e64c523301d0822fc"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:0296abcb83a797db256b773f45773da397da75a08f5fcaef41f2044adec05f50"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0d75070718e369e452075a6017fbf187f788e17ed67a3abd47fa934d001863d9"}, + {file = "pydantic_core-2.27.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7e17b560be3c98a8e3aa66ce828bdebb9e9ac6ad5466fba92eb74c4c95cb1151"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c33939a82924da9ed65dab5a65d427205a73181d8098e79b6b426bdf8ad4e656"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:00bad2484fa6bda1e216e7345a798bd37c68fb2d97558edd584942aa41b7d278"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c817e2b40aba42bac6f457498dacabc568c3b7a986fc9ba7c8d9d260b71485fb"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:251136cdad0cb722e93732cb45ca5299fb56e1344a833640bf93b2803f8d1bfd"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d2088237af596f0a524d3afc39ab3b036e8adb054ee57cbb1dcf8e09da5b29cc"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d4041c0b966a84b4ae7a09832eb691a35aec90910cd2dbe7a208de59be77965b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8083d4e875ebe0b864ffef72a4304827015cff328a1be6e22cc850753bfb122b"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f141ee28a0ad2123b6611b6ceff018039df17f32ada8b534e6aa039545a3efb2"}, + {file = "pydantic_core-2.27.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:7d0c8399fcc1848491f00e0314bd59fb34a9c008761bcb422a057670c3f65e35"}, + {file = "pydantic_core-2.27.2.tar.gz", hash = "sha256:eb026e5a4c1fee05726072337ff51d1efb6f59090b7da90d30ea58625b1ffb39"}, ] +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pyproject-api" -version = "1.6.1" +version = "1.8.0" description = "API to interact with the python pyproject.toml based projects" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "pyproject_api-1.6.1-py3-none-any.whl", hash = "sha256:4c0116d60476b0786c88692cf4e325a9814965e2469c5998b830bba16b183675"}, - {file = "pyproject_api-1.6.1.tar.gz", hash = "sha256:1817dc018adc0d1ff9ca1ed8c60e1623d5aaca40814b953af14a9cf9a5cae538"}, + {file = "pyproject_api-1.8.0-py3-none-any.whl", hash = "sha256:3d7d347a047afe796fd5d1885b1e391ba29be7169bd2f102fcd378f04273d228"}, + {file = "pyproject_api-1.8.0.tar.gz", hash = "sha256:77b8049f2feb5d33eefcc21b57f1e279636277a8ac8ad6b5871037b243778496"}, ] [package.dependencies] -packaging = ">=23.1" +packaging = ">=24.1" tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} [package.extras] -docs = ["furo (>=2023.8.19)", "sphinx (<7.2)", "sphinx-autodoc-typehints (>=1.24)"] -testing = ["covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)", "setuptools (>=68.1.2)", "wheel (>=0.41.2)"] +docs = ["furo (>=2024.8.6)", "sphinx-autodoc-typehints (>=2.4.1)"] +testing = ["covdefaults (>=2.3)", "pytest (>=8.3.3)", "pytest-cov (>=5)", "pytest-mock (>=3.14)", "setuptools (>=75.1)"] [[package]] name = "pytest" -version = "7.4.3" +version = "8.3.5" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, - {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, + {file = "pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"}, + {file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"}, ] [package.dependencies] @@ -352,124 +425,190 @@ 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\""} +pluggy = ">=1.5,<2" +tomli = {version = ">=1", 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"] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "python-dateutil" -version = "2.8.2" +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" +groups = ["main"] files = [ - {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, - {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, + {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.9.10" +description = "An extremely fast Python linter and code formatter, written in Rust." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "ruff-0.9.10-py3-none-linux_armv6l.whl", hash = "sha256:eb4d25532cfd9fe461acc83498361ec2e2252795b4f40b17e80692814329e42d"}, + {file = "ruff-0.9.10-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:188a6638dab1aa9bb6228a7302387b2c9954e455fb25d6b4470cb0641d16759d"}, + {file = "ruff-0.9.10-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5284dcac6b9dbc2fcb71fdfc26a217b2ca4ede6ccd57476f52a587451ebe450d"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47678f39fa2a3da62724851107f438c8229a3470f533894b5568a39b40029c0c"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:99713a6e2766b7a17147b309e8c915b32b07a25c9efd12ada79f217c9c778b3e"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:524ee184d92f7c7304aa568e2db20f50c32d1d0caa235d8ddf10497566ea1a12"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:df92aeac30af821f9acf819fc01b4afc3dfb829d2782884f8739fb52a8119a16"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de42e4edc296f520bb84954eb992a07a0ec5a02fecb834498415908469854a52"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d257f95b65806104b6b1ffca0ea53f4ef98454036df65b1eda3693534813ecd1"}, + {file = "ruff-0.9.10-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b60dec7201c0b10d6d11be00e8f2dbb6f40ef1828ee75ed739923799513db24c"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d838b60007da7a39c046fcdd317293d10b845001f38bcb55ba766c3875b01e43"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ccaf903108b899beb8e09a63ffae5869057ab649c1e9231c05ae354ebc62066c"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f9567d135265d46e59d62dc60c0bfad10e9a6822e231f5b24032dba5a55be6b5"}, + {file = "ruff-0.9.10-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5f202f0d93738c28a89f8ed9eaba01b7be339e5d8d642c994347eaa81c6d75b8"}, + {file = "ruff-0.9.10-py3-none-win32.whl", hash = "sha256:bfb834e87c916521ce46b1788fbb8484966e5113c02df216680102e9eb960029"}, + {file = "ruff-0.9.10-py3-none-win_amd64.whl", hash = "sha256:f2160eeef3031bf4b17df74e307d4c5fb689a6f3a26a2de3f7ef4044e3c484f1"}, + {file = "ruff-0.9.10-py3-none-win_arm64.whl", hash = "sha256:5fd804c0327a5e5ea26615550e706942f348b197d5475ff34c19733aee4b2e69"}, + {file = "ruff-0.9.10.tar.gz", hash = "sha256:9bacb735d7bada9cfb0f2c227d3658fc443d90a727b47f206fb33f52f3c0eac7"}, +] + [[package]] name = "six" -version = "1.16.0" +version = "1.17.0" description = "Python 2 and 3 compatibility utilities" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +groups = ["main"] files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, + {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, + {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, ] [[package]] name = "tomli" -version = "2.0.1" +version = "2.2.1" description = "A lil' TOML parser" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, + {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee"}, + {file = "tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106"}, + {file = "tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8"}, + {file = "tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff"}, + {file = "tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea"}, + {file = "tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222"}, + {file = "tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd"}, + {file = "tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e"}, + {file = "tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98"}, + {file = "tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7"}, + {file = "tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281"}, + {file = "tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2"}, + {file = "tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744"}, + {file = "tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec"}, + {file = "tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69"}, + {file = "tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc"}, + {file = "tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff"}, ] [[package]] name = "tox" -version = "4.11.3" +version = "4.24.2" description = "tox is a generic virtualenv management and test command line tool" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "tox-4.11.3-py3-none-any.whl", hash = "sha256:599af5e5bb0cad0148ac1558a0b66f8fff219ef88363483b8d92a81e4246f28f"}, - {file = "tox-4.11.3.tar.gz", hash = "sha256:5039f68276461fae6a9452a3b2c7295798f00a0e92edcd9a3b78ba1a73577951"}, + {file = "tox-4.24.2-py3-none-any.whl", hash = "sha256:92e8290e76ad4e15748860a205865696409a2d014eedeb796a34a0f3b5e7336e"}, + {file = "tox-4.24.2.tar.gz", hash = "sha256:d5948b350f76fae436d6545a5e87c2b676ab7a0d7d88c1308651245eadbe8aea"}, ] [package.dependencies] -cachetools = ">=5.3.1" +cachetools = ">=5.5.1" chardet = ">=5.2" colorama = ">=0.4.6" -filelock = ">=3.12.3" -packaging = ">=23.1" -platformdirs = ">=3.10" -pluggy = ">=1.3" -pyproject-api = ">=1.6.1" -tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} -virtualenv = ">=20.24.3" +filelock = ">=3.16.1" +packaging = ">=24.2" +platformdirs = ">=4.3.6" +pluggy = ">=1.5" +pyproject-api = ">=1.8" +tomli = {version = ">=2.2.1", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.12.2", markers = "python_version < \"3.11\""} +virtualenv = ">=20.29.1" [package.extras] -docs = ["furo (>=2023.8.19)", "sphinx (>=7.2.4)", "sphinx-argparse-cli (>=1.11.1)", "sphinx-autodoc-typehints (>=1.24)", "sphinx-copybutton (>=0.5.2)", "sphinx-inline-tabs (>=2023.4.21)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -testing = ["build[virtualenv] (>=0.10)", "covdefaults (>=2.3)", "detect-test-pollution (>=1.1.1)", "devpi-process (>=1)", "diff-cover (>=7.7)", "distlib (>=0.3.7)", "flaky (>=3.7)", "hatch-vcs (>=0.3)", "hatchling (>=1.18)", "psutil (>=5.9.5)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)", "pytest-xdist (>=3.3.1)", "re-assert (>=1.1)", "time-machine (>=2.12)", "wheel (>=0.41.2)"] +test = ["devpi-process (>=1.0.2)", "pytest (>=8.3.4)", "pytest-mock (>=3.14)"] [[package]] name = "typing-extensions" -version = "4.8.0" +version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ - {file = "typing_extensions-4.8.0-py3-none-any.whl", hash = "sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0"}, - {file = "typing_extensions-4.8.0.tar.gz", hash = "sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef"}, + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] name = "urllib3" -version = "2.0.7" +version = "2.2.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "urllib3-2.0.7-py3-none-any.whl", hash = "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e"}, - {file = "urllib3-2.0.7.tar.gz", hash = "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84"}, + {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, + {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, ] [package.extras] brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] -secure = ["certifi", "cryptography (>=1.9)", "idna (>=2.0.0)", "pyopenssl (>=17.1.0)", "urllib3-secure-extra"] +h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.24.6" +version = "20.29.3" description = "Virtual Python Environment builder" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +groups = ["dev"] files = [ - {file = "virtualenv-20.24.6-py3-none-any.whl", hash = "sha256:520d056652454c5098a00c0f073611ccbea4c79089331f60bf9d7ba247bb7381"}, - {file = "virtualenv-20.24.6.tar.gz", hash = "sha256:02ece4f56fbf939dbbc33c0715159951d6bf14aaf5457b092e4548e1382455af"}, + {file = "virtualenv-20.29.3-py3-none-any.whl", hash = "sha256:3e3d00f5807e83b234dfb6122bf37cfadf4be216c53a49ac059d02414f819170"}, + {file = "virtualenv-20.29.3.tar.gz", hash = "sha256:95e39403fcf3940ac45bc717597dba16110b74506131845d9b687d5e73d947ac"}, ] [package.dependencies] distlib = ">=0.3.7,<1" filelock = ">=3.12.2,<4" -platformdirs = ">=3.9.1,<4" +platformdirs = ">=3.9.1,<5" [package.extras] -docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] +docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] [metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "8f80533b8222211eb857dc6d79423a74d11b7f91f60347e297463aca3a9ff731" +lock-version = "2.1" +python-versions = ">=3.8,<4" +content-hash = "5d06cc61f1a2795f6cd6caf1c2af35d42af23b57e58a20f420c9b447c113305c" diff --git a/pyevr/__init__.py b/pyevr/__init__.py index d12095f..25ad4fd 100644 --- a/pyevr/__init__.py +++ b/pyevr/__init__.py @@ -3,3 +3,5 @@ """Top-level package for pyevr.""" from .client import EVRClient + +__all__ = ["EVRClient"] diff --git a/pyevr/client.py b/pyevr/client.py index 00812aa..1da48f9 100644 --- a/pyevr/client.py +++ b/pyevr/client.py @@ -1,10 +1,17 @@ # -*- coding: utf-8 -*- """Main module.""" + +import contextvars + +from pydantic import BaseModel + from pyevr import apis from pyevr.openapi_client.api_client import ApiClient from pyevr.openapi_client.configuration import Configuration +full_serialization = contextvars.ContextVar("full_serialization", default=False) + class ExtendedApiClient(ApiClient): """Extended API client generated by openapi-generator-cli.""" @@ -21,6 +28,23 @@ def deserialize_data(cls, response_data, response_type): """ return response_type.from_dict(response_data) + def sanitize_for_serialization(self, obj): + if hasattr(obj, "actual_instance"): + return self.sanitize_for_serialization(obj.actual_instance) + + if full_serialization.get() and isinstance(obj, BaseModel): + return super().sanitize_for_serialization(obj.__dict__) + + return super().sanitize_for_serialization(obj) + + def serialize_fully(self, obj): + token = full_serialization.set(True) + try: + result = self.sanitize_for_serialization(obj) + finally: + full_serialization.reset(token) + return result + class EVRClient(object): """API client class for EVR. @@ -48,3 +72,7 @@ def __init__(self, api_key: str, host: str = None): @classmethod def deserialize_data(cls, response_data, response_type): return cls.openapi_client_class.deserialize_data(response_data, response_type) + + @classmethod + def sanitize_for_serialization(cls, api_model): + return cls.openapi_client_class().serialize_fully(api_model) diff --git a/pyevr/docs/AddMeasurementActRequest.md b/pyevr/docs/AddMeasurementActRequest.md index e583c40..8b0835c 100644 --- a/pyevr/docs/AddMeasurementActRequest.md +++ b/pyevr/docs/AddMeasurementActRequest.md @@ -2,11 +2,12 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **act_number** | **str** | Mõõtmisakti number | [optional] **act_date** | **datetime** | Mõõtmisakti kuupäev | [optional] -**measurements** | [**List[ShipmentItem]**](ShipmentItem.md) | Mõõtmistulemused | [optional] +**measurements** | [**List[Measurement]**](Measurement.md) | Mõõtmistulemused | [optional] **custom_measurement_data** | **object** | Mõõtmistulemused vabas formaadis. | [optional] **total** | [**Total**](Total.md) | | [optional] @@ -20,12 +21,12 @@ json = "{}" # create an instance of AddMeasurementActRequest from a JSON string add_measurement_act_request_instance = AddMeasurementActRequest.from_json(json) # print the JSON string representation of the object -print AddMeasurementActRequest.to_json() +print(AddMeasurementActRequest.to_json()) # convert the object into a dict add_measurement_act_request_dict = add_measurement_act_request_instance.to_dict() # create an instance of AddMeasurementActRequest from a dict -add_measurement_act_request_form_dict = add_measurement_act_request.from_dict(add_measurement_act_request_dict) +add_measurement_act_request_from_dict = AddMeasurementActRequest.from_dict(add_measurement_act_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/AddShipmentsToWaybillRequest.md b/pyevr/docs/AddShipmentsToWaybillRequest.md index 5745290..e98a6e2 100644 --- a/pyevr/docs/AddShipmentsToWaybillRequest.md +++ b/pyevr/docs/AddShipmentsToWaybillRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **shipments** | [**List[Shipment]**](Shipment.md) | Lisatavad veose andmed | @@ -16,12 +17,12 @@ json = "{}" # create an instance of AddShipmentsToWaybillRequest from a JSON string add_shipments_to_waybill_request_instance = AddShipmentsToWaybillRequest.from_json(json) # print the JSON string representation of the object -print AddShipmentsToWaybillRequest.to_json() +print(AddShipmentsToWaybillRequest.to_json()) # convert the object into a dict add_shipments_to_waybill_request_dict = add_shipments_to_waybill_request_instance.to_dict() # create an instance of AddShipmentsToWaybillRequest from a dict -add_shipments_to_waybill_request_form_dict = add_shipments_to_waybill_request.from_dict(add_shipments_to_waybill_request_dict) +add_shipments_to_waybill_request_from_dict = AddShipmentsToWaybillRequest.from_dict(add_shipments_to_waybill_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/AddTimberReportRequest.md b/pyevr/docs/AddTimberReportRequest.md new file mode 100644 index 0000000..c19bf4c --- /dev/null +++ b/pyevr/docs/AddTimberReportRequest.md @@ -0,0 +1,31 @@ +# AddTimberReportRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report_number** | **str** | Mõõtmisraporti number | [optional] +**items** | [**List[TimberReportItem]**](TimberReportItem.md) | Palgi mõõtmisraporti andmed | +**report_date** | **datetime** | Palgi mõõtmisraporti aeg | [optional] + +## Example + +```python +from openapi_client.models.add_timber_report_request import AddTimberReportRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AddTimberReportRequest from a JSON string +add_timber_report_request_instance = AddTimberReportRequest.from_json(json) +# print the JSON string representation of the object +print(AddTimberReportRequest.to_json()) + +# convert the object into a dict +add_timber_report_request_dict = add_timber_report_request_instance.to_dict() +# create an instance of AddTimberReportRequest from a dict +add_timber_report_request_from_dict = AddTimberReportRequest.from_dict(add_timber_report_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/AddWaybillNoteRequest.md b/pyevr/docs/AddWaybillNoteRequest.md index e2bfb6d..b1d9288 100644 --- a/pyevr/docs/AddWaybillNoteRequest.md +++ b/pyevr/docs/AddWaybillNoteRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | Sõnum | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of AddWaybillNoteRequest from a JSON string add_waybill_note_request_instance = AddWaybillNoteRequest.from_json(json) # print the JSON string representation of the object -print AddWaybillNoteRequest.to_json() +print(AddWaybillNoteRequest.to_json()) # convert the object into a dict add_waybill_note_request_dict = add_waybill_note_request_instance.to_dict() # create an instance of AddWaybillNoteRequest from a dict -add_waybill_note_request_form_dict = add_waybill_note_request.from_dict(add_waybill_note_request_dict) +add_waybill_note_request_from_dict = AddWaybillNoteRequest.from_dict(add_waybill_note_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Address.md b/pyevr/docs/Address.md index 97b11be..a4493a8 100644 --- a/pyevr/docs/Address.md +++ b/pyevr/docs/Address.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **country_code** | **str** | Riigi kood | @@ -19,12 +20,12 @@ json = "{}" # create an instance of Address from a JSON string address_instance = Address.from_json(json) # print the JSON string representation of the object -print Address.to_json() +print(Address.to_json()) # convert the object into a dict address_dict = address_instance.to_dict() # create an instance of Address from a dict -address_form_dict = address.from_dict(address_dict) +address_from_dict = Address.from_dict(address_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/AgriculturalBiomass.md b/pyevr/docs/AgriculturalBiomass.md new file mode 100644 index 0000000..329fec6 --- /dev/null +++ b/pyevr/docs/AgriculturalBiomass.md @@ -0,0 +1,33 @@ +# AgriculturalBiomass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_number** | **str** | Dokumendi number | [optional] +**contract_date** | **datetime** | Dokumendi kuupäev | [optional] +**cadaster** | **str** | Katastritunnus | +**agricultural_area_name** | **str** | Kõlviku nimetus | [optional] +**previous_owner** | [**PreviousOwner**](PreviousOwner.md) | | [optional] + +## Example + +```python +from openapi_client.models.agricultural_biomass import AgriculturalBiomass + +# TODO update the JSON string below +json = "{}" +# create an instance of AgriculturalBiomass from a JSON string +agricultural_biomass_instance = AgriculturalBiomass.from_json(json) +# print the JSON string representation of the object +print(AgriculturalBiomass.to_json()) + +# convert the object into a dict +agricultural_biomass_dict = agricultural_biomass_instance.to_dict() +# create an instance of AgriculturalBiomass from a dict +agricultural_biomass_from_dict = AgriculturalBiomass.from_dict(agricultural_biomass_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/Assortment.md b/pyevr/docs/Assortment.md index 99589f0..945b4b1 100644 --- a/pyevr/docs/Assortment.md +++ b/pyevr/docs/Assortment.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | Sortimendi kood | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of Assortment from a JSON string assortment_instance = Assortment.from_json(json) # print the JSON string representation of the object -print Assortment.to_json() +print(Assortment.to_json()) # convert the object into a dict assortment_dict = assortment_instance.to_dict() # create an instance of Assortment from a dict -assortment_form_dict = assortment.from_dict(assortment_dict) +assortment_from_dict = Assortment.from_dict(assortment_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/AssortmentsApi.md b/pyevr/docs/AssortmentsApi.md index 9626cfb..b0a2116 100644 --- a/pyevr/docs/AssortmentsApi.md +++ b/pyevr/docs/AssortmentsApi.md @@ -17,9 +17,8 @@ Tagastab EVR-i aktiivsed sortimendid. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.paged_result_of_assortment import PagedResultOfAssortment from openapi_client.rest import ApiException @@ -63,6 +62,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| Tagastatav lehekülg | [optional] @@ -83,6 +83,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **403** | | - | diff --git a/pyevr/docs/AuthorizationType.md b/pyevr/docs/AuthorizationType.md index 359e7f2..c903960 100644 --- a/pyevr/docs/AuthorizationType.md +++ b/pyevr/docs/AuthorizationType.md @@ -2,9 +2,11 @@ -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `FORVIEWING` (value: `'forViewing'`) + +* `FORMEASURING` (value: `'forMeasuring'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/BaltpoolQuality.md b/pyevr/docs/BaltpoolQuality.md new file mode 100644 index 0000000..913f8be --- /dev/null +++ b/pyevr/docs/BaltpoolQuality.md @@ -0,0 +1,21 @@ +# BaltpoolQuality + + + +## Enum + +* `SM1` (value: `'sm1'`) + +* `SM1W` (value: `'sm1w'`) + +* `SM2` (value: `'sm2'`) + +* `SM3D` (value: `'sm3d'`) + +* `SM3` (value: `'sm3'`) + +* `SM4` (value: `'sm4'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/CancelWaybillRequest.md b/pyevr/docs/CancelWaybillRequest.md index 8afd9ee..4c16dee 100644 --- a/pyevr/docs/CancelWaybillRequest.md +++ b/pyevr/docs/CancelWaybillRequest.md @@ -2,9 +2,11 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **reason** | **str** | Selgitus | +**coordinates** | [**Coordinates**](Coordinates.md) | | [optional] ## Example @@ -16,12 +18,12 @@ json = "{}" # create an instance of CancelWaybillRequest from a JSON string cancel_waybill_request_instance = CancelWaybillRequest.from_json(json) # print the JSON string representation of the object -print CancelWaybillRequest.to_json() +print(CancelWaybillRequest.to_json()) # convert the object into a dict cancel_waybill_request_dict = cancel_waybill_request_instance.to_dict() # create an instance of CancelWaybillRequest from a dict -cancel_waybill_request_form_dict = cancel_waybill_request.from_dict(cancel_waybill_request_dict) +cancel_waybill_request_from_dict = CancelWaybillRequest.from_dict(cancel_waybill_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Certificate.md b/pyevr/docs/Certificate.md index a8e318f..aa0d70e 100644 --- a/pyevr/docs/Certificate.md +++ b/pyevr/docs/Certificate.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | Sertifikaadi kood | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of Certificate from a JSON string certificate_instance = Certificate.from_json(json) # print the JSON string representation of the object -print Certificate.to_json() +print(Certificate.to_json()) # convert the object into a dict certificate_dict = certificate_instance.to_dict() # create an instance of Certificate from a dict -certificate_form_dict = certificate.from_dict(certificate_dict) +certificate_from_dict = Certificate.from_dict(certificate_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/CertificateClaim.md b/pyevr/docs/CertificateClaim.md index bfa225a..c4ab91c 100644 --- a/pyevr/docs/CertificateClaim.md +++ b/pyevr/docs/CertificateClaim.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | [Tarneahela sertifikaadi väite kood](#operation/Certificates_List) | @@ -17,12 +18,12 @@ json = "{}" # create an instance of CertificateClaim from a JSON string certificate_claim_instance = CertificateClaim.from_json(json) # print the JSON string representation of the object -print CertificateClaim.to_json() +print(CertificateClaim.to_json()) # convert the object into a dict certificate_claim_dict = certificate_claim_instance.to_dict() # create an instance of CertificateClaim from a dict -certificate_claim_form_dict = certificate_claim.from_dict(certificate_claim_dict) +certificate_claim_from_dict = CertificateClaim.from_dict(certificate_claim_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/CertificatesApi.md b/pyevr/docs/CertificatesApi.md index 12217d4..f5a66eb 100644 --- a/pyevr/docs/CertificatesApi.md +++ b/pyevr/docs/CertificatesApi.md @@ -17,9 +17,8 @@ Tagastab EVR-i aktiivsed sertifikaadid. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.paged_result_of_certificate import PagedResultOfCertificate from openapi_client.rest import ApiException @@ -63,6 +62,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| Tagastatav lehekülg | [optional] @@ -83,6 +83,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **403** | | - | diff --git a/pyevr/docs/ConsolidatedAct.md b/pyevr/docs/ConsolidatedAct.md index 73baf4d..cdef7e6 100644 --- a/pyevr/docs/ConsolidatedAct.md +++ b/pyevr/docs/ConsolidatedAct.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contract_number** | **str** | Dokumendi number | @@ -9,6 +10,8 @@ Name | Type | Description | Notes **cadaster** | **str** | Katastritunnus | **compartment** | **str** | Kvartal | [optional] **forest_allocation_number** | **str** | Metsaeraldis | [optional] +**forest_notice_number** | **str** | Metsateatise number | [optional] +**sources** | [**List[ConsolidatedActSourceItem]**](ConsolidatedActSourceItem.md) | Koormas olevate saadetiste päritolud | [optional] ## Example @@ -20,12 +23,12 @@ json = "{}" # create an instance of ConsolidatedAct from a JSON string consolidated_act_instance = ConsolidatedAct.from_json(json) # print the JSON string representation of the object -print ConsolidatedAct.to_json() +print(ConsolidatedAct.to_json()) # convert the object into a dict consolidated_act_dict = consolidated_act_instance.to_dict() # create an instance of ConsolidatedAct from a dict -consolidated_act_form_dict = consolidated_act.from_dict(consolidated_act_dict) +consolidated_act_from_dict = ConsolidatedAct.from_dict(consolidated_act_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ConsolidatedActSourceItem.md b/pyevr/docs/ConsolidatedActSourceItem.md new file mode 100644 index 0000000..a066af3 --- /dev/null +++ b/pyevr/docs/ConsolidatedActSourceItem.md @@ -0,0 +1,40 @@ +# ConsolidatedActSourceItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**property_name** | **str** | | [optional] +**cadaster** | **str** | Katastritunnus | +**compartment** | **str** | Kvartal | [optional] +**assortment** | [**ShipmentAssortment**](ShipmentAssortment.md) | | +**amount** | **int** | Kogus | +**unit_code** | **str** | [Mõõtühiku kood](#operation/MeasurementUnits_List) | +**holding_base_type** | [**HoldingBaseType**](HoldingBaseType.md) | | +**forest_notice_number** | **str** | Metsateatise number | [optional] +**contract_number** | **str** | Dokumendi number | [optional] +**contract_date** | **datetime** | Dokumendi kuupäev | [optional] +**certificate** | [**CertificateClaim**](CertificateClaim.md) | | [optional] +**previous_owner** | [**PreviousOwner**](PreviousOwner.md) | | [optional] + +## Example + +```python +from openapi_client.models.consolidated_act_source_item import ConsolidatedActSourceItem + +# TODO update the JSON string below +json = "{}" +# create an instance of ConsolidatedActSourceItem from a JSON string +consolidated_act_source_item_instance = ConsolidatedActSourceItem.from_json(json) +# print the JSON string representation of the object +print(ConsolidatedActSourceItem.to_json()) + +# convert the object into a dict +consolidated_act_source_item_dict = consolidated_act_source_item_instance.to_dict() +# create an instance of ConsolidatedActSourceItem from a dict +consolidated_act_source_item_from_dict = ConsolidatedActSourceItem.from_dict(consolidated_act_source_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/ContactPerson.md b/pyevr/docs/ContactPerson.md index 0c2c4ad..56d79d4 100644 --- a/pyevr/docs/ContactPerson.md +++ b/pyevr/docs/ContactPerson.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of ContactPerson from a JSON string contact_person_instance = ContactPerson.from_json(json) # print the JSON string representation of the object -print ContactPerson.to_json() +print(ContactPerson.to_json()) # convert the object into a dict contact_person_dict = contact_person_instance.to_dict() # create an instance of ContactPerson from a dict -contact_person_form_dict = contact_person.from_dict(contact_person_dict) +contact_person_from_dict = ContactPerson.from_dict(contact_person_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ContractForTransferOfCuttingRights.md b/pyevr/docs/ContractForTransferOfCuttingRights.md index 3a367df..2699a3e 100644 --- a/pyevr/docs/ContractForTransferOfCuttingRights.md +++ b/pyevr/docs/ContractForTransferOfCuttingRights.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contract_number** | **str** | Dokumendi number | @@ -10,6 +11,7 @@ Name | Type | Description | Notes **compartment** | **str** | Kvartal | [optional] **forest_allocation_number** | **str** | Metsaeraldis | [optional] **previous_owner** | [**PreviousOwner**](PreviousOwner.md) | | +**forest_notice_number** | **str** | Metsateatise number | [optional] ## Example @@ -21,12 +23,12 @@ json = "{}" # create an instance of ContractForTransferOfCuttingRights from a JSON string contract_for_transfer_of_cutting_rights_instance = ContractForTransferOfCuttingRights.from_json(json) # print the JSON string representation of the object -print ContractForTransferOfCuttingRights.to_json() +print(ContractForTransferOfCuttingRights.to_json()) # convert the object into a dict contract_for_transfer_of_cutting_rights_dict = contract_for_transfer_of_cutting_rights_instance.to_dict() # create an instance of ContractForTransferOfCuttingRights from a dict -contract_for_transfer_of_cutting_rights_form_dict = contract_for_transfer_of_cutting_rights.from_dict(contract_for_transfer_of_cutting_rights_dict) +contract_for_transfer_of_cutting_rights_from_dict = ContractForTransferOfCuttingRights.from_dict(contract_for_transfer_of_cutting_rights_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Coordinates.md b/pyevr/docs/Coordinates.md index 344f28f..71e3071 100644 --- a/pyevr/docs/Coordinates.md +++ b/pyevr/docs/Coordinates.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **x** | **float** | X koordinaat | @@ -18,12 +19,12 @@ json = "{}" # create an instance of Coordinates from a JSON string coordinates_instance = Coordinates.from_json(json) # print the JSON string representation of the object -print Coordinates.to_json() +print(Coordinates.to_json()) # convert the object into a dict coordinates_dict = coordinates_instance.to_dict() # create an instance of Coordinates from a dict -coordinates_form_dict = coordinates.from_dict(coordinates_dict) +coordinates_from_dict = Coordinates.from_dict(coordinates_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/DefectCode.md b/pyevr/docs/DefectCode.md new file mode 100644 index 0000000..1e82129 --- /dev/null +++ b/pyevr/docs/DefectCode.md @@ -0,0 +1,47 @@ +# DefectCode + + + +## Enum + +* `PEE` (value: `'pee'`) + +* `JAM` (value: `'jam'`) + +* `LYH` (value: `'lyh'`) + +* `PIK` (value: `'pik'`) + +* `KAA` (value: `'kaa'`) + +* `MET` (value: `'met'`) + +* `MAD` (value: `'mad'`) + +* `KOV` (value: `'kov'`) + +* `OKS` (value: `'oks'`) + +* `RIK` (value: `'rik'`) + +* `YTO` (value: `'yto'`) + +* `SIN` (value: `'sin'`) + +* `PUT` (value: `'put'`) + +* `TAH` (value: `'tah'`) + +* `TYY` (value: `'tyy'`) + +* `MUU` (value: `'muu'`) + +* `VPL` (value: `'vpl'`) + +* `SYD` (value: `'syd'`) + +* `LOH` (value: `'loh'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/DeforestationBiomass.md b/pyevr/docs/DeforestationBiomass.md new file mode 100644 index 0000000..3c1bbf2 --- /dev/null +++ b/pyevr/docs/DeforestationBiomass.md @@ -0,0 +1,31 @@ +# DeforestationBiomass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cadaster** | **str** | Katastritunnus | +**contract_number** | **str** | Dokumendi number | [optional] +**contract_date** | **datetime** | Dokumendi kuupäev | [optional] + +## Example + +```python +from openapi_client.models.deforestation_biomass import DeforestationBiomass + +# TODO update the JSON string below +json = "{}" +# create an instance of DeforestationBiomass from a JSON string +deforestation_biomass_instance = DeforestationBiomass.from_json(json) +# print the JSON string representation of the object +print(DeforestationBiomass.to_json()) + +# convert the object into a dict +deforestation_biomass_dict = deforestation_biomass_instance.to_dict() +# create an instance of DeforestationBiomass from a dict +deforestation_biomass_from_dict = DeforestationBiomass.from_dict(deforestation_biomass_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/Entity.md b/pyevr/docs/Entity.md index bbcc239..2e643c5 100644 --- a/pyevr/docs/Entity.md +++ b/pyevr/docs/Entity.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Entity from a JSON string entity_instance = Entity.from_json(json) # print the JSON string representation of the object -print Entity.to_json() +print(Entity.to_json()) # convert the object into a dict entity_dict = entity_instance.to_dict() # create an instance of Entity from a dict -entity_form_dict = entity.from_dict(entity_dict) +entity_from_dict = Entity.from_dict(entity_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/EudrNumber.md b/pyevr/docs/EudrNumber.md new file mode 100644 index 0000000..8be17b2 --- /dev/null +++ b/pyevr/docs/EudrNumber.md @@ -0,0 +1,30 @@ +# EudrNumber + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reference_number** | **str** | Viitenumber | [optional] +**verification_number** | **str** | Kontroll number | [optional] + +## Example + +```python +from openapi_client.models.eudr_number import EudrNumber + +# TODO update the JSON string below +json = "{}" +# create an instance of EudrNumber from a JSON string +eudr_number_instance = EudrNumber.from_json(json) +# print the JSON string representation of the object +print(EudrNumber.to_json()) + +# convert the object into a dict +eudr_number_dict = eudr_number_instance.to_dict() +# create an instance of EudrNumber from a dict +eudr_number_from_dict = EudrNumber.from_dict(eudr_number_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/ForestAct.md b/pyevr/docs/ForestAct.md index 01f2923..7e7f129 100644 --- a/pyevr/docs/ForestAct.md +++ b/pyevr/docs/ForestAct.md @@ -2,10 +2,11 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**contract_number** | **str** | Dokumendi number | -**contract_date** | **datetime** | Dokumendi kuupäev | +**contract_number** | **str** | Dokumendi number | [optional] +**contract_date** | **datetime** | Dokumendi kuupäev | [optional] **cadaster** | **str** | Katastritunnus | **compartment** | **str** | Kvartal | [optional] **forest_allocation_number** | **str** | Metsaeraldis | [optional] @@ -20,12 +21,12 @@ json = "{}" # create an instance of ForestAct from a JSON string forest_act_instance = ForestAct.from_json(json) # print the JSON string representation of the object -print ForestAct.to_json() +print(ForestAct.to_json()) # convert the object into a dict forest_act_dict = forest_act_instance.to_dict() # create an instance of ForestAct from a dict -forest_act_form_dict = forest_act.from_dict(forest_act_dict) +forest_act_from_dict = ForestAct.from_dict(forest_act_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ForestNotice.md b/pyevr/docs/ForestNotice.md index e5aa408..fd45bc3 100644 --- a/pyevr/docs/ForestNotice.md +++ b/pyevr/docs/ForestNotice.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cadaster** | **str** | Katastritunnus | @@ -19,12 +20,12 @@ json = "{}" # create an instance of ForestNotice from a JSON string forest_notice_instance = ForestNotice.from_json(json) # print the JSON string representation of the object -print ForestNotice.to_json() +print(ForestNotice.to_json()) # convert the object into a dict forest_notice_dict = forest_notice_instance.to_dict() # create an instance of ForestNotice from a dict -forest_notice_form_dict = forest_notice.from_dict(forest_notice_dict) +forest_notice_from_dict = ForestNotice.from_dict(forest_notice_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/HoldingBase.md b/pyevr/docs/HoldingBase.md index 19cf017..8789d3f 100644 --- a/pyevr/docs/HoldingBase.md +++ b/pyevr/docs/HoldingBase.md @@ -2,8 +2,10 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**eudr_numbers** | [**List[EudrNumber]**](EudrNumber.md) | | [optional] **type** | **str** | | ## Example @@ -16,12 +18,12 @@ json = "{}" # create an instance of HoldingBase from a JSON string holding_base_instance = HoldingBase.from_json(json) # print the JSON string representation of the object -print HoldingBase.to_json() +print(HoldingBase.to_json()) # convert the object into a dict holding_base_dict = holding_base_instance.to_dict() # create an instance of HoldingBase from a dict -holding_base_form_dict = holding_base.from_dict(holding_base_dict) +holding_base_from_dict = HoldingBase.from_dict(holding_base_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/HoldingBaseType.md b/pyevr/docs/HoldingBaseType.md new file mode 100644 index 0000000..821a8db --- /dev/null +++ b/pyevr/docs/HoldingBaseType.md @@ -0,0 +1,33 @@ +# HoldingBaseType + + + +## Enum + +* `FORESTNOTICE` (value: `'forestNotice'`) + +* `INVENTORYACT` (value: `'inventoryAct'`) + +* `CONSOLIDATEDACT` (value: `'consolidatedAct'`) + +* `FORESTACT` (value: `'forestAct'`) + +* `SALESCONTRACT` (value: `'salesContract'`) + +* `CONTRACTFORTRANSFEROFCUTTINGRIGHTS` (value: `'contractForTransferOfCuttingRights'`) + +* `WITHOUTFORESTNOTICE` (value: `'withoutForestNotice'`) + +* `AGRICULTURALBIOMASS` (value: `'agriculturalBiomass'`) + +* `DEFORESTATIONBIOMASS` (value: `'deforestationBiomass'`) + +* `NONFORESTWOODBIOMASS` (value: `'nonForestWoodBiomass'`) + +* `SECONDARYWASTEWOOD` (value: `'secondaryWasteWood'`) + +* `SECONDARYWOODBIOMASS` (value: `'secondaryWoodBiomass'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/InventoryAct.md b/pyevr/docs/InventoryAct.md index 1bbef80..cb346c3 100644 --- a/pyevr/docs/InventoryAct.md +++ b/pyevr/docs/InventoryAct.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contract_number** | **str** | Dokumendi number | @@ -9,6 +10,7 @@ Name | Type | Description | Notes **cadaster** | **str** | Katastritunnus | **compartment** | **str** | Kvartal | [optional] **forest_allocation_number** | **str** | Metsaeraldis | [optional] +**forest_notice_number** | **str** | Metsateatise number | [optional] ## Example @@ -20,12 +22,12 @@ json = "{}" # create an instance of InventoryAct from a JSON string inventory_act_instance = InventoryAct.from_json(json) # print the JSON string representation of the object -print InventoryAct.to_json() +print(InventoryAct.to_json()) # convert the object into a dict inventory_act_dict = inventory_act_instance.to_dict() # create an instance of InventoryAct from a dict -inventory_act_form_dict = inventory_act.from_dict(inventory_act_dict) +inventory_act_from_dict = InventoryAct.from_dict(inventory_act_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Measurement.md b/pyevr/docs/Measurement.md new file mode 100644 index 0000000..94e3e78 --- /dev/null +++ b/pyevr/docs/Measurement.md @@ -0,0 +1,35 @@ +# Measurement + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | Kogus | +**pack** | [**Pack**](Pack.md) | | [optional] +**unit_code** | **str** | [Mõõtühiku kood](#operation/MeasurementUnits_List) | +**assortment** | [**ShipmentAssortment**](ShipmentAssortment.md) | | +**moisture_percentage** | **float** | Niiskuse protsent | [optional] +**energy_mwh** | **float** | Mõõdetud energia megavatt-tunnis | [optional] +**measurement_report_url** | **str** | Mõõtmisandmete raporti link | [optional] + +## Example + +```python +from openapi_client.models.measurement import Measurement + +# TODO update the JSON string below +json = "{}" +# create an instance of Measurement from a JSON string +measurement_instance = Measurement.from_json(json) +# print the JSON string representation of the object +print(Measurement.to_json()) + +# convert the object into a dict +measurement_dict = measurement_instance.to_dict() +# create an instance of Measurement from a dict +measurement_from_dict = Measurement.from_dict(measurement_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/MeasurementAct.md b/pyevr/docs/MeasurementAct.md index 3c4714a..555b717 100644 --- a/pyevr/docs/MeasurementAct.md +++ b/pyevr/docs/MeasurementAct.md @@ -2,11 +2,12 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **act_number** | **str** | Mõõtmisakti number | [optional] **act_date** | **datetime** | Mõõtmisakti kuupäev | [optional] -**measurements** | [**List[ShipmentItem]**](ShipmentItem.md) | Mõõtmistulemused EVR poolt sätestatud formaadis | [optional] +**measurements** | [**List[Measurement]**](Measurement.md) | Mõõtmistulemused EVR poolt sätestatud formaadis | [optional] **custom_measurement_data** | **object** | Mõõtmistulemused vabas formaadis | [optional] **measurer_code** | **str** | Mõõtja registri kood | [optional] **creation_time** | **datetime** | Lisamise aeg | [optional] @@ -22,12 +23,12 @@ json = "{}" # create an instance of MeasurementAct from a JSON string measurement_act_instance = MeasurementAct.from_json(json) # print the JSON string representation of the object -print MeasurementAct.to_json() +print(MeasurementAct.to_json()) # convert the object into a dict measurement_act_dict = measurement_act_instance.to_dict() # create an instance of MeasurementAct from a dict -measurement_act_form_dict = measurement_act.from_dict(measurement_act_dict) +measurement_act_from_dict = MeasurementAct.from_dict(measurement_act_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/MeasurementUnit.md b/pyevr/docs/MeasurementUnit.md index 20f724f..f61f758 100644 --- a/pyevr/docs/MeasurementUnit.md +++ b/pyevr/docs/MeasurementUnit.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | Mõõtühiku kood | [optional] @@ -17,12 +18,12 @@ json = "{}" # create an instance of MeasurementUnit from a JSON string measurement_unit_instance = MeasurementUnit.from_json(json) # print the JSON string representation of the object -print MeasurementUnit.to_json() +print(MeasurementUnit.to_json()) # convert the object into a dict measurement_unit_dict = measurement_unit_instance.to_dict() # create an instance of MeasurementUnit from a dict -measurement_unit_form_dict = measurement_unit.from_dict(measurement_unit_dict) +measurement_unit_from_dict = MeasurementUnit.from_dict(measurement_unit_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/MeasurementUnitsApi.md b/pyevr/docs/MeasurementUnitsApi.md index 7e0d250..2162122 100644 --- a/pyevr/docs/MeasurementUnitsApi.md +++ b/pyevr/docs/MeasurementUnitsApi.md @@ -17,9 +17,8 @@ Tagastab EVR-i aktiivsed mõõtühikud. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.paged_result_of_measurement_unit import PagedResultOfMeasurementUnit from openapi_client.rest import ApiException @@ -63,6 +62,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **page** | **int**| Tagastatav lehekülg | [optional] @@ -83,6 +83,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **403** | | - | diff --git a/pyevr/docs/MeasurementsApi.md b/pyevr/docs/MeasurementsApi.md index cac1279..63d2859 100644 --- a/pyevr/docs/MeasurementsApi.md +++ b/pyevr/docs/MeasurementsApi.md @@ -18,9 +18,8 @@ Tagastab veoselehega seotud mõõtmisandmed. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.paged_result_of_measurement_act import PagedResultOfMeasurementAct from openapi_client.rest import ApiException @@ -64,6 +63,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Veoselehe number (tõstutundetu) | @@ -84,6 +84,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **404** | | - | @@ -99,14 +100,13 @@ Name | Type | Description | Notes Veoselehele mõõtmisandmete lisamine -Lisab veoselehele mõõtmisandmed. Mõõtmisandmeid saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. Mõõtmistulemusi on võimalik lisada koormapakkidena või lihtsalt sortimentide kogustena. +Lisab veoselehele mõõtmisandmed. Mõõtmisandmeid saab lisada "koorem maas" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. Mõõtmistulemusi on võimalik lisada koormapakkidena või lihtsalt sortimentide kogustena. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.add_measurement_act_request import AddMeasurementActRequest from openapi_client.rest import ApiException @@ -148,6 +148,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Veoselehe number (tõstutundetu) | @@ -168,6 +169,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **404** | | - | diff --git a/pyevr/docs/NonForestWoodBiomass.md b/pyevr/docs/NonForestWoodBiomass.md new file mode 100644 index 0000000..436f3af --- /dev/null +++ b/pyevr/docs/NonForestWoodBiomass.md @@ -0,0 +1,32 @@ +# NonForestWoodBiomass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cadaster** | **str** | Katastritunnus | +**contract_number** | **str** | Dokumendi number | [optional] +**contract_date** | **datetime** | Dokumendi kuupäev | [optional] +**previous_owner** | [**PreviousOwner**](PreviousOwner.md) | | [optional] + +## Example + +```python +from openapi_client.models.non_forest_wood_biomass import NonForestWoodBiomass + +# TODO update the JSON string below +json = "{}" +# create an instance of NonForestWoodBiomass from a JSON string +non_forest_wood_biomass_instance = NonForestWoodBiomass.from_json(json) +# print the JSON string representation of the object +print(NonForestWoodBiomass.to_json()) + +# convert the object into a dict +non_forest_wood_biomass_dict = non_forest_wood_biomass_instance.to_dict() +# create an instance of NonForestWoodBiomass from a dict +non_forest_wood_biomass_from_dict = NonForestWoodBiomass.from_dict(non_forest_wood_biomass_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/Organization.md b/pyevr/docs/Organization.md index 059a00f..f1841bd 100644 --- a/pyevr/docs/Organization.md +++ b/pyevr/docs/Organization.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Asutuse nimi | [optional] @@ -22,12 +23,12 @@ json = "{}" # create an instance of Organization from a JSON string organization_instance = Organization.from_json(json) # print the JSON string representation of the object -print Organization.to_json() +print(Organization.to_json()) # convert the object into a dict organization_dict = organization_instance.to_dict() # create an instance of Organization from a dict -organization_form_dict = organization.from_dict(organization_dict) +organization_from_dict = Organization.from_dict(organization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/OrganizationsApi.md b/pyevr/docs/OrganizationsApi.md index 01b40bb..8ac99d8 100644 --- a/pyevr/docs/OrganizationsApi.md +++ b/pyevr/docs/OrganizationsApi.md @@ -18,9 +18,8 @@ Tagastab EVR-i aktiivsed asutused. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.paged_result_of_organization import PagedResultOfOrganization from openapi_client.rest import ApiException @@ -66,6 +65,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code_starts_with** | **str**| Filtreerib asutused, mille registrikood algab otsinguterminiga | [optional] @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **403** | | - | @@ -107,9 +108,8 @@ Tagastab asutuse andmed ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.organization import Organization from openapi_client.rest import ApiException @@ -151,6 +151,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **evr_language** | **str**| Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). | [optional] @@ -169,6 +170,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **403** | | - | diff --git a/pyevr/docs/Owner.md b/pyevr/docs/Owner.md index 457bcd9..a3b6f77 100644 --- a/pyevr/docs/Owner.md +++ b/pyevr/docs/Owner.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -21,12 +22,12 @@ json = "{}" # create an instance of Owner from a JSON string owner_instance = Owner.from_json(json) # print the JSON string representation of the object -print Owner.to_json() +print(Owner.to_json()) # convert the object into a dict owner_dict = owner_instance.to_dict() # create an instance of Owner from a dict -owner_form_dict = owner.from_dict(owner_dict) +owner_from_dict = Owner.from_dict(owner_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Pack.md b/pyevr/docs/Pack.md index 2f34570..11661bf 100644 --- a/pyevr/docs/Pack.md +++ b/pyevr/docs/Pack.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **pack_number** | **int** | Paki number | @@ -21,12 +22,12 @@ json = "{}" # create an instance of Pack from a JSON string pack_instance = Pack.from_json(json) # print the JSON string representation of the object -print Pack.to_json() +print(Pack.to_json()) # convert the object into a dict pack_dict = pack_instance.to_dict() # create an instance of Pack from a dict -pack_form_dict = pack.from_dict(pack_dict) +pack_from_dict = Pack.from_dict(pack_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PackLocation.md b/pyevr/docs/PackLocation.md index a92cf7e..15f28d9 100644 --- a/pyevr/docs/PackLocation.md +++ b/pyevr/docs/PackLocation.md @@ -2,9 +2,11 @@ -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `VAN` (value: `'van'`) + +* `TRAILER` (value: `'trailer'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PagedResultOfAssortment.md b/pyevr/docs/PagedResultOfAssortment.md index 09ee87f..9e76e13 100644 --- a/pyevr/docs/PagedResultOfAssortment.md +++ b/pyevr/docs/PagedResultOfAssortment.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page_number** | **int** | Lehekülje number | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PagedResultOfAssortment from a JSON string paged_result_of_assortment_instance = PagedResultOfAssortment.from_json(json) # print the JSON string representation of the object -print PagedResultOfAssortment.to_json() +print(PagedResultOfAssortment.to_json()) # convert the object into a dict paged_result_of_assortment_dict = paged_result_of_assortment_instance.to_dict() # create an instance of PagedResultOfAssortment from a dict -paged_result_of_assortment_form_dict = paged_result_of_assortment.from_dict(paged_result_of_assortment_dict) +paged_result_of_assortment_from_dict = PagedResultOfAssortment.from_dict(paged_result_of_assortment_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PagedResultOfCertificate.md b/pyevr/docs/PagedResultOfCertificate.md index 6e996ec..d6aff6f 100644 --- a/pyevr/docs/PagedResultOfCertificate.md +++ b/pyevr/docs/PagedResultOfCertificate.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page_number** | **int** | Lehekülje number | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PagedResultOfCertificate from a JSON string paged_result_of_certificate_instance = PagedResultOfCertificate.from_json(json) # print the JSON string representation of the object -print PagedResultOfCertificate.to_json() +print(PagedResultOfCertificate.to_json()) # convert the object into a dict paged_result_of_certificate_dict = paged_result_of_certificate_instance.to_dict() # create an instance of PagedResultOfCertificate from a dict -paged_result_of_certificate_form_dict = paged_result_of_certificate.from_dict(paged_result_of_certificate_dict) +paged_result_of_certificate_from_dict = PagedResultOfCertificate.from_dict(paged_result_of_certificate_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PagedResultOfMeasurementAct.md b/pyevr/docs/PagedResultOfMeasurementAct.md index 7bc94ae..1bf2060 100644 --- a/pyevr/docs/PagedResultOfMeasurementAct.md +++ b/pyevr/docs/PagedResultOfMeasurementAct.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page_number** | **int** | Lehekülje number | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PagedResultOfMeasurementAct from a JSON string paged_result_of_measurement_act_instance = PagedResultOfMeasurementAct.from_json(json) # print the JSON string representation of the object -print PagedResultOfMeasurementAct.to_json() +print(PagedResultOfMeasurementAct.to_json()) # convert the object into a dict paged_result_of_measurement_act_dict = paged_result_of_measurement_act_instance.to_dict() # create an instance of PagedResultOfMeasurementAct from a dict -paged_result_of_measurement_act_form_dict = paged_result_of_measurement_act.from_dict(paged_result_of_measurement_act_dict) +paged_result_of_measurement_act_from_dict = PagedResultOfMeasurementAct.from_dict(paged_result_of_measurement_act_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PagedResultOfMeasurementUnit.md b/pyevr/docs/PagedResultOfMeasurementUnit.md index 4266d86..0f0eca6 100644 --- a/pyevr/docs/PagedResultOfMeasurementUnit.md +++ b/pyevr/docs/PagedResultOfMeasurementUnit.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page_number** | **int** | Lehekülje number | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PagedResultOfMeasurementUnit from a JSON string paged_result_of_measurement_unit_instance = PagedResultOfMeasurementUnit.from_json(json) # print the JSON string representation of the object -print PagedResultOfMeasurementUnit.to_json() +print(PagedResultOfMeasurementUnit.to_json()) # convert the object into a dict paged_result_of_measurement_unit_dict = paged_result_of_measurement_unit_instance.to_dict() # create an instance of PagedResultOfMeasurementUnit from a dict -paged_result_of_measurement_unit_form_dict = paged_result_of_measurement_unit.from_dict(paged_result_of_measurement_unit_dict) +paged_result_of_measurement_unit_from_dict = PagedResultOfMeasurementUnit.from_dict(paged_result_of_measurement_unit_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PagedResultOfOrganization.md b/pyevr/docs/PagedResultOfOrganization.md index 38c863c..8573e61 100644 --- a/pyevr/docs/PagedResultOfOrganization.md +++ b/pyevr/docs/PagedResultOfOrganization.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page_number** | **int** | Lehekülje number | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PagedResultOfOrganization from a JSON string paged_result_of_organization_instance = PagedResultOfOrganization.from_json(json) # print the JSON string representation of the object -print PagedResultOfOrganization.to_json() +print(PagedResultOfOrganization.to_json()) # convert the object into a dict paged_result_of_organization_dict = paged_result_of_organization_instance.to_dict() # create an instance of PagedResultOfOrganization from a dict -paged_result_of_organization_form_dict = paged_result_of_organization.from_dict(paged_result_of_organization_dict) +paged_result_of_organization_from_dict = PagedResultOfOrganization.from_dict(paged_result_of_organization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PagedResultOfPlaceOfDelivery.md b/pyevr/docs/PagedResultOfPlaceOfDelivery.md index 92558c8..78ca78d 100644 --- a/pyevr/docs/PagedResultOfPlaceOfDelivery.md +++ b/pyevr/docs/PagedResultOfPlaceOfDelivery.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page_number** | **int** | Lehekülje number | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PagedResultOfPlaceOfDelivery from a JSON string paged_result_of_place_of_delivery_instance = PagedResultOfPlaceOfDelivery.from_json(json) # print the JSON string representation of the object -print PagedResultOfPlaceOfDelivery.to_json() +print(PagedResultOfPlaceOfDelivery.to_json()) # convert the object into a dict paged_result_of_place_of_delivery_dict = paged_result_of_place_of_delivery_instance.to_dict() # create an instance of PagedResultOfPlaceOfDelivery from a dict -paged_result_of_place_of_delivery_form_dict = paged_result_of_place_of_delivery.from_dict(paged_result_of_place_of_delivery_dict) +paged_result_of_place_of_delivery_from_dict = PagedResultOfPlaceOfDelivery.from_dict(paged_result_of_place_of_delivery_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PagedResultOfWaybill.md b/pyevr/docs/PagedResultOfWaybill.md index c197678..c1fa11a 100644 --- a/pyevr/docs/PagedResultOfWaybill.md +++ b/pyevr/docs/PagedResultOfWaybill.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **page_number** | **int** | Lehekülje number | [optional] @@ -19,12 +20,12 @@ json = "{}" # create an instance of PagedResultOfWaybill from a JSON string paged_result_of_waybill_instance = PagedResultOfWaybill.from_json(json) # print the JSON string representation of the object -print PagedResultOfWaybill.to_json() +print(PagedResultOfWaybill.to_json()) # convert the object into a dict paged_result_of_waybill_dict = paged_result_of_waybill_instance.to_dict() # create an instance of PagedResultOfWaybill from a dict -paged_result_of_waybill_form_dict = paged_result_of_waybill.from_dict(paged_result_of_waybill_dict) +paged_result_of_waybill_from_dict = PagedResultOfWaybill.from_dict(paged_result_of_waybill_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PlaceOfDeliveriesApi.md b/pyevr/docs/PlaceOfDeliveriesApi.md index 664a4df..f3675bf 100644 --- a/pyevr/docs/PlaceOfDeliveriesApi.md +++ b/pyevr/docs/PlaceOfDeliveriesApi.md @@ -19,9 +19,8 @@ Lisab uue tarnekoha. Kui antud koodiga tarnekoht juba eksisteerib, siis muudab o ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.put_place_of_delivery_request import PutPlaceOfDeliveryRequest from openapi_client.rest import ApiException @@ -63,6 +62,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **str**| Kood | @@ -83,6 +83,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -102,9 +103,8 @@ Tagastab koodile vastava tarnekoha. Pärida saab ainult enda asutusele kuuluvat ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.place_of_delivery import PlaceOfDelivery from openapi_client.rest import ApiException @@ -147,6 +147,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **code** | **str**| Päritava tarnekoha kood (tõstutundlik) | @@ -166,6 +167,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -180,14 +182,13 @@ Name | Type | Description | Notes Tarnekohtade pärimine -Tagastab filtritele vastavad aktiivsed avalikud tarnekohad ja kõik ettevõttega seotud tarnekohad. +Tagastab filtritele vastavad aktiivsed tarnekohad ja kõik ettevõttega seotud tarnekohad. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.paged_result_of_place_of_delivery import PagedResultOfPlaceOfDelivery from openapi_client.rest import ApiException @@ -235,6 +236,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **name_contains** | **str**| Filtreerib tarnekohad, mille nimi sisaldab otsinguterminit | [optional] @@ -259,6 +261,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | diff --git a/pyevr/docs/PlaceOfDelivery.md b/pyevr/docs/PlaceOfDelivery.md index 1ae5371..8a6a309 100644 --- a/pyevr/docs/PlaceOfDelivery.md +++ b/pyevr/docs/PlaceOfDelivery.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Tarnekoha nimi | [optional] @@ -11,7 +12,6 @@ Name | Type | Description | Notes **near_address** | **str** | Lähiaadress | [optional] **coordinates** | [**Coordinates**](Coordinates.md) | | [optional] **open_times** | **List[str]** | Millal avatud | [optional] -**is_public** | **bool** | Kas on avalik | [optional] **is_active** | **bool** | Kas on aktiivne | [optional] **preferred_certificates** | **List[str]** | Eelistatud sertifikaadid | [optional] **contact_person** | [**ContactPerson**](ContactPerson.md) | | [optional] @@ -29,12 +29,12 @@ json = "{}" # create an instance of PlaceOfDelivery from a JSON string place_of_delivery_instance = PlaceOfDelivery.from_json(json) # print the JSON string representation of the object -print PlaceOfDelivery.to_json() +print(PlaceOfDelivery.to_json()) # convert the object into a dict place_of_delivery_dict = place_of_delivery_instance.to_dict() # create an instance of PlaceOfDelivery from a dict -place_of_delivery_form_dict = place_of_delivery.from_dict(place_of_delivery_dict) +place_of_delivery_from_dict = PlaceOfDelivery.from_dict(place_of_delivery_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PreviousOwner.md b/pyevr/docs/PreviousOwner.md index 5b3a3ee..875aeae 100644 --- a/pyevr/docs/PreviousOwner.md +++ b/pyevr/docs/PreviousOwner.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -18,12 +19,12 @@ json = "{}" # create an instance of PreviousOwner from a JSON string previous_owner_instance = PreviousOwner.from_json(json) # print the JSON string representation of the object -print PreviousOwner.to_json() +print(PreviousOwner.to_json()) # convert the object into a dict previous_owner_dict = previous_owner_instance.to_dict() # create an instance of PreviousOwner from a dict -previous_owner_form_dict = previous_owner.from_dict(previous_owner_dict) +previous_owner_from_dict = PreviousOwner.from_dict(previous_owner_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ProblemDetails.md b/pyevr/docs/ProblemDetails.md index c34965a..c21263e 100644 --- a/pyevr/docs/ProblemDetails.md +++ b/pyevr/docs/ProblemDetails.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | | [optional] @@ -21,12 +22,12 @@ json = "{}" # create an instance of ProblemDetails from a JSON string problem_details_instance = ProblemDetails.from_json(json) # print the JSON string representation of the object -print ProblemDetails.to_json() +print(ProblemDetails.to_json()) # convert the object into a dict problem_details_dict = problem_details_instance.to_dict() # create an instance of ProblemDetails from a dict -problem_details_form_dict = problem_details.from_dict(problem_details_dict) +problem_details_from_dict = ProblemDetails.from_dict(problem_details_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/PutPlaceOfDeliveryRequest.md b/pyevr/docs/PutPlaceOfDeliveryRequest.md index 3575f01..0c2418d 100644 --- a/pyevr/docs/PutPlaceOfDeliveryRequest.md +++ b/pyevr/docs/PutPlaceOfDeliveryRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -10,7 +11,6 @@ Name | Type | Description | Notes **coordinates** | [**Coordinates**](Coordinates.md) | | **description** | **str** | Märkused | [optional] **is_active** | **bool** | Kas on aktiivne | -**is_public** | **bool** | Kas on avalik (avalikke ladusid näevad ka teised asutused) | **preferred_certificates** | **List[str]** | Eelistatud sertifikaadid | [optional] **open_times** | **List[str]** | Millal avatud | [optional] **contact_person** | [**ContactPerson**](ContactPerson.md) | | [optional] @@ -27,12 +27,12 @@ json = "{}" # create an instance of PutPlaceOfDeliveryRequest from a JSON string put_place_of_delivery_request_instance = PutPlaceOfDeliveryRequest.from_json(json) # print the JSON string representation of the object -print PutPlaceOfDeliveryRequest.to_json() +print(PutPlaceOfDeliveryRequest.to_json()) # convert the object into a dict put_place_of_delivery_request_dict = put_place_of_delivery_request_instance.to_dict() # create an instance of PutPlaceOfDeliveryRequest from a dict -put_place_of_delivery_request_form_dict = put_place_of_delivery_request.from_dict(put_place_of_delivery_request_dict) +put_place_of_delivery_request_from_dict = PutPlaceOfDeliveryRequest.from_dict(put_place_of_delivery_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Receiver.md b/pyevr/docs/Receiver.md index af7d596..0a999ec 100644 --- a/pyevr/docs/Receiver.md +++ b/pyevr/docs/Receiver.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -19,12 +20,12 @@ json = "{}" # create an instance of Receiver from a JSON string receiver_instance = Receiver.from_json(json) # print the JSON string representation of the object -print Receiver.to_json() +print(Receiver.to_json()) # convert the object into a dict receiver_dict = receiver_instance.to_dict() # create an instance of Receiver from a dict -receiver_form_dict = receiver.from_dict(receiver_dict) +receiver_from_dict = Receiver.from_dict(receiver_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Representer.md b/pyevr/docs/Representer.md index 9f1fc67..b26edea 100644 --- a/pyevr/docs/Representer.md +++ b/pyevr/docs/Representer.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -21,12 +22,12 @@ json = "{}" # create an instance of Representer from a JSON string representer_instance = Representer.from_json(json) # print the JSON string representation of the object -print Representer.to_json() +print(Representer.to_json()) # convert the object into a dict representer_dict = representer_instance.to_dict() # create an instance of Representer from a dict -representer_form_dict = representer.from_dict(representer_dict) +representer_from_dict = Representer.from_dict(representer_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/SalesContract.md b/pyevr/docs/SalesContract.md index bec0d82..d826b2d 100644 --- a/pyevr/docs/SalesContract.md +++ b/pyevr/docs/SalesContract.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **contract_number** | **str** | Dokumendi number | @@ -9,6 +10,7 @@ Name | Type | Description | Notes **cadaster** | **str** | Katastritunnus | **compartment** | **str** | Kvartal | [optional] **forest_allocation_number** | **str** | Metsaeraldis | [optional] +**forest_notice_number** | **str** | Metsateatise number | [optional] **previous_owner** | [**PreviousOwner**](PreviousOwner.md) | | ## Example @@ -21,12 +23,12 @@ json = "{}" # create an instance of SalesContract from a JSON string sales_contract_instance = SalesContract.from_json(json) # print the JSON string representation of the object -print SalesContract.to_json() +print(SalesContract.to_json()) # convert the object into a dict sales_contract_dict = sales_contract_instance.to_dict() # create an instance of SalesContract from a dict -sales_contract_form_dict = sales_contract.from_dict(sales_contract_dict) +sales_contract_from_dict = SalesContract.from_dict(sales_contract_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/SecondaryWasteWood.md b/pyevr/docs/SecondaryWasteWood.md new file mode 100644 index 0000000..af52214 --- /dev/null +++ b/pyevr/docs/SecondaryWasteWood.md @@ -0,0 +1,32 @@ +# SecondaryWasteWood + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_number** | **str** | Dokumendi number | [optional] +**contract_date** | **datetime** | Dokumendi kuupäev | [optional] +**previous_owner** | [**PreviousOwner**](PreviousOwner.md) | | [optional] +**cadaster** | **str** | Katastritunnus | [optional] + +## Example + +```python +from openapi_client.models.secondary_waste_wood import SecondaryWasteWood + +# TODO update the JSON string below +json = "{}" +# create an instance of SecondaryWasteWood from a JSON string +secondary_waste_wood_instance = SecondaryWasteWood.from_json(json) +# print the JSON string representation of the object +print(SecondaryWasteWood.to_json()) + +# convert the object into a dict +secondary_waste_wood_dict = secondary_waste_wood_instance.to_dict() +# create an instance of SecondaryWasteWood from a dict +secondary_waste_wood_from_dict = SecondaryWasteWood.from_dict(secondary_waste_wood_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/SecondaryWoodBiomass.md b/pyevr/docs/SecondaryWoodBiomass.md new file mode 100644 index 0000000..b587a36 --- /dev/null +++ b/pyevr/docs/SecondaryWoodBiomass.md @@ -0,0 +1,32 @@ +# SecondaryWoodBiomass + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_number** | **str** | Dokumendi number | [optional] +**contract_date** | **datetime** | Dokumendi kuupäev | [optional] +**previous_owner** | [**PreviousOwner**](PreviousOwner.md) | | [optional] +**cadaster** | **str** | Katastritunnus | [optional] + +## Example + +```python +from openapi_client.models.secondary_wood_biomass import SecondaryWoodBiomass + +# TODO update the JSON string below +json = "{}" +# create an instance of SecondaryWoodBiomass from a JSON string +secondary_wood_biomass_instance = SecondaryWoodBiomass.from_json(json) +# print the JSON string representation of the object +print(SecondaryWoodBiomass.to_json()) + +# convert the object into a dict +secondary_wood_biomass_dict = secondary_wood_biomass_instance.to_dict() +# create an instance of SecondaryWoodBiomass from a dict +secondary_wood_biomass_from_dict = SecondaryWoodBiomass.from_dict(secondary_wood_biomass_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/Shipment.md b/pyevr/docs/Shipment.md index aa37891..1cff6e3 100644 --- a/pyevr/docs/Shipment.md +++ b/pyevr/docs/Shipment.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **holding_base** | [**HoldingBase**](HoldingBase.md) | | @@ -21,12 +22,12 @@ json = "{}" # create an instance of Shipment from a JSON string shipment_instance = Shipment.from_json(json) # print the JSON string representation of the object -print Shipment.to_json() +print(Shipment.to_json()) # convert the object into a dict shipment_dict = shipment_instance.to_dict() # create an instance of Shipment from a dict -shipment_form_dict = shipment.from_dict(shipment_dict) +shipment_from_dict = Shipment.from_dict(shipment_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ShipmentAssortment.md b/pyevr/docs/ShipmentAssortment.md index 94afc47..eb50be0 100644 --- a/pyevr/docs/ShipmentAssortment.md +++ b/pyevr/docs/ShipmentAssortment.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | Sortimendi kood. Kui organisatsioon on seadistatud kasutama EVR sortimente, peab kood olema [üks EVR sortimentide koodist.](#operation/Assortments_List) | @@ -18,12 +19,12 @@ json = "{}" # create an instance of ShipmentAssortment from a JSON string shipment_assortment_instance = ShipmentAssortment.from_json(json) # print the JSON string representation of the object -print ShipmentAssortment.to_json() +print(ShipmentAssortment.to_json()) # convert the object into a dict shipment_assortment_dict = shipment_assortment_instance.to_dict() # create an instance of ShipmentAssortment from a dict -shipment_assortment_form_dict = shipment_assortment.from_dict(shipment_assortment_dict) +shipment_assortment_from_dict = ShipmentAssortment.from_dict(shipment_assortment_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ShipmentItem.md b/pyevr/docs/ShipmentItem.md index 23ec3dc..88606ea 100644 --- a/pyevr/docs/ShipmentItem.md +++ b/pyevr/docs/ShipmentItem.md @@ -2,12 +2,14 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **amount** | **float** | Kogus | **pack** | [**Pack**](Pack.md) | | [optional] **unit_code** | **str** | [Mõõtühiku kood](#operation/MeasurementUnits_List) | **assortment** | [**ShipmentAssortment**](ShipmentAssortment.md) | | +**baltpool_quality** | [**BaltpoolQuality**](BaltpoolQuality.md) | | [optional] ## Example @@ -19,12 +21,12 @@ json = "{}" # create an instance of ShipmentItem from a JSON string shipment_item_instance = ShipmentItem.from_json(json) # print the JSON string representation of the object -print ShipmentItem.to_json() +print(ShipmentItem.to_json()) # convert the object into a dict shipment_item_dict = shipment_item_instance.to_dict() # create an instance of ShipmentItem from a dict -shipment_item_form_dict = shipment_item.from_dict(shipment_item_dict) +shipment_item_from_dict = ShipmentItem.from_dict(shipment_item_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ShipmentItemBase.md b/pyevr/docs/ShipmentItemBase.md new file mode 100644 index 0000000..1de5858 --- /dev/null +++ b/pyevr/docs/ShipmentItemBase.md @@ -0,0 +1,32 @@ +# ShipmentItemBase + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **float** | Kogus | +**pack** | [**Pack**](Pack.md) | | [optional] +**unit_code** | **str** | [Mõõtühiku kood](#operation/MeasurementUnits_List) | +**assortment** | [**ShipmentAssortment**](ShipmentAssortment.md) | | + +## Example + +```python +from openapi_client.models.shipment_item_base import ShipmentItemBase + +# TODO update the JSON string below +json = "{}" +# create an instance of ShipmentItemBase from a JSON string +shipment_item_base_instance = ShipmentItemBase.from_json(json) +# print the JSON string representation of the object +print(ShipmentItemBase.to_json()) + +# convert the object into a dict +shipment_item_base_dict = shipment_item_base_instance.to_dict() +# create an instance of ShipmentItemBase from a dict +shipment_item_base_from_dict = ShipmentItemBase.from_dict(shipment_item_base_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/Source.md b/pyevr/docs/Source.md index a5910b9..36e06a5 100644 --- a/pyevr/docs/Source.md +++ b/pyevr/docs/Source.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Maaüksuse või laoplatsi nimi | @@ -25,12 +26,12 @@ json = "{}" # create an instance of Source from a JSON string source_instance = Source.from_json(json) # print the JSON string representation of the object -print Source.to_json() +print(Source.to_json()) # convert the object into a dict source_dict = source_instance.to_dict() # create an instance of Source from a dict -source_form_dict = source.from_dict(source_dict) +source_from_dict = Source.from_dict(source_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/StartWaybillRequest.md b/pyevr/docs/StartWaybillRequest.md index ca68cac..c13b16f 100644 --- a/pyevr/docs/StartWaybillRequest.md +++ b/pyevr/docs/StartWaybillRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **owner** | [**Owner**](Owner.md) | | @@ -16,6 +17,7 @@ Name | Type | Description | Notes **user_custom_data** | **object** | Api kasutaja poolt kohandatavad andmed | [optional] **mass** | **float** | Autorongi mass tonnides | [optional] **transport_order** | **str** | Veotellimuse number | [optional] +**submission_coordinates** | [**Coordinates**](Coordinates.md) | | [optional] **viewers** | [**List[Viewer]**](Viewer.md) | Veoselehe vaatlejad | [optional] ## Example @@ -28,12 +30,12 @@ json = "{}" # create an instance of StartWaybillRequest from a JSON string start_waybill_request_instance = StartWaybillRequest.from_json(json) # print the JSON string representation of the object -print StartWaybillRequest.to_json() +print(StartWaybillRequest.to_json()) # convert the object into a dict start_waybill_request_dict = start_waybill_request_instance.to_dict() # create an instance of StartWaybillRequest from a dict -start_waybill_request_form_dict = start_waybill_request.from_dict(start_waybill_request_dict) +start_waybill_request_from_dict = StartWaybillRequest.from_dict(start_waybill_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Subcontractor.md b/pyevr/docs/Subcontractor.md new file mode 100644 index 0000000..60ac9a5 --- /dev/null +++ b/pyevr/docs/Subcontractor.md @@ -0,0 +1,31 @@ +# Subcontractor + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Nimi | +**code** | **str** | Isiku- või registrikood | +**contact_person** | [**ContactPerson**](ContactPerson.md) | | [optional] + +## Example + +```python +from openapi_client.models.subcontractor import Subcontractor + +# TODO update the JSON string below +json = "{}" +# create an instance of Subcontractor from a JSON string +subcontractor_instance = Subcontractor.from_json(json) +# print the JSON string representation of the object +print(Subcontractor.to_json()) + +# convert the object into a dict +subcontractor_dict = subcontractor_instance.to_dict() +# create an instance of Subcontractor from a dict +subcontractor_from_dict = Subcontractor.from_dict(subcontractor_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/TimberReport.md b/pyevr/docs/TimberReport.md new file mode 100644 index 0000000..12e335b --- /dev/null +++ b/pyevr/docs/TimberReport.md @@ -0,0 +1,31 @@ +# TimberReport + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report_number** | **str** | Mõõtmisraporti number | [optional] +**items** | [**List[TimberReportItem]**](TimberReportItem.md) | Palgi mõõtmisraporti andmed | +**report_date** | **datetime** | Palgi mõõtmisraporti aeg | [optional] + +## Example + +```python +from openapi_client.models.timber_report import TimberReport + +# TODO update the JSON string below +json = "{}" +# create an instance of TimberReport from a JSON string +timber_report_instance = TimberReport.from_json(json) +# print the JSON string representation of the object +print(TimberReport.to_json()) + +# convert the object into a dict +timber_report_dict = timber_report_instance.to_dict() +# create an instance of TimberReport from a dict +timber_report_from_dict = TimberReport.from_dict(timber_report_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/TimberReportItem.md b/pyevr/docs/TimberReportItem.md new file mode 100644 index 0000000..9d42d98 --- /dev/null +++ b/pyevr/docs/TimberReportItem.md @@ -0,0 +1,44 @@ +# TimberReportItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**wood_type** | [**WoodType**](WoodType.md) | | +**log_amount** | **float** | Palkide arv (tk) | +**wood_quality** | [**WoodQuality**](WoodQuality.md) | | +**defect_code** | [**DefectCode**](DefectCode.md) | | [optional] +**buyer_product_code** | **str** | Ostja kaubakood | [optional] +**price_group_key** | **str** | Hinnagrupi võti | +**tree_top_diameter_with_bark** | **float** | Ladva diameeter koorega - mm | [optional] +**tree_top_diameter_without_bark** | **float** | Ladva diameeter kooreta - mm | +**snag_diameter** | **float** | Tüüka diameeter - cm | [optional] +**estimated_diameter** | **float** | Arvestuslik diameeter – cm | +**actual_diameter** | **int** | Tegelik mõõdetud pikkus – täissentimeetrites | +**payable_length** | **int** | Arvestuspikkus – täisdetsimeeter | +**price** | **float** | Hind | [optional] +**actual_volume** | **float** | Tegelik maht | [optional] +**payable_volume** | **float** | Arvestusmaht | +**measurer_name** | **str** | Mõõtja nimi | [optional] + +## Example + +```python +from openapi_client.models.timber_report_item import TimberReportItem + +# TODO update the JSON string below +json = "{}" +# create an instance of TimberReportItem from a JSON string +timber_report_item_instance = TimberReportItem.from_json(json) +# print the JSON string representation of the object +print(TimberReportItem.to_json()) + +# convert the object into a dict +timber_report_item_dict = timber_report_item_instance.to_dict() +# create an instance of TimberReportItem from a dict +timber_report_item_from_dict = TimberReportItem.from_dict(timber_report_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/TimberReportsApi.md b/pyevr/docs/TimberReportsApi.md new file mode 100644 index 0000000..f5cab90 --- /dev/null +++ b/pyevr/docs/TimberReportsApi.md @@ -0,0 +1,178 @@ +# openapi_client.TimberReportsApi + +All URIs are relative to *https://evr.veoseleht.ee* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**timber_reports_get_timber_report**](TimberReportsApi.md#timber_reports_get_timber_report) | **GET** /api/waybills/{waybillNumber}/timberreports | Veoselehe palkide mõõtmisraporti pärimine +[**timber_reports_upsert_timber_report**](TimberReportsApi.md#timber_reports_upsert_timber_report) | **PUT** /api/waybills/{waybillNumber}/timberreports | Veoselehele palgi mõõtmisraporti lisamine + + +# **timber_reports_get_timber_report** +> TimberReport timber_reports_get_timber_report(waybill_number, evr_language=evr_language) + +Veoselehe palkide mõõtmisraporti pärimine + +### Example + +* Api Key Authentication (SecretApiKey): + +```python +import openapi_client +from openapi_client.models.timber_report import TimberReport +from openapi_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://evr.veoseleht.ee +# See configuration.py for a list of all supported configuration parameters. +configuration = openapi_client.Configuration( + host = "https://evr.veoseleht.ee" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: SecretApiKey +configuration.api_key['SecretApiKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['SecretApiKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.TimberReportsApi(api_client) + waybill_number = 'waybill_number_example' # str | Veoselehe number (tõstutundetu) + evr_language = 'evr_language_example' # str | Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). (optional) + + try: + # Veoselehe palkide mõõtmisraporti pärimine + api_response = api_instance.timber_reports_get_timber_report(waybill_number, evr_language=evr_language) + print("The response of TimberReportsApi->timber_reports_get_timber_report:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimberReportsApi->timber_reports_get_timber_report: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waybill_number** | **str**| Veoselehe number (tõstutundetu) | + **evr_language** | **str**| Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). | [optional] + +### Return type + +[**TimberReport**](TimberReport.md) + +### Authorization + +[SecretApiKey](../README.md#SecretApiKey) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**403** | | - | +**404** | | - | +**200** | Tagastab numbrile vastava veoselehe palkide mõõtmisraporti. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **timber_reports_upsert_timber_report** +> TimberReport timber_reports_upsert_timber_report(waybill_number, add_timber_report_request, evr_language=evr_language) + +Veoselehele palgi mõõtmisraporti lisamine + +Lisab veoselehele palgi mõõtmisraporti. Mõõtmisraporti saab lisada "koorem maas" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. + +### Example + +* Api Key Authentication (SecretApiKey): + +```python +import openapi_client +from openapi_client.models.add_timber_report_request import AddTimberReportRequest +from openapi_client.models.timber_report import TimberReport +from openapi_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://evr.veoseleht.ee +# See configuration.py for a list of all supported configuration parameters. +configuration = openapi_client.Configuration( + host = "https://evr.veoseleht.ee" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: SecretApiKey +configuration.api_key['SecretApiKey'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['SecretApiKey'] = 'Bearer' + +# Enter a context with an instance of the API client +with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.TimberReportsApi(api_client) + waybill_number = 'waybill_number_example' # str | Veoselehe number (tõstutundetu) + add_timber_report_request = openapi_client.AddTimberReportRequest() # AddTimberReportRequest | Palkide mõõtmisraporti andmed + evr_language = 'evr_language_example' # str | Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). (optional) + + try: + # Veoselehele palgi mõõtmisraporti lisamine + api_response = api_instance.timber_reports_upsert_timber_report(waybill_number, add_timber_report_request, evr_language=evr_language) + print("The response of TimberReportsApi->timber_reports_upsert_timber_report:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling TimberReportsApi->timber_reports_upsert_timber_report: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **waybill_number** | **str**| Veoselehe number (tõstutundetu) | + **add_timber_report_request** | [**AddTimberReportRequest**](AddTimberReportRequest.md)| Palkide mõõtmisraporti andmed | + **evr_language** | **str**| Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). | [optional] + +### Return type + +[**TimberReport**](TimberReport.md) + +### Authorization + +[SecretApiKey](../README.md#SecretApiKey) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | | - | +**400** | | - | +**403** | | - | +**404** | | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/pyevr/docs/Total.md b/pyevr/docs/Total.md index 7bcf491..f96e999 100644 --- a/pyevr/docs/Total.md +++ b/pyevr/docs/Total.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **amount** | **float** | Mõõdetud kogus | @@ -17,12 +18,12 @@ json = "{}" # create an instance of Total from a JSON string total_instance = Total.from_json(json) # print the JSON string representation of the object -print Total.to_json() +print(Total.to_json()) # convert the object into a dict total_dict = total_instance.to_dict() # create an instance of Total from a dict -total_form_dict = total.from_dict(total_dict) +total_from_dict = Total.from_dict(total_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Transport.md b/pyevr/docs/Transport.md index 04c9a72..de96857 100644 --- a/pyevr/docs/Transport.md +++ b/pyevr/docs/Transport.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **transporter** | [**Transporter**](Transporter.md) | | @@ -10,6 +11,7 @@ Name | Type | Description | Notes **driver_phone** | **str** | Autojuhi telefoninumber | [optional] **van_registration_number** | **str** | Veoki riiklik registreerimisnumber | **trailer_registration_number** | **str** | Haagise kasutamise korral haagise riiklik registreerimisnumber | [optional] +**subcontractor** | [**Subcontractor**](Subcontractor.md) | | [optional] ## Example @@ -21,12 +23,12 @@ json = "{}" # create an instance of Transport from a JSON string transport_instance = Transport.from_json(json) # print the JSON string representation of the object -print Transport.to_json() +print(Transport.to_json()) # convert the object into a dict transport_dict = transport_instance.to_dict() # create an instance of Transport from a dict -transport_form_dict = transport.from_dict(transport_dict) +transport_from_dict = Transport.from_dict(transport_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Transporter.md b/pyevr/docs/Transporter.md index 3f30636..a700b87 100644 --- a/pyevr/docs/Transporter.md +++ b/pyevr/docs/Transporter.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -18,12 +19,12 @@ json = "{}" # create an instance of Transporter from a JSON string transporter_instance = Transporter.from_json(json) # print the JSON string representation of the object -print Transporter.to_json() +print(Transporter.to_json()) # convert the object into a dict transporter_dict = transporter_instance.to_dict() # create an instance of Transporter from a dict -transporter_form_dict = transporter.from_dict(transporter_dict) +transporter_from_dict = Transporter.from_dict(transporter_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/UnloadWaybillRequest.md b/pyevr/docs/UnloadWaybillRequest.md index 8a28bf8..49e18aa 100644 --- a/pyevr/docs/UnloadWaybillRequest.md +++ b/pyevr/docs/UnloadWaybillRequest.md @@ -2,10 +2,12 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **total_journey_mileage** | **int** | Kilometraaž koormaga | **comment** | **str** | Kommentaar | [optional] +**coordinates** | [**Coordinates**](Coordinates.md) | | [optional] ## Example @@ -17,12 +19,12 @@ json = "{}" # create an instance of UnloadWaybillRequest from a JSON string unload_waybill_request_instance = UnloadWaybillRequest.from_json(json) # print the JSON string representation of the object -print UnloadWaybillRequest.to_json() +print(UnloadWaybillRequest.to_json()) # convert the object into a dict unload_waybill_request_dict = unload_waybill_request_instance.to_dict() # create an instance of UnloadWaybillRequest from a dict -unload_waybill_request_form_dict = unload_waybill_request.from_dict(unload_waybill_request_dict) +unload_waybill_request_from_dict = UnloadWaybillRequest.from_dict(unload_waybill_request_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/ValidationResult.md b/pyevr/docs/ValidationResult.md index 4cb7be5..e55a72c 100644 --- a/pyevr/docs/ValidationResult.md +++ b/pyevr/docs/ValidationResult.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **errors** | **Dict[str, List[str]]** | | [optional] @@ -16,12 +17,12 @@ json = "{}" # create an instance of ValidationResult from a JSON string validation_result_instance = ValidationResult.from_json(json) # print the JSON string representation of the object -print ValidationResult.to_json() +print(ValidationResult.to_json()) # convert the object into a dict validation_result_dict = validation_result_instance.to_dict() # create an instance of ValidationResult from a dict -validation_result_form_dict = validation_result.from_dict(validation_result_dict) +validation_result_from_dict = ValidationResult.from_dict(validation_result_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Viewer.md b/pyevr/docs/Viewer.md index 2a4a358..b56b993 100644 --- a/pyevr/docs/Viewer.md +++ b/pyevr/docs/Viewer.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | Registrikood | @@ -16,12 +17,12 @@ json = "{}" # create an instance of Viewer from a JSON string viewer_instance = Viewer.from_json(json) # print the JSON string representation of the object -print Viewer.to_json() +print(Viewer.to_json()) # convert the object into a dict viewer_dict = viewer_instance.to_dict() # create an instance of Viewer from a dict -viewer_form_dict = viewer.from_dict(viewer_dict) +viewer_from_dict = Viewer.from_dict(viewer_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/Waybill.md b/pyevr/docs/Waybill.md index 2f8564d..77398d9 100644 --- a/pyevr/docs/Waybill.md +++ b/pyevr/docs/Waybill.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **owner** | [**Owner**](Owner.md) | | @@ -16,19 +17,23 @@ Name | Type | Description | Notes **user_custom_data** | **object** | Api kasutaja poolt kohandatavad andmed | [optional] **mass** | **float** | Autorongi mass tonnides | [optional] **transport_order** | **str** | Veotellimuse number | [optional] +**submission_coordinates** | [**Coordinates**](Coordinates.md) | | [optional] **number** | **str** | Veoselehe number | [optional] **status** | [**WaybillStatus**](WaybillStatus.md) | | [optional] **creation_time** | **datetime** | Loomise aeg | [optional] **cancellation_time** | **datetime** | Tühistamise aeg (kui veoseleht on tühistatud) | [optional] **cancellation_reason** | **str** | Tühistamise põhjus (kui veoseleht on tühistatud) | [optional] +**cancellation_coordinates** | [**Coordinates**](Coordinates.md) | | [optional] **total_journey_mileage** | **int** | Kilometraaž koormaga (kui veoselehel on vedu lõpetatud) | [optional] **unloading_comment** | **str** | Mahalaadimise kommentaar (kui veoselehel on vedu lõpetatud) | [optional] **unloading_time** | **datetime** | Mahalaadimise aeg (kui veoselehel on vedu lõpetatud) | [optional] +**unloading_coordinates** | [**Coordinates**](Coordinates.md) | | [optional] **finishing_time** | **datetime** | Veoselehe lõpetamise aeg (kui veoseleht on lõpetatud) | [optional] **last_modification_time** | **datetime** | Veoselehe viimase muutmise aeg | [optional] **notes** | [**List[WaybillNote]**](WaybillNote.md) | Veoselehe märkused | [optional] **waybill_authorizations** | [**List[WaybillAuthorization]**](WaybillAuthorization.md) | Veoselehe volitused | [optional] **waybill_latest_measurements** | [**MeasurementAct**](MeasurementAct.md) | | [optional] +**timber_report** | [**TimberReport**](TimberReport.md) | | [optional] ## Example @@ -40,12 +45,12 @@ json = "{}" # create an instance of Waybill from a JSON string waybill_instance = Waybill.from_json(json) # print the JSON string representation of the object -print Waybill.to_json() +print(Waybill.to_json()) # convert the object into a dict waybill_dict = waybill_instance.to_dict() # create an instance of Waybill from a dict -waybill_form_dict = waybill.from_dict(waybill_dict) +waybill_from_dict = Waybill.from_dict(waybill_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WaybillAuthorization.md b/pyevr/docs/WaybillAuthorization.md index 1d4341f..51b6e03 100644 --- a/pyevr/docs/WaybillAuthorization.md +++ b/pyevr/docs/WaybillAuthorization.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | Registrikood | @@ -17,12 +18,12 @@ json = "{}" # create an instance of WaybillAuthorization from a JSON string waybill_authorization_instance = WaybillAuthorization.from_json(json) # print the JSON string representation of the object -print WaybillAuthorization.to_json() +print(WaybillAuthorization.to_json()) # convert the object into a dict waybill_authorization_dict = waybill_authorization_instance.to_dict() # create an instance of WaybillAuthorization from a dict -waybill_authorization_form_dict = waybill_authorization.from_dict(waybill_authorization_dict) +waybill_authorization_from_dict = WaybillAuthorization.from_dict(waybill_authorization_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WaybillNote.md b/pyevr/docs/WaybillNote.md index c50609a..17881a8 100644 --- a/pyevr/docs/WaybillNote.md +++ b/pyevr/docs/WaybillNote.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **creator** | [**WaybillNoteCreator**](WaybillNoteCreator.md) | | [optional] @@ -18,12 +19,12 @@ json = "{}" # create an instance of WaybillNote from a JSON string waybill_note_instance = WaybillNote.from_json(json) # print the JSON string representation of the object -print WaybillNote.to_json() +print(WaybillNote.to_json()) # convert the object into a dict waybill_note_dict = waybill_note_instance.to_dict() # create an instance of WaybillNote from a dict -waybill_note_form_dict = waybill_note.from_dict(waybill_note_dict) +waybill_note_from_dict = WaybillNote.from_dict(waybill_note_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WaybillNoteCreator.md b/pyevr/docs/WaybillNoteCreator.md index 0e8c316..cbc99fa 100644 --- a/pyevr/docs/WaybillNoteCreator.md +++ b/pyevr/docs/WaybillNoteCreator.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Nimi | @@ -17,12 +18,12 @@ json = "{}" # create an instance of WaybillNoteCreator from a JSON string waybill_note_creator_instance = WaybillNoteCreator.from_json(json) # print the JSON string representation of the object -print WaybillNoteCreator.to_json() +print(WaybillNoteCreator.to_json()) # convert the object into a dict waybill_note_creator_dict = waybill_note_creator_instance.to_dict() # create an instance of WaybillNoteCreator from a dict -waybill_note_creator_form_dict = waybill_note_creator.from_dict(waybill_note_creator_dict) +waybill_note_creator_from_dict = WaybillNoteCreator.from_dict(waybill_note_creator_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WaybillPlaceOfDelivery.md b/pyevr/docs/WaybillPlaceOfDelivery.md index a86246e..215ddf8 100644 --- a/pyevr/docs/WaybillPlaceOfDelivery.md +++ b/pyevr/docs/WaybillPlaceOfDelivery.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **str** | EVR tarnekoha kood (kui on EVR-i lisatud tarnekoht) | [optional] @@ -22,12 +23,12 @@ json = "{}" # create an instance of WaybillPlaceOfDelivery from a JSON string waybill_place_of_delivery_instance = WaybillPlaceOfDelivery.from_json(json) # print the JSON string representation of the object -print WaybillPlaceOfDelivery.to_json() +print(WaybillPlaceOfDelivery.to_json()) # convert the object into a dict waybill_place_of_delivery_dict = waybill_place_of_delivery_instance.to_dict() # create an instance of WaybillPlaceOfDelivery from a dict -waybill_place_of_delivery_form_dict = waybill_place_of_delivery.from_dict(waybill_place_of_delivery_dict) +waybill_place_of_delivery_from_dict = WaybillPlaceOfDelivery.from_dict(waybill_place_of_delivery_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WaybillSortField.md b/pyevr/docs/WaybillSortField.md index bd081e9..7ac2b3e 100644 --- a/pyevr/docs/WaybillSortField.md +++ b/pyevr/docs/WaybillSortField.md @@ -2,9 +2,15 @@ -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `CREATIONTIMEASC` (value: `'creationTimeAsc'`) + +* `CREATIONTIMEDESC` (value: `'creationTimeDesc'`) + +* `LASTMODIFICATIONTIMEASC` (value: `'lastModificationTimeAsc'`) + +* `LASTMODIFICATIONTIMEDESC` (value: `'lastModificationTimeDesc'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WaybillStatus.md b/pyevr/docs/WaybillStatus.md index c4d7344..c681ea3 100644 --- a/pyevr/docs/WaybillStatus.md +++ b/pyevr/docs/WaybillStatus.md @@ -2,9 +2,15 @@ -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `SHIPPING` (value: `'shipping'`) + +* `CANCELLED` (value: `'cancelled'`) + +* `UNLOADED` (value: `'unloaded'`) + +* `FINISHED` (value: `'finished'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WaybillsApi.md b/pyevr/docs/WaybillsApi.md index 0a51375..2f60455 100644 --- a/pyevr/docs/WaybillsApi.md +++ b/pyevr/docs/WaybillsApi.md @@ -24,9 +24,8 @@ Lisab veoselehele uue märkuse. Olemasolevaid märkuseid ei muudeta. Märkust sa ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.add_waybill_note_request import AddWaybillNoteRequest from openapi_client.rest import ApiException @@ -68,6 +67,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Veoselehe number (tõstutundetu) | @@ -88,6 +88,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -108,9 +109,8 @@ Lisab veoselehele uue veose. Veoseid saab lisada veoselehele vedaja ja veoselehe ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.add_shipments_to_waybill_request import AddShipmentsToWaybillRequest from openapi_client.rest import ApiException @@ -152,6 +152,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Veoselehe number (tõstutundetu) | @@ -172,6 +173,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -187,14 +189,13 @@ void (empty response body) Veoselehe tühistamine -Tühistab veoselehe. Veoselehe staatuseks märgitakse tühistatud (status: \"cancelled\"). Veoselehe saab tühistada veoselehe looja, kuni veoseleht pole veel vastu võetud. +Veoselehe saab tühistada veoselehe looja, omanik, saaja, vedaja ja alltöövõtja kuni veoseleht pole veel vastu võetud. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.cancel_waybill_request import CancelWaybillRequest from openapi_client.rest import ApiException @@ -236,6 +237,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Veoselehe number (tõstutundetu) | @@ -256,6 +258,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -271,14 +274,13 @@ void (empty response body) Veoselehe lõpetamine -Lõpetab veoselehe ja veoselehe staatuseks märgitakse \"veoseleht lõpetatud\" (status: \"finished\"). Veoselehte saavad lõpetada veoselehele märgitud saaja ning volitatud mõõtja ja seda ainult \"koorem maas\" staatuses. +Lõpetab veoselehe ja veoselehe staatuseks märgitakse "veoseleht lõpetatud" (status: "finished"). Veoselehte saavad lõpetada veoselehele märgitud saaja ning volitatud mõõtja ja seda ainult "koorem maas" staatuses. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.rest import ApiException from pprint import pprint @@ -318,6 +320,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Veoselehe number (tõstutundetu) | @@ -337,6 +340,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -348,7 +352,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **waybills_list** -> PagedResultOfWaybill waybills_list(created_after=created_after, created_before=created_before, last_modified_after=last_modified_after, last_modified_before=last_modified_before, status=status, owner_code=owner_code, transporter_code=transporter_code, receiver_code=receiver_code, van_registration_number=van_registration_number, trailer_registration_number=trailer_registration_number, driver_id_code=driver_id_code, place_of_delivery_code=place_of_delivery_code, text=text, sort=sort, page=page, page_size=page_size, include_latest_measurements=include_latest_measurements, evr_language=evr_language) +> PagedResultOfWaybill waybills_list(created_after=created_after, created_before=created_before, last_modified_after=last_modified_after, last_modified_before=last_modified_before, status=status, owner_code=owner_code, transporter_code=transporter_code, receiver_code=receiver_code, van_registration_number=van_registration_number, trailer_registration_number=trailer_registration_number, driver_id_code=driver_id_code, place_of_delivery_code=place_of_delivery_code, subcontractor_code=subcontractor_code, text=text, sort=sort, page=page, page_size=page_size, include_latest_measurements=include_latest_measurements, include_timber_report=include_timber_report, evr_language=evr_language) Veoselehtede pärimine @@ -357,9 +361,8 @@ Tagastab filtritele vastavad veoselehed. Veoselehti saavad pärida ainult nendeg ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.paged_result_of_waybill import PagedResultOfWaybill from openapi_client.models.waybill_sort_field import WaybillSortField @@ -400,16 +403,18 @@ with openapi_client.ApiClient(configuration) as api_client: trailer_registration_number = 'trailer_registration_number_example' # str | Filtreerib veoselehed, millel on sama haagise registreerimisnumber (tõstutundlik) (optional) driver_id_code = 'driver_id_code_example' # str | Filtreerib veoselehed, millel on sama transportija autojuhi isikukood (tõstutundlik) (optional) place_of_delivery_code = 'place_of_delivery_code_example' # str | Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik) (optional) + subcontractor_code = 'subcontractor_code_example' # str | Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik) (optional) text = 'text_example' # str | Vabateksti otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA. * jutumärkides tekst: otsitakse jutumärkides olevat lauset. * OR: loogiline VÕI operaator sõnade vahel. * -: loogiline EITUS. (optional) sort = openapi_client.WaybillSortField() # WaybillSortField | Sorteerib tulemused valitud välja järgi (optional) page = 56 # int | Määrab tagastatava lehekülje (optional) page_size = 56 # int | Määrab lehekülje suuruse (optional) include_latest_measurements = True # bool | Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) (optional) + include_timber_report = True # bool | Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) (optional) evr_language = 'evr_language_example' # str | Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). (optional) try: # Veoselehtede pärimine - api_response = api_instance.waybills_list(created_after=created_after, created_before=created_before, last_modified_after=last_modified_after, last_modified_before=last_modified_before, status=status, owner_code=owner_code, transporter_code=transporter_code, receiver_code=receiver_code, van_registration_number=van_registration_number, trailer_registration_number=trailer_registration_number, driver_id_code=driver_id_code, place_of_delivery_code=place_of_delivery_code, text=text, sort=sort, page=page, page_size=page_size, include_latest_measurements=include_latest_measurements, evr_language=evr_language) + api_response = api_instance.waybills_list(created_after=created_after, created_before=created_before, last_modified_after=last_modified_after, last_modified_before=last_modified_before, status=status, owner_code=owner_code, transporter_code=transporter_code, receiver_code=receiver_code, van_registration_number=van_registration_number, trailer_registration_number=trailer_registration_number, driver_id_code=driver_id_code, place_of_delivery_code=place_of_delivery_code, subcontractor_code=subcontractor_code, text=text, sort=sort, page=page, page_size=page_size, include_latest_measurements=include_latest_measurements, include_timber_report=include_timber_report, evr_language=evr_language) print("The response of WaybillsApi->waybills_list:\n") pprint(api_response) except Exception as e: @@ -420,6 +425,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **created_after** | **datetime**| Filtreerib veoselehed, mis on loodud hiljem või samal ajal. Kui 'created_after' ja 'created_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse. | [optional] @@ -434,11 +440,13 @@ Name | Type | Description | Notes **trailer_registration_number** | **str**| Filtreerib veoselehed, millel on sama haagise registreerimisnumber (tõstutundlik) | [optional] **driver_id_code** | **str**| Filtreerib veoselehed, millel on sama transportija autojuhi isikukood (tõstutundlik) | [optional] **place_of_delivery_code** | **str**| Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik) | [optional] + **subcontractor_code** | **str**| Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik) | [optional] **text** | **str**| Vabateksti otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA. * jutumärkides tekst: otsitakse jutumärkides olevat lauset. * OR: loogiline VÕI operaator sõnade vahel. * -: loogiline EITUS. | [optional] **sort** | [**WaybillSortField**](.md)| Sorteerib tulemused valitud välja järgi | [optional] **page** | **int**| Määrab tagastatava lehekülje | [optional] **page_size** | **int**| Määrab lehekülje suuruse | [optional] **include_latest_measurements** | **bool**| Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) | [optional] + **include_timber_report** | **bool**| Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) | [optional] **evr_language** | **str**| Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). | [optional] ### Return type @@ -455,6 +463,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -465,7 +474,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **waybills_get** -> Waybill waybills_get(number, include_latest_measurements=include_latest_measurements, evr_language=evr_language) +> Waybill waybills_get(number, include_latest_measurements=include_latest_measurements, include_timber_report=include_timber_report, evr_language=evr_language) Veoselehe pärimine @@ -474,9 +483,8 @@ Tagastab numbrile vastava veoselehe. Veoselehte saavad pärida ainult sellega se ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.waybill import Waybill from openapi_client.rest import ApiException @@ -504,12 +512,13 @@ with openapi_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = openapi_client.WaybillsApi(api_client) number = 'number_example' # str | Päritava veoselehe number (tõstutundetu) - include_latest_measurements = False # bool | (optional) (default to False) + include_latest_measurements = False # bool | Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) (optional) (default to False) + include_timber_report = False # bool | Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) (optional) (default to False) evr_language = 'evr_language_example' # str | Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). (optional) try: # Veoselehe pärimine - api_response = api_instance.waybills_get(number, include_latest_measurements=include_latest_measurements, evr_language=evr_language) + api_response = api_instance.waybills_get(number, include_latest_measurements=include_latest_measurements, include_timber_report=include_timber_report, evr_language=evr_language) print("The response of WaybillsApi->waybills_get:\n") pprint(api_response) except Exception as e: @@ -520,10 +529,12 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Päritava veoselehe number (tõstutundetu) | - **include_latest_measurements** | **bool**| | [optional] [default to False] + **include_latest_measurements** | **bool**| Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) | [optional] [default to False] + **include_timber_report** | **bool**| Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) | [optional] [default to False] **evr_language** | **str**| Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). | [optional] ### Return type @@ -540,6 +551,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -554,14 +566,13 @@ Name | Type | Description | Notes Veoselehe loomine -Loob veoselehe staatusega \"vedu alustatud\" (status: \"shipping\"). Veo alustaja peab olema ise märgitud veoselehele kas omanikuks või vedajaks. Kui metsamaterjali saaja on EVR'iga liitunud asutus, peab veoselehel märgitud tarnekoht kuuluma ka saaja asutusele. Toimingu õnnestumisel tagastatakse loodud veoselehe number. +Loob veoselehe staatusega "vedu alustatud" (status: "shipping"). Veo alustaja peab olema ise märgitud veoselehele kas omanikuks või vedajaks. Kui metsamaterjali saaja on EVR'iga liitunud asutus, peab veoselehel märgitud tarnekoht kuuluma ka saaja asutusele. Toimingu õnnestumisel tagastatakse loodud veoselehe number. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.start_waybill_request import StartWaybillRequest from openapi_client.rest import ApiException @@ -604,6 +615,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **start_waybill_request** | [**StartWaybillRequest**](StartWaybillRequest.md)| Veoselehe andmed | @@ -623,6 +635,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | @@ -637,14 +650,13 @@ Name | Type | Description | Notes Veoselehel veo lõpetamine -Lõpetab veo veoselehel ja veoselehe staatuseks märgitakse \"koorem maas\" (status: \"unloaded\"). Vedu saab lõpetada veoselehe looja või vedaja ja seda ainult \"vedu alustatud\" (status: shipping) staatuses. +Lõpetab veo veoselehel ja veoselehe staatuseks märgitakse "koorem maas" (status: "unloaded"). Vedu saab lõpetada veoselehe looja või vedaja ja seda ainult "vedu alustatud" (status: shipping) staatuses. ### Example * Api Key Authentication (SecretApiKey): + ```python -import time -import os import openapi_client from openapi_client.models.unload_waybill_request import UnloadWaybillRequest from openapi_client.rest import ApiException @@ -686,6 +698,7 @@ with openapi_client.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **number** | **str**| Veoselehe number (tõstutundetu) | @@ -706,6 +719,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | | - | diff --git a/pyevr/docs/WithoutForestNotice.md b/pyevr/docs/WithoutForestNotice.md index a093869..c68013c 100644 --- a/pyevr/docs/WithoutForestNotice.md +++ b/pyevr/docs/WithoutForestNotice.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cadaster** | **str** | Katastritunnus | @@ -18,12 +19,12 @@ json = "{}" # create an instance of WithoutForestNotice from a JSON string without_forest_notice_instance = WithoutForestNotice.from_json(json) # print the JSON string representation of the object -print WithoutForestNotice.to_json() +print(WithoutForestNotice.to_json()) # convert the object into a dict without_forest_notice_dict = without_forest_notice_instance.to_dict() # create an instance of WithoutForestNotice from a dict -without_forest_notice_form_dict = without_forest_notice.from_dict(without_forest_notice_dict) +without_forest_notice_from_dict = WithoutForestNotice.from_dict(without_forest_notice_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/pyevr/docs/WoodQuality.md b/pyevr/docs/WoodQuality.md new file mode 100644 index 0000000..b0388de --- /dev/null +++ b/pyevr/docs/WoodQuality.md @@ -0,0 +1,31 @@ +# WoodQuality + + + +## Enum + +* `EPLUS` (value: `'ePlus'`) + +* `E` (value: `'e'`) + +* `EA` (value: `'ea'`) + +* `A` (value: `'a'`) + +* `BC` (value: `'bc'`) + +* `BC_II` (value: `'bc_II'`) + +* `ABC` (value: `'abc'`) + +* `ABCD` (value: `'abcd'`) + +* `D` (value: `'d'`) + +* `M` (value: `'m'`) + +* `F` (value: `'f'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/docs/WoodType.md b/pyevr/docs/WoodType.md new file mode 100644 index 0000000..372c758 --- /dev/null +++ b/pyevr/docs/WoodType.md @@ -0,0 +1,31 @@ +# WoodType + + + +## Enum + +* `KU` (value: `'ku'`) + +* `MA` (value: `'ma'`) + +* `KS` (value: `'ks'`) + +* `LM` (value: `'lm'`) + +* `HB` (value: `'hb'`) + +* `LV` (value: `'lv'`) + +* `SA` (value: `'sa'`) + +* `TA` (value: `'ta'`) + +* `NU` (value: `'nu'`) + +* `PN` (value: `'pn'`) + +* `PA` (value: `'pa'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/pyevr/openapi/patches/schema-fixes.patch b/pyevr/openapi/patches/schema-fixes.patch index 37542cf..c989159 100644 --- a/pyevr/openapi/patches/schema-fixes.patch +++ b/pyevr/openapi/patches/schema-fixes.patch @@ -1,6 +1,6 @@ ---- ./pyevr/openapi/openapi-generator-compatible.json 2022-06-14 10:17:29.572147070 +0300 -+++ ./pyevr/openapi/openapi-generator-compatible-patched.json 2022-06-14 10:17:16.381979532 +0300 -@@ -1750,13 +1750,13 @@ +--- ./pyevr/openapi/openapi-generator-compatible.json 2025-09-02 13:09:06.426485557 +0300 ++++ ./pyevr/openapi/openapi-generator-compatible-patched.json 2025-09-02 13:08:56.441376624 +0300 +@@ -2317,13 +2317,13 @@ "type": "string", "description": "Väljasõidu aeg", "format": "date-time", @@ -16,7 +16,7 @@ }, "shipments": { "type": "array", -@@ -1771,7 +1771,7 @@ +@@ -2338,7 +2338,7 @@ "description": "Ettesõidu kilometraaž", "format": "int32", "maximum": 100000.0, @@ -25,7 +25,7 @@ "nullable": true }, "userCustomData": { -@@ -1811,13 +1811,13 @@ +@@ -2383,13 +2383,13 @@ "type": "string", "description": "Nimi", "maxLength": 200, @@ -41,7 +41,7 @@ }, "email": { "type": "string", -@@ -1861,19 +1861,19 @@ +@@ -2433,19 +2433,19 @@ "type": "string", "description": "Maakond", "maxLength": 100, @@ -64,7 +64,7 @@ } } }, -@@ -1914,13 +1914,13 @@ +@@ -2486,13 +2486,13 @@ "type": "string", "description": "Nimi", "maxLength": 200, @@ -80,7 +80,7 @@ }, "address": { "$ref": "#/components/schemas/Address" -@@ -1962,13 +1962,13 @@ +@@ -2535,13 +2535,13 @@ "type": "string", "description": "Autojuhi nimi", "maxLength": 200, @@ -96,7 +96,7 @@ }, "driverPhone": { "type": "string", -@@ -1980,7 +1980,7 @@ +@@ -2553,7 +2553,7 @@ "type": "string", "description": "Veoki riiklik registreerimisnumber", "maxLength": 10, @@ -105,7 +105,7 @@ }, "trailerRegistrationNumber": { "type": "string", -@@ -2002,13 +2002,13 @@ +@@ -2580,13 +2580,13 @@ "type": "string", "description": "Nimi", "maxLength": 200, @@ -121,7 +121,7 @@ }, "contactPerson": { "description": "Kontaktisiku andmed", -@@ -2030,13 +2030,13 @@ +@@ -2649,13 +2649,13 @@ "type": "string", "description": "Nimi", "maxLength": 200, @@ -137,7 +137,7 @@ }, "address": { "description": "Aadress", -@@ -2067,7 +2067,7 @@ +@@ -2686,7 +2686,7 @@ "type": "string", "description": "Tarnekoha nimi", "maxLength": 200, @@ -145,8 +145,8 @@ + "minLength": 0 }, "coordinates": { - "description": "Koordinaat (LAMBERT-EST)", -@@ -2199,7 +2199,7 @@ + "description": "Koordinaat", +@@ -2856,7 +2856,7 @@ "type": "string", "description": "Katastritunnus", "maxLength": 500, @@ -155,7 +155,7 @@ }, "compartment": { "type": "string", -@@ -2239,19 +2239,19 @@ +@@ -2896,19 +2896,19 @@ "type": "string", "description": "Dokumendi number", "maxLength": 500, @@ -178,7 +178,7 @@ }, "compartment": { "type": "string", -@@ -2287,19 +2287,19 @@ +@@ -2950,19 +2950,19 @@ "type": "string", "description": "Dokumendi number", "maxLength": 500, @@ -201,30 +201,39 @@ }, "compartment": { "type": "string", -@@ -2335,19 +2335,19 @@ - "type": "string", - "description": "Dokumendi number", - "maxLength": 500, -- "minLength": 1 -+ "minLength": 0 - }, - "contractDate": { - "type": "string", - "description": "Dokumendi kuupäev", - "format": "date-time", -- "minLength": 1 -+ "minLength": 0 - }, - "cadaster": { - "type": "string", - "description": "Katastritunnus", - "maxLength": 500, -- "minLength": 1 -+ "minLength": 0 - }, - "compartment": { - "type": "string", -@@ -2415,19 +2415,19 @@ +@@ -3084,19 +3084,19 @@ + "type": "string", + "description": "Sortimendi kood. Kui organisatsioon on seadistatud kasutama EVR sortimente, peab kood olema [üks EVR sortimentide koodist.](#operation/Assortments_List)", + "maxLength": 10, +- "minLength": 1 ++ "minLength": 0 + }, + "name": { + "type": "string", + "description": "Sortimendi nimetus", + "maxLength": 100, +- "minLength": 1 ++ "minLength": 0 + }, + "productGroup": { + "type": "string", + "description": "Tootegrupi kood", + "maxLength": 10, +- "minLength": 1 ++ "minLength": 0 + } + } + }, +@@ -3111,7 +3111,7 @@ + "type": "string", + "description": "[Tarneahela sertifikaadi väite kood](#operation/Certificates_List)", + "maxLength": 50, +- "minLength": 1 ++ "minLength": 0 + }, + "number": { + "type": "string", +@@ -3169,19 +3169,19 @@ "type": "string", "description": "Dokumendi number", "maxLength": 500, @@ -247,7 +256,7 @@ }, "compartment": { "type": "string", -@@ -2463,19 +2463,19 @@ +@@ -3274,19 +3274,19 @@ "type": "string", "description": "Dokumendi number", "maxLength": 500, @@ -270,7 +279,7 @@ }, "compartment": { "type": "string", -@@ -2508,7 +2508,7 @@ +@@ -3537,7 +3537,7 @@ "type": "string", "description": "Maaüksuse või laoplatsi nimi", "maxLength": 200, @@ -279,7 +288,7 @@ }, "code": { "type": "string", -@@ -2587,7 +2587,7 @@ +@@ -3654,7 +3654,7 @@ "type": "string", "description": "[Mõõtühiku kood](#operation/MeasurementUnits_List)", "maxLength": 10, @@ -288,39 +297,7 @@ }, "assortment": { "description": "Sortiment", -@@ -2674,19 +2674,19 @@ - "type": "string", - "description": "Sortimendi kood. Kui organisatsioon on seadistatud kasutama EVR sortimente, peab kood olema [üks EVR sortimentide koodist.](#operation/Assortments_List)", - "maxLength": 10, -- "minLength": 1 -+ "minLength": 0 - }, - "name": { - "type": "string", - "description": "Sortimendi nimetus", - "maxLength": 100, -- "minLength": 1 -+ "minLength": 0 - }, - "productGroup": { - "type": "string", - "description": "Tootegrupi kood", - "maxLength": 10, -- "minLength": 1 -+ "minLength": 0 - } - } - }, -@@ -2701,7 +2701,7 @@ - "type": "string", - "description": "[Tarneahela sertifikaadi väite kood](#operation/Certificates_List)", - "maxLength": 50, -- "minLength": 1 -+ "minLength": 0 - }, - "number": { - "type": "string", -@@ -2722,7 +2722,7 @@ +@@ -3738,7 +3738,7 @@ "type": "string", "description": "Registrikood", "maxLength": 20, @@ -329,7 +306,7 @@ } } }, -@@ -2764,13 +2764,13 @@ +@@ -3780,13 +3780,13 @@ "type": "string", "description": "Väljasõidu aeg", "format": "date-time", @@ -345,7 +322,7 @@ }, "shipments": { "type": "array", -@@ -2785,7 +2785,7 @@ +@@ -3801,7 +3801,7 @@ "description": "Ettesõidu kilometraaž", "format": "int32", "maximum": 100000.0, @@ -354,23 +331,7 @@ "nullable": true }, "userCustomData": { -@@ -2932,13 +2932,13 @@ - "type": "string", - "description": "Nimi", - "maxLength": 200, -- "minLength": 1 -+ "minLength": 0 - }, - "code": { - "type": "string", - "description": "Isiku- või registrikood", - "maxLength": 20, -- "minLength": 1 -+ "minLength": 0 - } - } - }, -@@ -2954,10 +2954,10 @@ +@@ -3972,7 +3972,7 @@ "type": "string", "description": "Registrikood", "maxLength": 20, @@ -379,19 +340,16 @@ }, "type": { "description": "Volituse tüüp", - "$ref": "#/components/schemas/AuthorizationType" - } - } -@@ -3026,7 +3026,7 @@ +@@ -4150,7 +4150,7 @@ "type": "string", "description": "Selgitus", "maxLength": 400, - "minLength": 1 + "minLength": 0 - } - } - }, -@@ -3272,7 +3272,7 @@ + }, + "coordinates": { + "description": "Koordinaat", +@@ -4384,7 +4384,7 @@ "name": { "type": "string", "description": "Nimi", @@ -400,3 +358,10 @@ }, "address": { "description": "Aadress", +@@ -4651,4 +4651,4 @@ + "SecretApiKey": [] + } + ] +-} +\ No newline at end of file ++} diff --git a/pyevr/openapi_client/__init__.py b/pyevr/openapi_client/__init__.py index df2f8a7..33cc376 100644 --- a/pyevr/openapi_client/__init__.py +++ b/pyevr/openapi_client/__init__.py @@ -3,17 +3,16 @@ # flake8: noqa """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - __version__ = "1.0.0" # import apis into sdk package @@ -23,6 +22,7 @@ from pyevr.openapi_client.api.measurements_api import MeasurementsApi from pyevr.openapi_client.api.organizations_api import OrganizationsApi from pyevr.openapi_client.api.place_of_deliveries_api import PlaceOfDeliveriesApi +from pyevr.openapi_client.api.timber_reports_api import TimberReportsApi from pyevr.openapi_client.api.waybills_api import WaybillsApi # import ApiClient @@ -43,26 +43,38 @@ from pyevr.openapi_client.models.add_shipments_to_waybill_request import ( AddShipmentsToWaybillRequest, ) +from pyevr.openapi_client.models.add_timber_report_request import AddTimberReportRequest from pyevr.openapi_client.models.add_waybill_note_request import AddWaybillNoteRequest from pyevr.openapi_client.models.address import Address +from pyevr.openapi_client.models.agricultural_biomass import AgriculturalBiomass from pyevr.openapi_client.models.assortment import Assortment from pyevr.openapi_client.models.authorization_type import AuthorizationType +from pyevr.openapi_client.models.baltpool_quality import BaltpoolQuality from pyevr.openapi_client.models.cancel_waybill_request import CancelWaybillRequest from pyevr.openapi_client.models.certificate import Certificate from pyevr.openapi_client.models.certificate_claim import CertificateClaim from pyevr.openapi_client.models.consolidated_act import ConsolidatedAct +from pyevr.openapi_client.models.consolidated_act_source_item import ( + ConsolidatedActSourceItem, +) from pyevr.openapi_client.models.contact_person import ContactPerson from pyevr.openapi_client.models.contract_for_transfer_of_cutting_rights import ( ContractForTransferOfCuttingRights, ) from pyevr.openapi_client.models.coordinates import Coordinates +from pyevr.openapi_client.models.defect_code import DefectCode +from pyevr.openapi_client.models.deforestation_biomass import DeforestationBiomass from pyevr.openapi_client.models.entity import Entity +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.forest_act import ForestAct from pyevr.openapi_client.models.forest_notice import ForestNotice from pyevr.openapi_client.models.holding_base import HoldingBase +from pyevr.openapi_client.models.holding_base_type import HoldingBaseType from pyevr.openapi_client.models.inventory_act import InventoryAct +from pyevr.openapi_client.models.measurement import Measurement from pyevr.openapi_client.models.measurement_act import MeasurementAct from pyevr.openapi_client.models.measurement_unit import MeasurementUnit +from pyevr.openapi_client.models.non_forest_wood_biomass import NonForestWoodBiomass from pyevr.openapi_client.models.organization import Organization from pyevr.openapi_client.models.owner import Owner from pyevr.openapi_client.models.pack import Pack @@ -95,11 +107,17 @@ from pyevr.openapi_client.models.receiver import Receiver from pyevr.openapi_client.models.representer import Representer from pyevr.openapi_client.models.sales_contract import SalesContract +from pyevr.openapi_client.models.secondary_waste_wood import SecondaryWasteWood +from pyevr.openapi_client.models.secondary_wood_biomass import SecondaryWoodBiomass from pyevr.openapi_client.models.shipment import Shipment from pyevr.openapi_client.models.shipment_assortment import ShipmentAssortment from pyevr.openapi_client.models.shipment_item import ShipmentItem +from pyevr.openapi_client.models.shipment_item_base import ShipmentItemBase from pyevr.openapi_client.models.source import Source from pyevr.openapi_client.models.start_waybill_request import StartWaybillRequest +from pyevr.openapi_client.models.subcontractor import Subcontractor +from pyevr.openapi_client.models.timber_report import TimberReport +from pyevr.openapi_client.models.timber_report_item import TimberReportItem from pyevr.openapi_client.models.total import Total from pyevr.openapi_client.models.transport import Transport from pyevr.openapi_client.models.transporter import Transporter @@ -114,3 +132,5 @@ from pyevr.openapi_client.models.waybill_sort_field import WaybillSortField from pyevr.openapi_client.models.waybill_status import WaybillStatus from pyevr.openapi_client.models.without_forest_notice import WithoutForestNotice +from pyevr.openapi_client.models.wood_quality import WoodQuality +from pyevr.openapi_client.models.wood_type import WoodType diff --git a/pyevr/openapi_client/api/__init__.py b/pyevr/openapi_client/api/__init__.py index 7f573fd..29fac7f 100644 --- a/pyevr/openapi_client/api/__init__.py +++ b/pyevr/openapi_client/api/__init__.py @@ -7,4 +7,5 @@ from pyevr.openapi_client.api.measurements_api import MeasurementsApi from pyevr.openapi_client.api.organizations_api import OrganizationsApi from pyevr.openapi_client.api.place_of_deliveries_api import PlaceOfDeliveriesApi +from pyevr.openapi_client.api.timber_reports_api import TimberReportsApi from pyevr.openapi_client.api.waybills_api import WaybillsApi diff --git a/pyevr/openapi_client/api/assortments_api.py b/pyevr/openapi_client/api/assortments_api.py index 7fff77c..e7083d1 100644 --- a/pyevr/openapi_client/api/assortments_api.py +++ b/pyevr/openapi_client/api/assortments_api.py @@ -1,35 +1,28 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings +from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import validate_arguments, ValidationError - +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint - -from typing import Optional +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse from pyevr.openapi_client.models.paged_result_of_assortment import ( PagedResultOfAssortment, ) - -from pyevr.openapi_client.api_client import ApiClient -from pyevr.openapi_client.api_response import ApiResponse -from pyevr.openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from pyevr.openapi_client.rest import RESTResponseType class AssortmentsApi: @@ -44,15 +37,15 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def assortments_list( self, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -61,16 +54,21 @@ def assortments_list( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PagedResultOfAssortment: # noqa: E501 - """Sortimentide pärimine # noqa: E501 - - Tagastab EVR-i aktiivsed sortimendid. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PagedResultOfAssortment: + """Sortimentide pärimine - >>> thread = api.assortments_list(page, page_size, evr_language, async_req=True) - >>> result = thread.get() + Tagastab EVR-i aktiivsed sortimendid. :param page: Tagastatav lehekülg :type page: int @@ -78,34 +76,62 @@ def assortments_list( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PagedResultOfAssortment - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the assortments_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.assortments_list_with_http_info( - page, page_size, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._assortments_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfAssortment", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def assortments_list_with_http_info( self, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -114,16 +140,107 @@ def assortments_list_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Sortimentide pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PagedResultOfAssortment]: + """Sortimentide pärimine - Tagastab EVR-i aktiivsed sortimendid. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Tagastab EVR-i aktiivsed sortimendid. - >>> thread = api.assortments_list_with_http_info(page, page_size, evr_language, async_req=True) - >>> result = thread.get() + :param page: Tagastatav lehekülg + :type page: int + :param page_size: Tagastatava lehekülje suurus + :type page_size: int + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._assortments_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfAssortment", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def assortments_list_without_preload_content( + self, + page: Annotated[ + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], + Field(description="Tagastatav lehekülg"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], + Field(description="Tagastatava lehekülje suurus"), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sortimentide pärimine + + Tagastab EVR-i aktiivsed sortimendid. :param page: Tagastatav lehekülg :type page: int @@ -131,109 +248,106 @@ def assortments_list_with_http_info( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PagedResultOfAssortment, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["page", "page_size", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._assortments_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method assortments_list" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfAssortment", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _assortments_list_serialize( + self, + page, + page_size, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get("page") is not None: # noqa: E501 - _query_params.append(("page", _params["page"])) + if page is not None: + _query_params.append(("page", page)) - if _params.get("page_size") is not None: # noqa: E501 - _query_params.append(("page_size", _params["page_size"])) + if page_size is not None: + _query_params.append(("page_size", page_size)) # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "403": "ProblemDetails", - "401": "ProblemDetails", - "400": "ValidationResult", - "200": "PagedResultOfAssortment", - } - - return self.api_client.call_api( - "/api/assortments", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/assortments", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) diff --git a/pyevr/openapi_client/api/certificates_api.py b/pyevr/openapi_client/api/certificates_api.py index 88ef7c3..dddef57 100644 --- a/pyevr/openapi_client/api/certificates_api.py +++ b/pyevr/openapi_client/api/certificates_api.py @@ -1,35 +1,28 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings +from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import validate_arguments, ValidationError - +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint - -from typing import Optional +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse from pyevr.openapi_client.models.paged_result_of_certificate import ( PagedResultOfCertificate, ) - -from pyevr.openapi_client.api_client import ApiClient -from pyevr.openapi_client.api_response import ApiResponse -from pyevr.openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from pyevr.openapi_client.rest import RESTResponseType class CertificatesApi: @@ -44,15 +37,15 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def certificates_list( self, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -61,16 +54,21 @@ def certificates_list( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PagedResultOfCertificate: # noqa: E501 - """Sertifikaatide pärimine # noqa: E501 - - Tagastab EVR-i aktiivsed sertifikaadid. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PagedResultOfCertificate: + """Sertifikaatide pärimine - >>> thread = api.certificates_list(page, page_size, evr_language, async_req=True) - >>> result = thread.get() + Tagastab EVR-i aktiivsed sertifikaadid. :param page: Tagastatav lehekülg :type page: int @@ -78,34 +76,62 @@ def certificates_list( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PagedResultOfCertificate - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the certificates_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.certificates_list_with_http_info( - page, page_size, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._certificates_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfCertificate", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def certificates_list_with_http_info( self, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -114,16 +140,107 @@ def certificates_list_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Sertifikaatide pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PagedResultOfCertificate]: + """Sertifikaatide pärimine - Tagastab EVR-i aktiivsed sertifikaadid. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Tagastab EVR-i aktiivsed sertifikaadid. - >>> thread = api.certificates_list_with_http_info(page, page_size, evr_language, async_req=True) - >>> result = thread.get() + :param page: Tagastatav lehekülg + :type page: int + :param page_size: Tagastatava lehekülje suurus + :type page_size: int + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._certificates_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfCertificate", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def certificates_list_without_preload_content( + self, + page: Annotated[ + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], + Field(description="Tagastatav lehekülg"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], + Field(description="Tagastatava lehekülje suurus"), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Sertifikaatide pärimine + + Tagastab EVR-i aktiivsed sertifikaadid. :param page: Tagastatav lehekülg :type page: int @@ -131,109 +248,106 @@ def certificates_list_with_http_info( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PagedResultOfCertificate, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["page", "page_size", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._certificates_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method certificates_list" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfCertificate", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _certificates_list_serialize( + self, + page, + page_size, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get("page") is not None: # noqa: E501 - _query_params.append(("page", _params["page"])) + if page is not None: + _query_params.append(("page", page)) - if _params.get("page_size") is not None: # noqa: E501 - _query_params.append(("page_size", _params["page_size"])) + if page_size is not None: + _query_params.append(("page_size", page_size)) # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "403": "ProblemDetails", - "401": "ProblemDetails", - "400": "ValidationResult", - "200": "PagedResultOfCertificate", - } - - return self.api_client.call_api( - "/api/certificates", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/certificates", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) diff --git a/pyevr/openapi_client/api/measurement_units_api.py b/pyevr/openapi_client/api/measurement_units_api.py index 5063bc3..4c6f245 100644 --- a/pyevr/openapi_client/api/measurement_units_api.py +++ b/pyevr/openapi_client/api/measurement_units_api.py @@ -1,35 +1,28 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings +from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import validate_arguments, ValidationError - +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint - -from typing import Optional +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse from pyevr.openapi_client.models.paged_result_of_measurement_unit import ( PagedResultOfMeasurementUnit, ) - -from pyevr.openapi_client.api_client import ApiClient -from pyevr.openapi_client.api_response import ApiResponse -from pyevr.openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from pyevr.openapi_client.rest import RESTResponseType class MeasurementUnitsApi: @@ -44,15 +37,15 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def measurement_units_list( self, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -61,16 +54,21 @@ def measurement_units_list( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PagedResultOfMeasurementUnit: # noqa: E501 - """Mõõtühikute pärimine # noqa: E501 - - Tagastab EVR-i aktiivsed mõõtühikud. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PagedResultOfMeasurementUnit: + """Mõõtühikute pärimine - >>> thread = api.measurement_units_list(page, page_size, evr_language, async_req=True) - >>> result = thread.get() + Tagastab EVR-i aktiivsed mõõtühikud. :param page: Tagastatav lehekülg :type page: int @@ -78,34 +76,62 @@ def measurement_units_list( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PagedResultOfMeasurementUnit - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the measurement_units_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.measurement_units_list_with_http_info( - page, page_size, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._measurement_units_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfMeasurementUnit", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def measurement_units_list_with_http_info( self, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -114,16 +140,107 @@ def measurement_units_list_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Mõõtühikute pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PagedResultOfMeasurementUnit]: + """Mõõtühikute pärimine - Tagastab EVR-i aktiivsed mõõtühikud. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Tagastab EVR-i aktiivsed mõõtühikud. - >>> thread = api.measurement_units_list_with_http_info(page, page_size, evr_language, async_req=True) - >>> result = thread.get() + :param page: Tagastatav lehekülg + :type page: int + :param page_size: Tagastatava lehekülje suurus + :type page_size: int + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._measurement_units_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfMeasurementUnit", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def measurement_units_list_without_preload_content( + self, + page: Annotated[ + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], + Field(description="Tagastatav lehekülg"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], + Field(description="Tagastatava lehekülje suurus"), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Mõõtühikute pärimine + + Tagastab EVR-i aktiivsed mõõtühikud. :param page: Tagastatav lehekülg :type page: int @@ -131,109 +248,106 @@ def measurement_units_list_with_http_info( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PagedResultOfMeasurementUnit, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["page", "page_size", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._measurement_units_list_serialize( + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method measurement_units_list" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfMeasurementUnit", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _measurement_units_list_serialize( + self, + page, + page_size, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get("page") is not None: # noqa: E501 - _query_params.append(("page", _params["page"])) + if page is not None: + _query_params.append(("page", page)) - if _params.get("page_size") is not None: # noqa: E501 - _query_params.append(("page_size", _params["page_size"])) + if page_size is not None: + _query_params.append(("page_size", page_size)) # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "403": "ProblemDetails", - "401": "ProblemDetails", - "400": "ValidationResult", - "200": "PagedResultOfMeasurementUnit", - } - - return self.api_client.call_api( - "/api/measurementunits", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/measurementunits", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) diff --git a/pyevr/openapi_client/api/measurements_api.py b/pyevr/openapi_client/api/measurements_api.py index e5b394b..606fd61 100644 --- a/pyevr/openapi_client/api/measurements_api.py +++ b/pyevr/openapi_client/api/measurements_api.py @@ -1,38 +1,31 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings +from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import validate_arguments, ValidationError - +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint - -from typing import Optional +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse from pyevr.openapi_client.models.add_measurement_act_request import ( AddMeasurementActRequest, ) from pyevr.openapi_client.models.paged_result_of_measurement_act import ( PagedResultOfMeasurementAct, ) - -from pyevr.openapi_client.api_client import ApiClient -from pyevr.openapi_client.api_response import ApiResponse -from pyevr.openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from pyevr.openapi_client.rest import RESTResponseType class MeasurementsApi: @@ -47,14 +40,14 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def measurements_get( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, evr_language: Annotated[ @@ -63,16 +56,21 @@ def measurements_get( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PagedResultOfMeasurementAct: # noqa: E501 - """Veoselehe mõõtmisandmete pärimine # noqa: E501 - - Tagastab veoselehega seotud mõõtmisandmed. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PagedResultOfMeasurementAct: + """Veoselehe mõõtmisandmete pärimine - >>> thread = api.measurements_get(number, page, evr_language, async_req=True) - >>> result = thread.get() + Tagastab veoselehega seotud mõõtmisandmed. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -80,33 +78,62 @@ def measurements_get( :type page: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PagedResultOfMeasurementAct - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the measurements_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.measurements_get_with_http_info( - number, page, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._measurements_get_serialize( + number=number, + page=page, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "404": "ProblemDetails", + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": "PagedResultOfMeasurementAct", + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def measurements_get_with_http_info( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, evr_language: Annotated[ @@ -115,16 +142,107 @@ def measurements_get_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehe mõõtmisandmete pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PagedResultOfMeasurementAct]: + """Veoselehe mõõtmisandmete pärimine + + Tagastab veoselehega seotud mõõtmisandmed. + + :param number: Veoselehe number (tõstutundetu) (required) + :type number: str + :param page: Tagastatav lehekülg + :type page: int + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._measurements_get_serialize( + number=number, + page=page, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - Tagastab veoselehega seotud mõõtmisandmed. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + "404": "ProblemDetails", + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": "PagedResultOfMeasurementAct", + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - >>> thread = api.measurements_get_with_http_info(number, page, evr_language, async_req=True) - >>> result = thread.get() + @validate_call + def measurements_get_without_preload_content( + self, + number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + page: Annotated[ + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], + Field(description="Tagastatav lehekülg"), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehe mõõtmisandmete pärimine + + Tagastab veoselehega seotud mõõtmisandmed. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -132,121 +250,118 @@ def measurements_get_with_http_info( :type page: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PagedResultOfMeasurementAct, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["number", "page", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._measurements_get_serialize( + number=number, + page=page, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method measurements_get" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "404": "ProblemDetails", + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": "PagedResultOfMeasurementAct", + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _measurements_get_serialize( + self, + number, + page, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] - + if number is not None: + _path_params["number"] = number # process the query parameters - _query_params = [] - if _params.get("page") is not None: # noqa: E501 - _query_params.append(("page", _params["page"])) + if page is not None: + _query_params.append(("page", page)) # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "404": "ProblemDetails", - "403": "ProblemDetails", - "401": "ProblemDetails", - "200": "PagedResultOfMeasurementAct", - "400": "ValidationResult", - } - - return self.api_client.call_api( - "/api/waybills/{number}/measurements", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/waybills/{number}/measurements", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def measurements_post( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], add_measurement_act_request: Annotated[ - AddMeasurementActRequest, Field(..., description="Mõõtmisandmed") + AddMeasurementActRequest, Field(description="Mõõtmisandmed") ], evr_language: Annotated[ Optional[StrictStr], @@ -254,16 +369,21 @@ def measurements_post( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> None: # noqa: E501 - """Veoselehele mõõtmisandmete lisamine # noqa: E501 - - Lisab veoselehele mõõtmisandmed. Mõõtmisandmeid saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. Mõõtmistulemusi on võimalik lisada koormapakkidena või lihtsalt sortimentide kogustena. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Veoselehele mõõtmisandmete lisamine - >>> thread = api.measurements_post(number, add_measurement_act_request, evr_language, async_req=True) - >>> result = thread.get() + Lisab veoselehele mõõtmisandmed. Mõõtmisandmeid saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. Mõõtmistulemusi on võimalik lisada koormapakkidena või lihtsalt sortimentide kogustena. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -271,33 +391,62 @@ def measurements_post( :type add_measurement_act_request: AddMeasurementActRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the measurements_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.measurements_post_with_http_info( - number, add_measurement_act_request, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._measurements_post_serialize( + number=number, + add_measurement_act_request=add_measurement_act_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "404": "ProblemDetails", + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def measurements_post_with_http_info( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], add_measurement_act_request: Annotated[ - AddMeasurementActRequest, Field(..., description="Mõõtmisandmed") + AddMeasurementActRequest, Field(description="Mõõtmisandmed") ], evr_language: Annotated[ Optional[StrictStr], @@ -305,16 +454,106 @@ def measurements_post_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehele mõõtmisandmete lisamine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Veoselehele mõõtmisandmete lisamine - Lisab veoselehele mõõtmisandmed. Mõõtmisandmeid saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. Mõõtmistulemusi on võimalik lisada koormapakkidena või lihtsalt sortimentide kogustena. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Lisab veoselehele mõõtmisandmed. Mõõtmisandmeid saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. Mõõtmistulemusi on võimalik lisada koormapakkidena või lihtsalt sortimentide kogustena. - >>> thread = api.measurements_post_with_http_info(number, add_measurement_act_request, evr_language, async_req=True) - >>> result = thread.get() + :param number: Veoselehe number (tõstutundetu) (required) + :type number: str + :param add_measurement_act_request: Mõõtmisandmed (required) + :type add_measurement_act_request: AddMeasurementActRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._measurements_post_serialize( + number=number, + add_measurement_act_request=add_measurement_act_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "404": "ProblemDetails", + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def measurements_post_without_preload_content( + self, + number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + add_measurement_act_request: Annotated[ + AddMeasurementActRequest, Field(description="Mõõtmisandmed") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehele mõõtmisandmete lisamine + + Lisab veoselehele mõõtmisandmed. Mõõtmisandmeid saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. Mõõtmistulemusi on võimalik lisada koormapakkidena või lihtsalt sortimentide kogustena. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -322,111 +561,115 @@ def measurements_post_with_http_info( :type add_measurement_act_request: AddMeasurementActRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = ["number", "add_measurement_act_request", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._measurements_post_serialize( + number=number, + add_measurement_act_request=add_measurement_act_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method measurements_post" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "404": "ProblemDetails", + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _measurements_post_serialize( + self, + number, + add_measurement_act_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] - + if number is not None: + _path_params["number"] = number # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params["add_measurement_act_request"] is not None: - _body_params = _params["add_measurement_act_request"] + if add_measurement_act_request is not None: + _body_params = add_measurement_act_request # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get( - "_content_type", - self.api_client.select_header_content_type(["application/json"]), - ) - if _content_types_list: - _header_params["Content-Type"] = _content_types_list + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - "/api/waybills/{number}/measurements", - "POST", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/waybills/{number}/measurements", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) diff --git a/pyevr/openapi_client/api/organizations_api.py b/pyevr/openapi_client/api/organizations_api.py index 67b0b1e..685c027 100644 --- a/pyevr/openapi_client/api/organizations_api.py +++ b/pyevr/openapi_client/api/organizations_api.py @@ -1,36 +1,29 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings +from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import validate_arguments, ValidationError - +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint - -from typing import Optional +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse from pyevr.openapi_client.models.organization import Organization from pyevr.openapi_client.models.paged_result_of_organization import ( PagedResultOfOrganization, ) - -from pyevr.openapi_client.api_client import ApiClient -from pyevr.openapi_client.api_response import ApiResponse -from pyevr.openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from pyevr.openapi_client.rest import RESTResponseType class OrganizationsApi: @@ -45,7 +38,7 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def organizations_list( self, code_starts_with: Annotated[ @@ -61,11 +54,11 @@ def organizations_list( ), ] = None, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -74,16 +67,21 @@ def organizations_list( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PagedResultOfOrganization: # noqa: E501 - """Registreeritud asutuste pärimine # noqa: E501 - - Tagastab EVR-i aktiivsed asutused. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PagedResultOfOrganization: + """Registreeritud asutuste pärimine - >>> thread = api.organizations_list(code_starts_with, name_contains, page, page_size, evr_language, async_req=True) - >>> result = thread.get() + Tagastab EVR-i aktiivsed asutused. :param code_starts_with: Filtreerib asutused, mille registrikood algab otsinguterminiga :type code_starts_with: str @@ -95,26 +93,56 @@ def organizations_list( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PagedResultOfOrganization - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the organizations_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.organizations_list_with_http_info( - code_starts_with, name_contains, page, page_size, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._organizations_list_serialize( + code_starts_with=code_starts_with, + name_contains=name_contains, + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfOrganization", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def organizations_list_with_http_info( self, code_starts_with: Annotated[ @@ -130,11 +158,11 @@ def organizations_list_with_http_info( ), ] = None, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -143,16 +171,125 @@ def organizations_list_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Registreeritud asutuste pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PagedResultOfOrganization]: + """Registreeritud asutuste pärimine - Tagastab EVR-i aktiivsed asutused. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + Tagastab EVR-i aktiivsed asutused. + + :param code_starts_with: Filtreerib asutused, mille registrikood algab otsinguterminiga + :type code_starts_with: str + :param name_contains: Filtreerib asutused, mille nimi sisaldab otsinguterminit + :type name_contains: str + :param page: Tagastatav lehekülg + :type page: int + :param page_size: Tagastatava lehekülje suurus + :type page_size: int + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._organizations_list_serialize( + code_starts_with=code_starts_with, + name_contains=name_contains, + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfOrganization", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def organizations_list_without_preload_content( + self, + code_starts_with: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib asutused, mille registrikood algab otsinguterminiga" + ), + ] = None, + name_contains: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib asutused, mille nimi sisaldab otsinguterminit" + ), + ] = None, + page: Annotated[ + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], + Field(description="Tagastatav lehekülg"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], + Field(description="Tagastatava lehekülje suurus"), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Registreeritud asutuste pärimine - >>> thread = api.organizations_list_with_http_info(code_starts_with, name_contains, page, page_size, evr_language, async_req=True) - >>> result = thread.get() + Tagastab EVR-i aktiivsed asutused. :param code_starts_with: Filtreerib asutused, mille registrikood algab otsinguterminiga :type code_starts_with: str @@ -164,126 +301,121 @@ def organizations_list_with_http_info( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PagedResultOfOrganization, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - "code_starts_with", - "name_contains", - "page", - "page_size", - "evr_language", - ] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._organizations_list_serialize( + code_starts_with=code_starts_with, + name_contains=name_contains, + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method organizations_list" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfOrganization", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _organizations_list_serialize( + self, + code_starts_with, + name_contains, + page, + page_size, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get("code_starts_with") is not None: # noqa: E501 - _query_params.append(("code_starts_with", _params["code_starts_with"])) + if code_starts_with is not None: + _query_params.append(("code_starts_with", code_starts_with)) - if _params.get("name_contains") is not None: # noqa: E501 - _query_params.append(("name_contains", _params["name_contains"])) + if name_contains is not None: + _query_params.append(("name_contains", name_contains)) - if _params.get("page") is not None: # noqa: E501 - _query_params.append(("page", _params["page"])) + if page is not None: + _query_params.append(("page", page)) - if _params.get("page_size") is not None: # noqa: E501 - _query_params.append(("page_size", _params["page_size"])) + if page_size is not None: + _query_params.append(("page_size", page_size)) # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "403": "ProblemDetails", - "401": "ProblemDetails", - "400": "ValidationResult", - "200": "PagedResultOfOrganization", - } - - return self.api_client.call_api( - "/api/organizations", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/organizations", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def organizations_me( self, evr_language: Annotated[ @@ -292,39 +424,69 @@ def organizations_me( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> Organization: # noqa: E501 - """Päringu teostaja enda organisatsiooni andmete pärimine # noqa: E501 - - Tagastab asutuse andmed # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Organization: + """Päringu teostaja enda organisatsiooni andmete pärimine - >>> thread = api.organizations_me(evr_language, async_req=True) - >>> result = thread.get() + Tagastab asutuse andmed :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Organization - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the organizations_me_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.organizations_me_with_http_info( - evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._organizations_me_serialize( + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": "Organization", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def organizations_me_with_http_info( self, evr_language: Annotated[ @@ -333,115 +495,184 @@ def organizations_me_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Päringu teostaja enda organisatsiooni andmete pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Organization]: + """Päringu teostaja enda organisatsiooni andmete pärimine + + Tagastab asutuse andmed + + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._organizations_me_serialize( + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": "Organization", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Tagastab asutuse andmed # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def organizations_me_without_preload_content( + self, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Päringu teostaja enda organisatsiooni andmete pärimine - >>> thread = api.organizations_me_with_http_info(evr_language, async_req=True) - >>> result = thread.get() + Tagastab asutuse andmed :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Organization, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._organizations_me_serialize( + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method organizations_me" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "401": "ProblemDetails", + "200": "Organization", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _organizations_me_serialize( + self, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "403": "ProblemDetails", - "401": "ProblemDetails", - "200": "Organization", - } - - return self.api_client.call_api( - "/api/me", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/me", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) diff --git a/pyevr/openapi_client/api/place_of_deliveries_api.py b/pyevr/openapi_client/api/place_of_deliveries_api.py index 4acb783..6ad3b01 100644 --- a/pyevr/openapi_client/api/place_of_deliveries_api.py +++ b/pyevr/openapi_client/api/place_of_deliveries_api.py @@ -1,28 +1,24 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings +from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import validate_arguments, ValidationError - +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call from typing_extensions import Annotated -from pydantic import Field, StrictStr, conint - -from typing import Optional +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse from pyevr.openapi_client.models.paged_result_of_place_of_delivery import ( PagedResultOfPlaceOfDelivery, ) @@ -30,10 +26,7 @@ from pyevr.openapi_client.models.put_place_of_delivery_request import ( PutPlaceOfDeliveryRequest, ) - -from pyevr.openapi_client.api_client import ApiClient -from pyevr.openapi_client.api_response import ApiResponse -from pyevr.openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from pyevr.openapi_client.rest import RESTResponseType class PlaceOfDeliveriesApi: @@ -48,10 +41,10 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def place_of_deliveries_add_or_update( self, - code: Annotated[StrictStr, Field(..., description="Kood")], + code: Annotated[StrictStr, Field(description="Kood")], put_place_of_delivery_request: PutPlaceOfDeliveryRequest, evr_language: Annotated[ Optional[StrictStr], @@ -59,16 +52,21 @@ def place_of_deliveries_add_or_update( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> None: # noqa: E501 - """Tarnekoha lisamine ja muutmine # noqa: E501 - - Lisab uue tarnekoha. Kui antud koodiga tarnekoht juba eksisteerib, siis muudab olemasolevat tarnekohta. Loomisel märgitakse päringu tegija tarnekoha omanikuks. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Tarnekoha lisamine ja muutmine - >>> thread = api.place_of_deliveries_add_or_update(code, put_place_of_delivery_request, evr_language, async_req=True) - >>> result = thread.get() + Lisab uue tarnekoha. Kui antud koodiga tarnekoht juba eksisteerib, siis muudab olemasolevat tarnekohta. Loomisel märgitakse päringu tegija tarnekoha omanikuks. :param code: Kood (required) :type code: str @@ -76,29 +74,57 @@ def place_of_deliveries_add_or_update( :type put_place_of_delivery_request: PutPlaceOfDeliveryRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the place_of_deliveries_add_or_update_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.place_of_deliveries_add_or_update_with_http_info( - code, put_place_of_delivery_request, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._place_of_deliveries_add_or_update_serialize( + code=code, + put_place_of_delivery_request=put_place_of_delivery_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def place_of_deliveries_add_or_update_with_http_info( self, - code: Annotated[StrictStr, Field(..., description="Kood")], + code: Annotated[StrictStr, Field(description="Kood")], put_place_of_delivery_request: PutPlaceOfDeliveryRequest, evr_language: Annotated[ Optional[StrictStr], @@ -106,16 +132,101 @@ def place_of_deliveries_add_or_update_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Tarnekoha lisamine ja muutmine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Tarnekoha lisamine ja muutmine + + Lisab uue tarnekoha. Kui antud koodiga tarnekoht juba eksisteerib, siis muudab olemasolevat tarnekohta. Loomisel märgitakse päringu tegija tarnekoha omanikuks. + + :param code: Kood (required) + :type code: str + :param put_place_of_delivery_request: (required) + :type put_place_of_delivery_request: PutPlaceOfDeliveryRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._place_of_deliveries_add_or_update_serialize( + code=code, + put_place_of_delivery_request=put_place_of_delivery_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - Lisab uue tarnekoha. Kui antud koodiga tarnekoht juba eksisteerib, siis muudab olemasolevat tarnekohta. Loomisel märgitakse päringu tegija tarnekoha omanikuks. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - >>> thread = api.place_of_deliveries_add_or_update_with_http_info(code, put_place_of_delivery_request, evr_language, async_req=True) - >>> result = thread.get() + @validate_call + def place_of_deliveries_add_or_update_without_preload_content( + self, + code: Annotated[StrictStr, Field(description="Kood")], + put_place_of_delivery_request: PutPlaceOfDeliveryRequest, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Tarnekoha lisamine ja muutmine + + Lisab uue tarnekoha. Kui antud koodiga tarnekoht juba eksisteerib, siis muudab olemasolevat tarnekohta. Loomisel märgitakse päringu tegija tarnekoha omanikuks. :param code: Kood (required) :type code: str @@ -123,120 +234,123 @@ def place_of_deliveries_add_or_update_with_http_info( :type put_place_of_delivery_request: PutPlaceOfDeliveryRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = ["code", "put_place_of_delivery_request", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._place_of_deliveries_add_or_update_serialize( + code=code, + put_place_of_delivery_request=put_place_of_delivery_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_of_deliveries_add_or_update" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _place_of_deliveries_add_or_update_serialize( + self, + code, + put_place_of_delivery_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params["code"]: - _path_params["code"] = _params["code"] - + if code is not None: + _path_params["code"] = code # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params["put_place_of_delivery_request"] is not None: - _body_params = _params["put_place_of_delivery_request"] + if put_place_of_delivery_request is not None: + _body_params = put_place_of_delivery_request # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get( - "_content_type", - self.api_client.select_header_content_type(["application/json"]), - ) - if _content_types_list: - _header_params["Content-Type"] = _content_types_list + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - "/api/placeofdeliveries/{code}", - "PUT", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/api/placeofdeliveries/{code}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def place_of_deliveries_get( self, code: Annotated[ - StrictStr, Field(..., description="Päritava tarnekoha kood (tõstutundlik)") + StrictStr, Field(description="Päritava tarnekoha kood (tõstutundlik)") ], evr_language: Annotated[ Optional[StrictStr], @@ -244,45 +358,77 @@ def place_of_deliveries_get( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PlaceOfDelivery: # noqa: E501 - """Tarnekoha pärimine # noqa: E501 - - Tagastab koodile vastava tarnekoha. Pärida saab ainult enda asutusele kuuluvat tarnekohta. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PlaceOfDelivery: + """Tarnekoha pärimine - >>> thread = api.place_of_deliveries_get(code, evr_language, async_req=True) - >>> result = thread.get() + Tagastab koodile vastava tarnekoha. Pärida saab ainult enda asutusele kuuluvat tarnekohta. :param code: Päritava tarnekoha kood (tõstutundlik) (required) :type code: str :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PlaceOfDelivery - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the place_of_deliveries_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.place_of_deliveries_get_with_http_info( - code, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._place_of_deliveries_get_serialize( + code=code, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "PlaceOfDelivery", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def place_of_deliveries_get_with_http_info( self, code: Annotated[ - StrictStr, Field(..., description="Päritava tarnekoha kood (tõstutundlik)") + StrictStr, Field(description="Päritava tarnekoha kood (tõstutundlik)") ], evr_language: Annotated[ Optional[StrictStr], @@ -290,125 +436,203 @@ def place_of_deliveries_get_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Tarnekoha pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PlaceOfDelivery]: + """Tarnekoha pärimine + + Tagastab koodile vastava tarnekoha. Pärida saab ainult enda asutusele kuuluvat tarnekohta. + + :param code: Päritava tarnekoha kood (tõstutundlik) (required) + :type code: str + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._place_of_deliveries_get_serialize( + code=code, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - Tagastab koodile vastava tarnekoha. Pärida saab ainult enda asutusele kuuluvat tarnekohta. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "PlaceOfDelivery", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - >>> thread = api.place_of_deliveries_get_with_http_info(code, evr_language, async_req=True) - >>> result = thread.get() + @validate_call + def place_of_deliveries_get_without_preload_content( + self, + code: Annotated[ + StrictStr, Field(description="Päritava tarnekoha kood (tõstutundlik)") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Tarnekoha pärimine + + Tagastab koodile vastava tarnekoha. Pärida saab ainult enda asutusele kuuluvat tarnekohta. :param code: Päritava tarnekoha kood (tõstutundlik) (required) :type code: str :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PlaceOfDelivery, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["code", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._place_of_deliveries_get_serialize( + code=code, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_of_deliveries_get" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "PlaceOfDelivery", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _place_of_deliveries_get_serialize( + self, + code, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params["code"]: - _path_params["code"] = _params["code"] - + if code is not None: + _path_params["code"] = code # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "401": "ProblemDetails", - "403": "ProblemDetails", - "404": "ProblemDetails", - "200": "PlaceOfDelivery", - } - - return self.api_client.call_api( - "/api/placeofdeliveries/{code}", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/placeofdeliveries/{code}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def place_of_deliveries_list( self, name_contains: Annotated[ @@ -436,11 +660,11 @@ def place_of_deliveries_list( ), ] = None, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -449,16 +673,21 @@ def place_of_deliveries_list( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PagedResultOfPlaceOfDelivery: # noqa: E501 - """Tarnekohtade pärimine # noqa: E501 - - Tagastab filtritele vastavad aktiivsed avalikud tarnekohad ja kõik ettevõttega seotud tarnekohad. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PagedResultOfPlaceOfDelivery: + """Tarnekohtade pärimine - >>> thread = api.place_of_deliveries_list(name_contains, code_starts_with, register_code, address, page, page_size, evr_language, async_req=True) - >>> result = thread.get() + Tagastab filtritele vastavad aktiivsed tarnekohad ja kõik ettevõttega seotud tarnekohad. :param name_contains: Filtreerib tarnekohad, mille nimi sisaldab otsinguterminit :type name_contains: str @@ -474,33 +703,58 @@ def place_of_deliveries_list( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PagedResultOfPlaceOfDelivery - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the place_of_deliveries_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.place_of_deliveries_list_with_http_info( - name_contains, - code_starts_with, - register_code, - address, - page, - page_size, - evr_language, - **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._place_of_deliveries_list_serialize( + name_contains=name_contains, + code_starts_with=code_starts_with, + register_code=register_code, + address=address, + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfPlaceOfDelivery", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def place_of_deliveries_list_with_http_info( self, name_contains: Annotated[ @@ -528,11 +782,11 @@ def place_of_deliveries_list_with_http_info( ), ] = None, page: Annotated[ - Optional[conint(strict=True, le=2147483647, ge=1)], + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], Field(description="Tagastatav lehekülg"), ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Tagastatava lehekülje suurus"), ] = None, evr_language: Annotated[ @@ -541,16 +795,143 @@ def place_of_deliveries_list_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Tarnekohtade pärimine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PagedResultOfPlaceOfDelivery]: + """Tarnekohtade pärimine + + Tagastab filtritele vastavad aktiivsed tarnekohad ja kõik ettevõttega seotud tarnekohad. + + :param name_contains: Filtreerib tarnekohad, mille nimi sisaldab otsinguterminit + :type name_contains: str + :param code_starts_with: Filtreerib tarnekohad, mille kood algab otsinguterminiga (tõstutundlik) + :type code_starts_with: str + :param register_code: Filtreerib ettevõtte tarnekohad, mille registrikood vastab otsinguterminile + :type register_code: str + :param address: Vabatekstiline aadressi otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA * jutumärkides tekst: otsitakse jutumärkides olevat lauset * OR: loogiline VÕI operaator sõnade vahel * -: loogiline EITUS + :type address: str + :param page: Tagastatav lehekülg + :type page: int + :param page_size: Tagastatava lehekülje suurus + :type page_size: int + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._place_of_deliveries_list_serialize( + name_contains=name_contains, + code_starts_with=code_starts_with, + register_code=register_code, + address=address, + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfPlaceOfDelivery", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Tagastab filtritele vastavad aktiivsed avalikud tarnekohad ja kõik ettevõttega seotud tarnekohad. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def place_of_deliveries_list_without_preload_content( + self, + name_contains: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib tarnekohad, mille nimi sisaldab otsinguterminit" + ), + ] = None, + code_starts_with: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib tarnekohad, mille kood algab otsinguterminiga (tõstutundlik)" + ), + ] = None, + register_code: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib ettevõtte tarnekohad, mille registrikood vastab otsinguterminile" + ), + ] = None, + address: Annotated[ + Optional[StrictStr], + Field( + description="Vabatekstiline aadressi otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA * jutumärkides tekst: otsitakse jutumärkides olevat lauset * OR: loogiline VÕI operaator sõnade vahel * -: loogiline EITUS" + ), + ] = None, + page: Annotated[ + Optional[Annotated[int, Field(le=2147483647, strict=True, ge=1)]], + Field(description="Tagastatav lehekülg"), + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], + Field(description="Tagastatava lehekülje suurus"), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Tarnekohtade pärimine - >>> thread = api.place_of_deliveries_list_with_http_info(name_contains, code_starts_with, register_code, address, page, page_size, evr_language, async_req=True) - >>> result = thread.get() + Tagastab filtritele vastavad aktiivsed tarnekohad ja kõik ettevõttega seotud tarnekohad. :param name_contains: Filtreerib tarnekohad, mille nimi sisaldab otsinguterminit :type name_contains: str @@ -566,129 +947,126 @@ def place_of_deliveries_list_with_http_info( :type page_size: int :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PagedResultOfPlaceOfDelivery, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - "name_contains", - "code_starts_with", - "register_code", - "address", - "page", - "page_size", - "evr_language", - ] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] + """ # noqa: E501 + + _param = self._place_of_deliveries_list_serialize( + name_contains=name_contains, + code_starts_with=code_starts_with, + register_code=register_code, + address=address, + page=page, + page_size=page_size, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, ) - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method place_of_deliveries_list" % _key - ) - _params[_key] = _val - del _params["kwargs"] + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "400": "ValidationResult", + "200": "PagedResultOfPlaceOfDelivery", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _place_of_deliveries_list_serialize( + self, + name_contains, + code_starts_with, + register_code, + address, + page, + page_size, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - # process the query parameters - _query_params = [] - if _params.get("name_contains") is not None: # noqa: E501 - _query_params.append(("name_contains", _params["name_contains"])) + if name_contains is not None: + _query_params.append(("name_contains", name_contains)) - if _params.get("code_starts_with") is not None: # noqa: E501 - _query_params.append(("code_starts_with", _params["code_starts_with"])) + if code_starts_with is not None: + _query_params.append(("code_starts_with", code_starts_with)) - if _params.get("register_code") is not None: # noqa: E501 - _query_params.append(("register_code", _params["register_code"])) + if register_code is not None: + _query_params.append(("register_code", register_code)) - if _params.get("address") is not None: # noqa: E501 - _query_params.append(("address", _params["address"])) + if address is not None: + _query_params.append(("address", address)) - if _params.get("page") is not None: # noqa: E501 - _query_params.append(("page", _params["page"])) + if page is not None: + _query_params.append(("page", page)) - if _params.get("page_size") is not None: # noqa: E501 - _query_params.append(("page_size", _params["page_size"])) + if page_size is not None: + _query_params.append(("page_size", page_size)) # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "401": "ProblemDetails", - "403": "ProblemDetails", - "400": "ValidationResult", - "200": "PagedResultOfPlaceOfDelivery", - } - - return self.api_client.call_api( - "/api/placeofdeliveries", - "GET", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/placeofdeliveries", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) diff --git a/pyevr/openapi_client/api/timber_reports_api.py b/pyevr/openapi_client/api/timber_reports_api.py new file mode 100644 index 0000000..b989fdd --- /dev/null +++ b/pyevr/openapi_client/api/timber_reports_api.py @@ -0,0 +1,634 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import warnings +from typing import Any, Dict, List, Optional, Tuple, Union + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated + +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse +from pyevr.openapi_client.models.add_timber_report_request import AddTimberReportRequest +from pyevr.openapi_client.models.timber_report import TimberReport +from pyevr.openapi_client.rest import RESTResponseType + + +class TimberReportsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + def timber_reports_get_timber_report( + self, + waybill_number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimberReport: + """Veoselehe palkide mõõtmisraporti pärimine + + + :param waybill_number: Veoselehe number (tõstutundetu) (required) + :type waybill_number: str + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timber_reports_get_timber_report_serialize( + waybill_number=waybill_number, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "TimberReport", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def timber_reports_get_timber_report_with_http_info( + self, + waybill_number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimberReport]: + """Veoselehe palkide mõõtmisraporti pärimine + + + :param waybill_number: Veoselehe number (tõstutundetu) (required) + :type waybill_number: str + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timber_reports_get_timber_report_serialize( + waybill_number=waybill_number, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "TimberReport", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def timber_reports_get_timber_report_without_preload_content( + self, + waybill_number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehe palkide mõõtmisraporti pärimine + + + :param waybill_number: Veoselehe number (tõstutundetu) (required) + :type waybill_number: str + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timber_reports_get_timber_report_serialize( + waybill_number=waybill_number, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "TimberReport", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _timber_reports_get_timber_report_serialize( + self, + waybill_number, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if waybill_number is not None: + _path_params["waybillNumber"] = waybill_number + # process the query parameters + # process the header parameters + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/waybills/{waybillNumber}/timberreports", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def timber_reports_upsert_timber_report( + self, + waybill_number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + add_timber_report_request: Annotated[ + AddTimberReportRequest, Field(description="Palkide mõõtmisraporti andmed") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TimberReport: + """Veoselehele palgi mõõtmisraporti lisamine + + Lisab veoselehele palgi mõõtmisraporti. Mõõtmisraporti saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. + + :param waybill_number: Veoselehe number (tõstutundetu) (required) + :type waybill_number: str + :param add_timber_report_request: Palkide mõõtmisraporti andmed (required) + :type add_timber_report_request: AddTimberReportRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timber_reports_upsert_timber_report_serialize( + waybill_number=waybill_number, + add_timber_report_request=add_timber_report_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TimberReport", + "400": "ValidationResult", + "403": "ProblemDetails", + "404": "ProblemDetails", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def timber_reports_upsert_timber_report_with_http_info( + self, + waybill_number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + add_timber_report_request: Annotated[ + AddTimberReportRequest, Field(description="Palkide mõõtmisraporti andmed") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TimberReport]: + """Veoselehele palgi mõõtmisraporti lisamine + + Lisab veoselehele palgi mõõtmisraporti. Mõõtmisraporti saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. + + :param waybill_number: Veoselehe number (tõstutundetu) (required) + :type waybill_number: str + :param add_timber_report_request: Palkide mõõtmisraporti andmed (required) + :type add_timber_report_request: AddTimberReportRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timber_reports_upsert_timber_report_serialize( + waybill_number=waybill_number, + add_timber_report_request=add_timber_report_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TimberReport", + "400": "ValidationResult", + "403": "ProblemDetails", + "404": "ProblemDetails", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def timber_reports_upsert_timber_report_without_preload_content( + self, + waybill_number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + add_timber_report_request: Annotated[ + AddTimberReportRequest, Field(description="Palkide mõõtmisraporti andmed") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehele palgi mõõtmisraporti lisamine + + Lisab veoselehele palgi mõõtmisraporti. Mõõtmisraporti saab lisada \"koorem maas\" staatuses veoselehele sellele märgitud veose saaja või tema volitatud mõõtja. + + :param waybill_number: Veoselehe number (tõstutundetu) (required) + :type waybill_number: str + :param add_timber_report_request: Palkide mõõtmisraporti andmed (required) + :type add_timber_report_request: AddTimberReportRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._timber_reports_upsert_timber_report_serialize( + waybill_number=waybill_number, + add_timber_report_request=add_timber_report_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "TimberReport", + "400": "ValidationResult", + "403": "ProblemDetails", + "404": "ProblemDetails", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _timber_reports_upsert_timber_report_serialize( + self, + waybill_number, + add_timber_report_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if waybill_number is not None: + _path_params["waybillNumber"] = waybill_number + # process the query parameters + # process the header parameters + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language + # process the form parameters + # process the body parameter + if add_timber_report_request is not None: + _body_params = add_timber_report_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/api/waybills/{waybillNumber}/timberreports", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/pyevr/openapi_client/api/waybills_api.py b/pyevr/openapi_client/api/waybills_api.py index 69e5d99..a8826ab 100644 --- a/pyevr/openapi_client/api/waybills_api.py +++ b/pyevr/openapi_client/api/waybills_api.py @@ -1,30 +1,25 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 -import io import warnings - -from pydantic import validate_arguments, ValidationError - -from typing_extensions import Annotated from datetime import datetime +from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import Field, StrictBool, StrictInt, StrictStr, conint - -from typing import Optional +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call +from typing_extensions import Annotated +from pyevr.openapi_client.api_client import ApiClient, RequestSerialized +from pyevr.openapi_client.api_response import ApiResponse from pyevr.openapi_client.models.add_shipments_to_waybill_request import ( AddShipmentsToWaybillRequest, ) @@ -36,10 +31,7 @@ from pyevr.openapi_client.models.waybill import Waybill from pyevr.openapi_client.models.waybill_sort_field import WaybillSortField from pyevr.openapi_client.models.waybill_status import WaybillStatus - -from pyevr.openapi_client.api_client import ApiClient -from pyevr.openapi_client.api_response import ApiResponse -from pyevr.openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from pyevr.openapi_client.rest import RESTResponseType class WaybillsApi: @@ -54,11 +46,11 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments + @validate_call def waybills_add_note( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], add_waybill_note_request: AddWaybillNoteRequest, evr_language: Annotated[ @@ -67,16 +59,21 @@ def waybills_add_note( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> None: # noqa: E501 - """Veoselehe märkuse lisamine # noqa: E501 - - Lisab veoselehele uue märkuse. Olemasolevaid märkuseid ei muudeta. Märkust saavad lisada kõik veoselehega seotud osapooled (v.a volitatud vaatleja). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Veoselehe märkuse lisamine - >>> thread = api.waybills_add_note(number, add_waybill_note_request, evr_language, async_req=True) - >>> result = thread.get() + Lisab veoselehele uue märkuse. Olemasolevaid märkuseid ei muudeta. Märkust saavad lisada kõik veoselehega seotud osapooled (v.a volitatud vaatleja). :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -84,30 +81,59 @@ def waybills_add_note( :type add_waybill_note_request: AddWaybillNoteRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_add_note_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_add_note_with_http_info( - number, add_waybill_note_request, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._waybills_add_note_serialize( + number=number, + add_waybill_note_request=add_waybill_note_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "400": "ValidationResult", + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def waybills_add_note_with_http_info( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], add_waybill_note_request: AddWaybillNoteRequest, evr_language: Annotated[ @@ -116,16 +142,104 @@ def waybills_add_note_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehe märkuse lisamine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Veoselehe märkuse lisamine + + Lisab veoselehele uue märkuse. Olemasolevaid märkuseid ei muudeta. Märkust saavad lisada kõik veoselehega seotud osapooled (v.a volitatud vaatleja). + + :param number: Veoselehe number (tõstutundetu) (required) + :type number: str + :param add_waybill_note_request: (required) + :type add_waybill_note_request: AddWaybillNoteRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_add_note_serialize( + number=number, + add_waybill_note_request=add_waybill_note_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "400": "ValidationResult", + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Lisab veoselehele uue märkuse. Olemasolevaid märkuseid ei muudeta. Märkust saavad lisada kõik veoselehega seotud osapooled (v.a volitatud vaatleja). # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def waybills_add_note_without_preload_content( + self, + number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + add_waybill_note_request: AddWaybillNoteRequest, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehe märkuse lisamine - >>> thread = api.waybills_add_note_with_http_info(number, add_waybill_note_request, evr_language, async_req=True) - >>> result = thread.get() + Lisab veoselehele uue märkuse. Olemasolevaid märkuseid ei muudeta. Märkust saavad lisada kõik veoselehega seotud osapooled (v.a volitatud vaatleja). :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -133,120 +247,124 @@ def waybills_add_note_with_http_info( :type add_waybill_note_request: AddWaybillNoteRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = ["number", "add_waybill_note_request", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_add_note" % _key - ) - _params[_key] = _val - del _params["kwargs"] + """ # noqa: E501 + + _param = self._waybills_add_note_serialize( + number=number, + add_waybill_note_request=add_waybill_note_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "400": "ValidationResult", + "200": None, + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _waybills_add_note_serialize( + self, + number, + add_waybill_note_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] - + if number is not None: + _path_params["number"] = number # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params["add_waybill_note_request"] is not None: - _body_params = _params["add_waybill_note_request"] + if add_waybill_note_request is not None: + _body_params = add_waybill_note_request # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get( - "_content_type", - self.api_client.select_header_content_type(["application/json"]), - ) - if _content_types_list: - _header_params["Content-Type"] = _content_types_list + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - "/api/waybills/{number}/note", - "POST", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/waybills/{number}/note", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def waybills_add_shipments( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], add_shipments_to_waybill_request: AddShipmentsToWaybillRequest, evr_language: Annotated[ @@ -255,16 +373,21 @@ def waybills_add_shipments( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> None: # noqa: E501 - """Veoselehele veose lisamine # noqa: E501 - - Lisab veoselehele uue veose. Veoseid saab lisada veoselehele vedaja ja veoselehe looja. Veoseid saab lisada ainult veos olevatele veoselehtedele. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Veoselehele veose lisamine - >>> thread = api.waybills_add_shipments(number, add_shipments_to_waybill_request, evr_language, async_req=True) - >>> result = thread.get() + Lisab veoselehele uue veose. Veoseid saab lisada veoselehele vedaja ja veoselehe looja. Veoseid saab lisada ainult veos olevatele veoselehtedele. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -272,30 +395,59 @@ def waybills_add_shipments( :type add_shipments_to_waybill_request: AddShipmentsToWaybillRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_add_shipments_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_add_shipments_with_http_info( - number, add_shipments_to_waybill_request, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._waybills_add_shipments_serialize( + number=number, + add_shipments_to_waybill_request=add_shipments_to_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def waybills_add_shipments_with_http_info( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], add_shipments_to_waybill_request: AddShipmentsToWaybillRequest, evr_language: Annotated[ @@ -304,16 +456,104 @@ def waybills_add_shipments_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehele veose lisamine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Veoselehele veose lisamine + + Lisab veoselehele uue veose. Veoseid saab lisada veoselehele vedaja ja veoselehe looja. Veoseid saab lisada ainult veos olevatele veoselehtedele. + + :param number: Veoselehe number (tõstutundetu) (required) + :type number: str + :param add_shipments_to_waybill_request: (required) + :type add_shipments_to_waybill_request: AddShipmentsToWaybillRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_add_shipments_serialize( + number=number, + add_shipments_to_waybill_request=add_shipments_to_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Lisab veoselehele uue veose. Veoseid saab lisada veoselehele vedaja ja veoselehe looja. Veoseid saab lisada ainult veos olevatele veoselehtedele. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def waybills_add_shipments_without_preload_content( + self, + number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + add_shipments_to_waybill_request: AddShipmentsToWaybillRequest, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehele veose lisamine - >>> thread = api.waybills_add_shipments_with_http_info(number, add_shipments_to_waybill_request, evr_language, async_req=True) - >>> result = thread.get() + Lisab veoselehele uue veose. Veoseid saab lisada veoselehele vedaja ja veoselehe looja. Veoseid saab lisada ainult veos olevatele veoselehtedele. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -321,120 +561,124 @@ def waybills_add_shipments_with_http_info( :type add_shipments_to_waybill_request: AddShipmentsToWaybillRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = ["number", "add_shipments_to_waybill_request", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_add_shipments" % _key - ) - _params[_key] = _val - del _params["kwargs"] + """ # noqa: E501 + + _param = self._waybills_add_shipments_serialize( + number=number, + add_shipments_to_waybill_request=add_shipments_to_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _waybills_add_shipments_serialize( + self, + number, + add_shipments_to_waybill_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] - + if number is not None: + _path_params["number"] = number # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params["add_shipments_to_waybill_request"] is not None: - _body_params = _params["add_shipments_to_waybill_request"] + if add_shipments_to_waybill_request is not None: + _body_params = add_shipments_to_waybill_request # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get( - "_content_type", - self.api_client.select_header_content_type(["application/json"]), - ) - if _content_types_list: - _header_params["Content-Type"] = _content_types_list + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - "/api/waybills/{number}/shipments", - "POST", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/waybills/{number}/shipments", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def waybills_cancel( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], cancel_waybill_request: CancelWaybillRequest, evr_language: Annotated[ @@ -443,16 +687,21 @@ def waybills_cancel( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> None: # noqa: E501 - """Veoselehe tühistamine # noqa: E501 - - Tühistab veoselehe. Veoselehe staatuseks märgitakse tühistatud (status: \"cancelled\"). Veoselehe saab tühistada veoselehe looja, kuni veoseleht pole veel vastu võetud. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Veoselehe tühistamine - >>> thread = api.waybills_cancel(number, cancel_waybill_request, evr_language, async_req=True) - >>> result = thread.get() + Veoselehe saab tühistada veoselehe looja, omanik, saaja, vedaja ja alltöövõtja kuni veoseleht pole veel vastu võetud. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -460,30 +709,59 @@ def waybills_cancel( :type cancel_waybill_request: CancelWaybillRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_cancel_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_cancel_with_http_info( - number, cancel_waybill_request, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._waybills_cancel_serialize( + number=number, + cancel_waybill_request=cancel_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def waybills_cancel_with_http_info( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], cancel_waybill_request: CancelWaybillRequest, evr_language: Annotated[ @@ -492,16 +770,104 @@ def waybills_cancel_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehe tühistamine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Veoselehe tühistamine + + Veoselehe saab tühistada veoselehe looja, omanik, saaja, vedaja ja alltöövõtja kuni veoseleht pole veel vastu võetud. + + :param number: Veoselehe number (tõstutundetu) (required) + :type number: str + :param cancel_waybill_request: (required) + :type cancel_waybill_request: CancelWaybillRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_cancel_serialize( + number=number, + cancel_waybill_request=cancel_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Tühistab veoselehe. Veoselehe staatuseks märgitakse tühistatud (status: \"cancelled\"). Veoselehe saab tühistada veoselehe looja, kuni veoseleht pole veel vastu võetud. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def waybills_cancel_without_preload_content( + self, + number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + cancel_waybill_request: CancelWaybillRequest, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehe tühistamine - >>> thread = api.waybills_cancel_with_http_info(number, cancel_waybill_request, evr_language, async_req=True) - >>> result = thread.get() + Veoselehe saab tühistada veoselehe looja, omanik, saaja, vedaja ja alltöövõtja kuni veoseleht pole veel vastu võetud. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -509,120 +875,124 @@ def waybills_cancel_with_http_info( :type cancel_waybill_request: CancelWaybillRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = ["number", "cancel_waybill_request", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_cancel" % _key - ) - _params[_key] = _val - del _params["kwargs"] + """ # noqa: E501 + + _param = self._waybills_cancel_serialize( + number=number, + cancel_waybill_request=cancel_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _waybills_cancel_serialize( + self, + number, + cancel_waybill_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] - + if number is not None: + _path_params["number"] = number # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params["cancel_waybill_request"] is not None: - _body_params = _params["cancel_waybill_request"] + if cancel_waybill_request is not None: + _body_params = cancel_waybill_request # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get( - "_content_type", - self.api_client.select_header_content_type(["application/json"]), - ) - if _content_types_list: - _header_params["Content-Type"] = _content_types_list + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - "/api/waybills/{number}/cancel", - "POST", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/waybills/{number}/cancel", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def waybills_finish( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], evr_language: Annotated[ Optional[StrictStr], @@ -630,45 +1000,78 @@ def waybills_finish( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> None: # noqa: E501 - """Veoselehe lõpetamine # noqa: E501 - - Lõpetab veoselehe ja veoselehe staatuseks märgitakse \"veoseleht lõpetatud\" (status: \"finished\"). Veoselehte saavad lõpetada veoselehele märgitud saaja ning volitatud mõõtja ja seda ainult \"koorem maas\" staatuses. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Veoselehe lõpetamine - >>> thread = api.waybills_finish(number, evr_language, async_req=True) - >>> result = thread.get() + Lõpetab veoselehe ja veoselehe staatuseks märgitakse \"veoseleht lõpetatud\" (status: \"finished\"). Veoselehte saavad lõpetada veoselehele märgitud saaja ning volitatud mõõtja ja seda ainult \"koorem maas\" staatuses. :param number: Veoselehe number (tõstutundetu) (required) :type number: str :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_finish_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_finish_with_http_info( - number, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._waybills_finish_serialize( + number=number, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def waybills_finish_with_http_info( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], evr_language: Annotated[ Optional[StrictStr], @@ -676,120 +1079,205 @@ def waybills_finish_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehe lõpetamine # noqa: E501 - - Lõpetab veoselehe ja veoselehe staatuseks märgitakse \"veoseleht lõpetatud\" (status: \"finished\"). Veoselehte saavad lõpetada veoselehele märgitud saaja ning volitatud mõõtja ja seda ainult \"koorem maas\" staatuses. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Veoselehe lõpetamine - >>> thread = api.waybills_finish_with_http_info(number, evr_language, async_req=True) - >>> result = thread.get() + Lõpetab veoselehe ja veoselehe staatuseks märgitakse \"veoseleht lõpetatud\" (status: \"finished\"). Veoselehte saavad lõpetada veoselehele märgitud saaja ning volitatud mõõtja ja seda ainult \"koorem maas\" staatuses. :param number: Veoselehe number (tõstutundetu) (required) :type number: str :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = ["number", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_finish" % _key - ) - _params[_key] = _val - del _params["kwargs"] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] + """ # noqa: E501 + + _param = self._waybills_finish_serialize( + number=number, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def waybills_finish_without_preload_content( + self, + number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehe lõpetamine + + Lõpetab veoselehe ja veoselehe staatuseks märgitakse \"veoseleht lõpetatud\" (status: \"finished\"). Veoselehte saavad lõpetada veoselehele märgitud saaja ning volitatud mõõtja ja seda ainult \"koorem maas\" staatuses. + + :param number: Veoselehe number (tõstutundetu) (required) + :type number: str + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_finish_serialize( + number=number, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + def _waybills_finish_serialize( + self, + number, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if number is not None: + _path_params["number"] = number + # process the query parameters + # process the header parameters + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - "/api/waybills/{number}/finish", - "POST", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/waybills/{number}/finish", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def waybills_list( self, created_after: Annotated[ @@ -860,6 +1348,12 @@ def waybills_list( description="Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik)" ), ] = None, + subcontractor_code: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik)" + ), + ] = None, text: Annotated[ Optional[StrictStr], Field( @@ -874,7 +1368,7 @@ def waybills_list( Optional[StrictInt], Field(description="Määrab tagastatava lehekülje") ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Määrab lehekülje suuruse"), ] = None, include_latest_measurements: Annotated[ @@ -883,22 +1377,33 @@ def waybills_list( description="Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata)" ), ] = None, + include_timber_report: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata)" + ), + ] = None, evr_language: Annotated[ Optional[StrictStr], Field( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> PagedResultOfWaybill: # noqa: E501 - """Veoselehtede pärimine # noqa: E501 - - Tagastab filtritele vastavad veoselehed. Veoselehti saavad pärida ainult nendega seotud asutused. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PagedResultOfWaybill: + """Veoselehtede pärimine - >>> thread = api.waybills_list(created_after, created_before, last_modified_after, last_modified_before, status, owner_code, transporter_code, receiver_code, van_registration_number, trailer_registration_number, driver_id_code, place_of_delivery_code, text, sort, page, page_size, include_latest_measurements, evr_language, async_req=True) - >>> result = thread.get() + Tagastab filtritele vastavad veoselehed. Veoselehti saavad pärida ainult nendega seotud asutused. :param created_after: Filtreerib veoselehed, mis on loodud hiljem või samal ajal. Kui 'created_after' ja 'created_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse. :type created_after: datetime @@ -924,6 +1429,8 @@ def waybills_list( :type driver_id_code: str :param place_of_delivery_code: Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik) :type place_of_delivery_code: str + :param subcontractor_code: Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik) + :type subcontractor_code: str :param text: Vabateksti otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA. * jutumärkides tekst: otsitakse jutumärkides olevat lauset. * OR: loogiline VÕI operaator sõnade vahel. * -: loogiline EITUS. :type text: str :param sort: Sorteerib tulemused valitud välja järgi @@ -934,46 +1441,75 @@ def waybills_list( :type page_size: int :param include_latest_measurements: Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) :type include_latest_measurements: bool + :param include_timber_report: Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) + :type include_timber_report: bool :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PagedResultOfWaybill - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_list_with_http_info( - created_after, - created_before, - last_modified_after, - last_modified_before, - status, - owner_code, - transporter_code, - receiver_code, - van_registration_number, - trailer_registration_number, - driver_id_code, - place_of_delivery_code, - text, - sort, - page, - page_size, - include_latest_measurements, - evr_language, - **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._waybills_get_serialize( + created_after=created_after, + created_before=created_before, + last_modified_after=last_modified_after, + last_modified_before=last_modified_before, + status=status, + owner_code=owner_code, + transporter_code=transporter_code, + receiver_code=receiver_code, + van_registration_number=van_registration_number, + trailer_registration_number=trailer_registration_number, + driver_id_code=driver_id_code, + place_of_delivery_code=place_of_delivery_code, + subcontractor_code=subcontractor_code, + text=text, + sort=sort, + page=page, + page_size=page_size, + include_latest_measurements=include_latest_measurements, + include_timber_report=include_timber_report, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "200": "PagedResultOfWaybill", + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def waybills_list_with_http_info( self, created_after: Annotated[ @@ -1044,6 +1580,12 @@ def waybills_list_with_http_info( description="Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik)" ), ] = None, + subcontractor_code: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik)" + ), + ] = None, text: Annotated[ Optional[StrictStr], Field( @@ -1058,7 +1600,7 @@ def waybills_list_with_http_info( Optional[StrictInt], Field(description="Määrab tagastatava lehekülje") ] = None, page_size: Annotated[ - Optional[conint(strict=True, le=500, ge=1)], + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], Field(description="Määrab lehekülje suuruse"), ] = None, include_latest_measurements: Annotated[ @@ -1067,22 +1609,33 @@ def waybills_list_with_http_info( description="Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata)" ), ] = None, + include_timber_report: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata)" + ), + ] = None, evr_language: Annotated[ Optional[StrictStr], Field( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehtede pärimine # noqa: E501 - - Tagastab filtritele vastavad veoselehed. Veoselehti saavad pärida ainult nendega seotud asutused. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PagedResultOfWaybill]: + """Veoselehtede pärimine - >>> thread = api.waybills_list_with_http_info(created_after, created_before, last_modified_after, last_modified_before, status, owner_code, transporter_code, receiver_code, van_registration_number, trailer_registration_number, driver_id_code, place_of_delivery_code, text, sort, page, page_size, include_latest_measurements, evr_language, async_req=True) - >>> result = thread.get() + Tagastab filtritele vastavad veoselehed. Veoselehti saavad pärida ainult nendega seotud asutused. :param created_after: Filtreerib veoselehed, mis on loodud hiljem või samal ajal. Kui 'created_after' ja 'created_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse. :type created_after: datetime @@ -1108,6 +1661,8 @@ def waybills_list_with_http_info( :type driver_id_code: str :param place_of_delivery_code: Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik) :type place_of_delivery_code: str + :param subcontractor_code: Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik) + :type subcontractor_code: str :param text: Vabateksti otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA. * jutumärkides tekst: otsitakse jutumärkides olevat lauset. * OR: loogiline VÕI operaator sõnade vahel. * -: loogiline EITUS. :type text: str :param sort: Sorteerib tulemused valitud välja järgi @@ -1118,610 +1673,1126 @@ def waybills_list_with_http_info( :type page_size: int :param include_latest_measurements: Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) :type include_latest_measurements: bool + :param include_timber_report: Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) + :type include_timber_report: bool :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PagedResultOfWaybill, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - "created_after", - "created_before", - "last_modified_after", - "last_modified_before", - "status", - "owner_code", - "transporter_code", - "receiver_code", - "van_registration_number", - "trailer_registration_number", - "driver_id_code", - "place_of_delivery_code", - "text", - "sort", - "page", - "page_size", - "include_latest_measurements", - "evr_language", - ] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_list" % _key - ) - _params[_key] = _val - del _params["kwargs"] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - - # process the query parameters - _query_params = [] - if _params.get("created_after") is not None: # noqa: E501 - if isinstance(_params["created_after"], datetime): - _query_params.append( - ( - "created_after", - _params["created_after"].strftime( - self.api_client.configuration.datetime_format - ), - ) - ) - else: - _query_params.append(("created_after", _params["created_after"])) - - if _params.get("created_before") is not None: # noqa: E501 - if isinstance(_params["created_before"], datetime): - _query_params.append( - ( - "created_before", - _params["created_before"].strftime( - self.api_client.configuration.datetime_format - ), - ) - ) - else: - _query_params.append(("created_before", _params["created_before"])) - - if _params.get("last_modified_after") is not None: # noqa: E501 - if isinstance(_params["last_modified_after"], datetime): - _query_params.append( - ( - "last_modified_after", - _params["last_modified_after"].strftime( - self.api_client.configuration.datetime_format - ), - ) - ) - else: - _query_params.append( - ("last_modified_after", _params["last_modified_after"]) - ) - - if _params.get("last_modified_before") is not None: # noqa: E501 - if isinstance(_params["last_modified_before"], datetime): - _query_params.append( - ( - "last_modified_before", - _params["last_modified_before"].strftime( - self.api_client.configuration.datetime_format - ), - ) - ) - else: - _query_params.append( - ("last_modified_before", _params["last_modified_before"]) - ) - - if _params.get("status") is not None: # noqa: E501 - _query_params.append(("status", _params["status"].value)) - - if _params.get("owner_code") is not None: # noqa: E501 - _query_params.append(("owner_code", _params["owner_code"])) - - if _params.get("transporter_code") is not None: # noqa: E501 - _query_params.append(("transporter_code", _params["transporter_code"])) - - if _params.get("receiver_code") is not None: # noqa: E501 - _query_params.append(("receiver_code", _params["receiver_code"])) - - if _params.get("van_registration_number") is not None: # noqa: E501 - _query_params.append( - ("van_registration_number", _params["van_registration_number"]) - ) - - if _params.get("trailer_registration_number") is not None: # noqa: E501 - _query_params.append( - ("trailer_registration_number", _params["trailer_registration_number"]) - ) - - if _params.get("driver_id_code") is not None: # noqa: E501 - _query_params.append(("driver_id_code", _params["driver_id_code"])) - - if _params.get("place_of_delivery_code") is not None: # noqa: E501 - _query_params.append( - ("place_of_delivery_code", _params["place_of_delivery_code"]) - ) - - if _params.get("text") is not None: # noqa: E501 - _query_params.append(("text", _params["text"])) - - if _params.get("sort") is not None: # noqa: E501 - _query_params.append(("sort", _params["sort"].value)) - - if _params.get("page") is not None: # noqa: E501 - _query_params.append(("page", _params["page"])) - - if _params.get("page_size") is not None: # noqa: E501 - _query_params.append(("page_size", _params["page_size"])) - - if _params.get("include_latest_measurements") is not None: # noqa: E501 - _query_params.append( - ("includeLatestMeasurements", _params["include_latest_measurements"]) - ) - - # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 - - # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 + """ # noqa: E501 + + _param = self._waybills_get_serialize( + created_after=created_after, + created_before=created_before, + last_modified_after=last_modified_after, + last_modified_before=last_modified_before, + status=status, + owner_code=owner_code, + transporter_code=transporter_code, + receiver_code=receiver_code, + van_registration_number=van_registration_number, + trailer_registration_number=trailer_registration_number, + driver_id_code=driver_id_code, + place_of_delivery_code=place_of_delivery_code, + subcontractor_code=subcontractor_code, + text=text, + sort=sort, + page=page, + page_size=page_size, + include_latest_measurements=include_latest_measurements, + include_timber_report=include_timber_report, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { "401": "ProblemDetails", "403": "ProblemDetails", "200": "PagedResultOfWaybill", "400": "ValidationResult", } - - return self.api_client.call_api( - "/api/waybills", - "GET", - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), - collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), ) - @validate_arguments - def waybills_get( + @validate_call + def waybills_get_without_preload_content( self, - number: Annotated[ - StrictStr, - Field(..., description="Päritava veoselehe number (tõstutundetu)"), - ], - include_latest_measurements: Optional[StrictBool] = None, - evr_language: Annotated[ - Optional[StrictStr], + created_after: Annotated[ + Optional[datetime], Field( - description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + description="Filtreerib veoselehed, mis on loodud hiljem või samal ajal. Kui 'created_after' ja 'created_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse." ), ] = None, - **kwargs - ) -> Waybill: # noqa: E501 - """Veoselehe pärimine # noqa: E501 - - Tagastab numbrile vastava veoselehe. Veoselehte saavad pärida ainult sellega seotud asutused. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.waybills_get(number, include_latest_measurements, evr_language, async_req=True) - >>> result = thread.get() - - :param number: Päritava veoselehe number (tõstutundetu) (required) - :type number: str - :param include_latest_measurements: - :type include_latest_measurements: bool - :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). - :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Waybill - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_get2_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_get_with_http_info( - number, include_latest_measurements, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments - def waybills_get_with_http_info( - self, - number: Annotated[ - StrictStr, - Field(..., description="Päritava veoselehe number (tõstutundetu)"), - ], - include_latest_measurements: Optional[StrictBool] = None, - evr_language: Annotated[ - Optional[StrictStr], + created_before: Annotated[ + Optional[datetime], Field( - description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + description="Filtreerib veoselehed, mis on loodud varem või samal ajal. Kui 'created_after' ja 'created_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse." ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehe pärimine # noqa: E501 - - Tagastab numbrile vastava veoselehe. Veoselehte saavad pärida ainult sellega seotud asutused. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.waybills_get_with_http_info(number, include_latest_measurements, evr_language, async_req=True) - >>> result = thread.get() - - :param number: Päritava veoselehe number (tõstutundetu) (required) - :type number: str - :param include_latest_measurements: - :type include_latest_measurements: bool - :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). - :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Waybill, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["number", "include_latest_measurements", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_get" % _key - ) - _params[_key] = _val - del _params["kwargs"] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] - - # process the query parameters - _query_params = [] - if _params.get("include_latest_measurements") is not None: # noqa: E501 - _query_params.append( - ("includeLatestMeasurements", _params["include_latest_measurements"]) - ) - - # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 - - # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = { - "401": "ProblemDetails", - "403": "ProblemDetails", - "404": "ProblemDetails", - "200": "Waybill", - } - - return self.api_client.call_api( - "/api/waybills/{number}", - "GET", - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), - collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), - ) - - @validate_arguments - def waybills_post( - self, - start_waybill_request: Annotated[ - StartWaybillRequest, Field(..., description="Veoselehe andmed") - ], - evr_language: Annotated[ - Optional[StrictStr], + last_modified_after: Annotated[ + Optional[datetime], Field( - description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + description="Filtreerib veoselehed, mis on muutunud pärast määratud aega. Kui 'last_modified_after' ja 'last_modified_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse." ), ] = None, - **kwargs - ) -> str: # noqa: E501 - """Veoselehe loomine # noqa: E501 - - Loob veoselehe staatusega \"vedu alustatud\" (status: \"shipping\"). Veo alustaja peab olema ise märgitud veoselehele kas omanikuks või vedajaks. Kui metsamaterjali saaja on EVR'iga liitunud asutus, peab veoselehel märgitud tarnekoht kuuluma ka saaja asutusele. Toimingu õnnestumisel tagastatakse loodud veoselehe number. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.waybills_post(start_waybill_request, evr_language, async_req=True) - >>> result = thread.get() - - :param start_waybill_request: Veoselehe andmed (required) - :type start_waybill_request: StartWaybillRequest + last_modified_before: Annotated[ + Optional[datetime], + Field( + description="Filtreerib veoselehed, mis on muutunud enne määratud aega. Kui 'last_modified_after' ja 'last_modified_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse." + ), + ] = None, + status: Annotated[ + Optional[WaybillStatus], + Field( + description="Filtreerib veoselehed, mis vastavad määratud staatusele" + ), + ] = None, + owner_code: Annotated[ + Optional[StrictStr], + Field(description="Filtreerib veoselehed, millel on sama omaniku kood"), + ] = None, + transporter_code: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed, millel on sama transportija kood" + ), + ] = None, + receiver_code: Annotated[ + Optional[StrictStr], + Field(description="Filtreerib veoselehed, millel on sama saaja kood"), + ] = None, + van_registration_number: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed, millel on sama veoki registreerimisnumber (tõstutundlik)" + ), + ] = None, + trailer_registration_number: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed, millel on sama haagise registreerimisnumber (tõstutundlik)" + ), + ] = None, + driver_id_code: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed, millel on sama transportija autojuhi isikukood (tõstutundlik)" + ), + ] = None, + place_of_delivery_code: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik)" + ), + ] = None, + subcontractor_code: Annotated[ + Optional[StrictStr], + Field( + description="Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik)" + ), + ] = None, + text: Annotated[ + Optional[StrictStr], + Field( + description="Vabateksti otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA. * jutumärkides tekst: otsitakse jutumärkides olevat lauset. * OR: loogiline VÕI operaator sõnade vahel. * -: loogiline EITUS." + ), + ] = None, + sort: Annotated[ + Optional[WaybillSortField], + Field(description="Sorteerib tulemused valitud välja järgi"), + ] = None, + page: Annotated[ + Optional[StrictInt], Field(description="Määrab tagastatava lehekülje") + ] = None, + page_size: Annotated[ + Optional[Annotated[int, Field(le=500, strict=True, ge=1)]], + Field(description="Määrab lehekülje suuruse"), + ] = None, + include_latest_measurements: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata)" + ), + ] = None, + include_timber_report: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata)" + ), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehtede pärimine + + Tagastab filtritele vastavad veoselehed. Veoselehti saavad pärida ainult nendega seotud asutused. + + :param created_after: Filtreerib veoselehed, mis on loodud hiljem või samal ajal. Kui 'created_after' ja 'created_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse. + :type created_after: datetime + :param created_before: Filtreerib veoselehed, mis on loodud varem või samal ajal. Kui 'created_after' ja 'created_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse. + :type created_before: datetime + :param last_modified_after: Filtreerib veoselehed, mis on muutunud pärast määratud aega. Kui 'last_modified_after' ja 'last_modified_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse. + :type last_modified_after: datetime + :param last_modified_before: Filtreerib veoselehed, mis on muutunud enne määratud aega. Kui 'last_modified_after' ja 'last_modified_before' on mõlemad määratud, peab nende vahe jääma 1 kuu piiresse. + :type last_modified_before: datetime + :param status: Filtreerib veoselehed, mis vastavad määratud staatusele + :type status: WaybillStatus + :param owner_code: Filtreerib veoselehed, millel on sama omaniku kood + :type owner_code: str + :param transporter_code: Filtreerib veoselehed, millel on sama transportija kood + :type transporter_code: str + :param receiver_code: Filtreerib veoselehed, millel on sama saaja kood + :type receiver_code: str + :param van_registration_number: Filtreerib veoselehed, millel on sama veoki registreerimisnumber (tõstutundlik) + :type van_registration_number: str + :param trailer_registration_number: Filtreerib veoselehed, millel on sama haagise registreerimisnumber (tõstutundlik) + :type trailer_registration_number: str + :param driver_id_code: Filtreerib veoselehed, millel on sama transportija autojuhi isikukood (tõstutundlik) + :type driver_id_code: str + :param place_of_delivery_code: Filtreerib veoselehed millel on sama tarnekoha kood (tõstutundlik) + :type place_of_delivery_code: str + :param subcontractor_code: Filtreerib veoselehed millel on sama alltöövõtja kood (tõstutundlik) + :type subcontractor_code: str + :param text: Vabateksti otsing. Toetatud on järgmine süntaks: * ilma jutumärkideta tekst: sõnade vahel rakendatakse loogiline JA. * jutumärkides tekst: otsitakse jutumärkides olevat lauset. * OR: loogiline VÕI operaator sõnade vahel. * -: loogiline EITUS. + :type text: str + :param sort: Sorteerib tulemused valitud välja järgi + :type sort: WaybillSortField + :param page: Määrab tagastatava lehekülje + :type page: int + :param page_size: Määrab lehekülje suuruse + :type page_size: int + :param include_latest_measurements: Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) + :type include_latest_measurements: bool + :param include_timber_report: Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) + :type include_timber_report: bool + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_get_serialize( + created_after=created_after, + created_before=created_before, + last_modified_after=last_modified_after, + last_modified_before=last_modified_before, + status=status, + owner_code=owner_code, + transporter_code=transporter_code, + receiver_code=receiver_code, + van_registration_number=van_registration_number, + trailer_registration_number=trailer_registration_number, + driver_id_code=driver_id_code, + place_of_delivery_code=place_of_delivery_code, + subcontractor_code=subcontractor_code, + text=text, + sort=sort, + page=page, + page_size=page_size, + include_latest_measurements=include_latest_measurements, + include_timber_report=include_timber_report, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "200": "PagedResultOfWaybill", + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _waybills_get_serialize( + self, + created_after, + created_before, + last_modified_after, + last_modified_before, + status, + owner_code, + transporter_code, + receiver_code, + van_registration_number, + trailer_registration_number, + driver_id_code, + place_of_delivery_code, + subcontractor_code, + text, + sort, + page, + page_size, + include_latest_measurements, + include_timber_report, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if created_after is not None: + if isinstance(created_after, datetime): + _query_params.append( + ( + "created_after", + created_after.strftime( + self.api_client.configuration.datetime_format + ), + ) + ) + else: + _query_params.append(("created_after", created_after)) + + if created_before is not None: + if isinstance(created_before, datetime): + _query_params.append( + ( + "created_before", + created_before.strftime( + self.api_client.configuration.datetime_format + ), + ) + ) + else: + _query_params.append(("created_before", created_before)) + + if last_modified_after is not None: + if isinstance(last_modified_after, datetime): + _query_params.append( + ( + "last_modified_after", + last_modified_after.strftime( + self.api_client.configuration.datetime_format + ), + ) + ) + else: + _query_params.append(("last_modified_after", last_modified_after)) + + if last_modified_before is not None: + if isinstance(last_modified_before, datetime): + _query_params.append( + ( + "last_modified_before", + last_modified_before.strftime( + self.api_client.configuration.datetime_format + ), + ) + ) + else: + _query_params.append(("last_modified_before", last_modified_before)) + + if status is not None: + _query_params.append(("status", status.value)) + + if owner_code is not None: + _query_params.append(("owner_code", owner_code)) + + if transporter_code is not None: + _query_params.append(("transporter_code", transporter_code)) + + if receiver_code is not None: + _query_params.append(("receiver_code", receiver_code)) + + if van_registration_number is not None: + _query_params.append(("van_registration_number", van_registration_number)) + + if trailer_registration_number is not None: + _query_params.append( + ("trailer_registration_number", trailer_registration_number) + ) + + if driver_id_code is not None: + _query_params.append(("driver_id_code", driver_id_code)) + + if place_of_delivery_code is not None: + _query_params.append(("place_of_delivery_code", place_of_delivery_code)) + + if subcontractor_code is not None: + _query_params.append(("subcontractor_code", subcontractor_code)) + + if text is not None: + _query_params.append(("text", text)) + + if sort is not None: + _query_params.append(("sort", sort.value)) + + if page is not None: + _query_params.append(("page", page)) + + if page_size is not None: + _query_params.append(("page_size", page_size)) + + if include_latest_measurements is not None: + _query_params.append( + ("includeLatestMeasurements", include_latest_measurements) + ) + + if include_timber_report is not None: + _query_params.append(("IncludeTimberReport", include_timber_report)) + + # process the header parameters + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # authentication setting + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/waybills", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def waybills_get( + self, + number: Annotated[ + StrictStr, Field(description="Päritava veoselehe number (tõstutundetu)") + ], + include_latest_measurements: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata)" + ), + ] = None, + include_timber_report: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata)" + ), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Waybill: + """Veoselehe pärimine + + Tagastab numbrile vastava veoselehe. Veoselehte saavad pärida ainult sellega seotud asutused. + + :param number: Päritava veoselehe number (tõstutundetu) (required) + :type number: str + :param include_latest_measurements: Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) + :type include_latest_measurements: bool + :param include_timber_report: Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) + :type include_timber_report: bool + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_get2_serialize( + number=number, + include_latest_measurements=include_latest_measurements, + include_timber_report=include_timber_report, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "Waybill", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def waybills_get_with_http_info( + self, + number: Annotated[ + StrictStr, Field(description="Päritava veoselehe number (tõstutundetu)") + ], + include_latest_measurements: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata)" + ), + ] = None, + include_timber_report: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata)" + ), + ] = None, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Waybill]: + """Veoselehe pärimine + + Tagastab numbrile vastava veoselehe. Veoselehte saavad pärida ainult sellega seotud asutused. + + :param number: Päritava veoselehe number (tõstutundetu) (required) + :type number: str + :param include_latest_measurements: Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) + :type include_latest_measurements: bool + :param include_timber_report: Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) + :type include_timber_report: bool :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: str - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_post_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_post_with_http_info( - start_waybill_request, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments - def waybills_post_with_http_info( + """ # noqa: E501 + + _param = self._waybills_get2_serialize( + number=number, + include_latest_measurements=include_latest_measurements, + include_timber_report=include_timber_report, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "Waybill", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def waybills_get2_without_preload_content( self, - start_waybill_request: Annotated[ - StartWaybillRequest, Field(..., description="Veoselehe andmed") + number: Annotated[ + StrictStr, Field(description="Päritava veoselehe number (tõstutundetu)") ], + include_latest_measurements: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata)" + ), + ] = None, + include_timber_report: Annotated[ + Optional[StrictBool], + Field( + description="Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata)" + ), + ] = None, evr_language: Annotated[ Optional[StrictStr], Field( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehe loomine # noqa: E501 - - Loob veoselehe staatusega \"vedu alustatud\" (status: \"shipping\"). Veo alustaja peab olema ise märgitud veoselehele kas omanikuks või vedajaks. Kui metsamaterjali saaja on EVR'iga liitunud asutus, peab veoselehel märgitud tarnekoht kuuluma ka saaja asutusele. Toimingu õnnestumisel tagastatakse loodud veoselehe number. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehe pärimine - >>> thread = api.waybills_post_with_http_info(start_waybill_request, evr_language, async_req=True) - >>> result = thread.get() + Tagastab numbrile vastava veoselehe. Veoselehte saavad pärida ainult sellega seotud asutused. - :param start_waybill_request: Veoselehe andmed (required) - :type start_waybill_request: StartWaybillRequest + :param number: Päritava veoselehe number (tõstutundetu) (required) + :type number: str + :param include_latest_measurements: Kas lisada veoselehele viimase mõõtmise andmed (vaikimisi ei lisata) + :type include_latest_measurements: bool + :param include_timber_report: Kas lisada veoselehele palkide mõõtmisraporti (vaikimisi ei lisata) + :type include_timber_report: bool :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(str, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = ["start_waybill_request", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_post" % _key - ) - _params[_key] = _val - del _params["kwargs"] + """ # noqa: E501 + + _param = self._waybills_get2_serialize( + number=number, + include_latest_measurements=include_latest_measurements, + include_timber_report=include_timber_report, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": "Waybill", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} + def _waybills_get2_serialize( + self, + number, + include_latest_measurements, + include_timber_report, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - + if number is not None: + _path_params["number"] = number # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] + if include_latest_measurements is not None: + _query_params.append( + ("includeLatestMeasurements", include_latest_measurements) + ) + if include_timber_report is not None: + _query_params.append(("includeTimberReport", include_timber_report)) + + # process the header parameters + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params["start_waybill_request"] is not None: - _body_params = _params["start_waybill_request"] # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) - # set the HTTP header `Content-Type` - _content_types_list = _params.get( - "_content_type", - self.api_client.select_header_content_type(["application/json"]), + # authentication setting + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/waybills/{number}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, ) - if _content_types_list: - _header_params["Content-Type"] = _content_types_list - # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 + @validate_call + def waybills_post( + self, + start_waybill_request: Annotated[ + StartWaybillRequest, Field(description="Veoselehe andmed") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """Veoselehe loomine + + Loob veoselehe staatusega \"vedu alustatud\" (status: \"shipping\"). Veo alustaja peab olema ise märgitud veoselehele kas omanikuks või vedajaks. Kui metsamaterjali saaja on EVR'iga liitunud asutus, peab veoselehel märgitud tarnekoht kuuluma ka saaja asutusele. Toimingu õnnestumisel tagastatakse loodud veoselehe number. + + :param start_waybill_request: Veoselehe andmed (required) + :type start_waybill_request: StartWaybillRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_post_serialize( + start_waybill_request=start_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "200": "str", + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def waybills_post_with_http_info( + self, + start_waybill_request: Annotated[ + StartWaybillRequest, Field(description="Veoselehe andmed") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """Veoselehe loomine + + Loob veoselehe staatusega \"vedu alustatud\" (status: \"shipping\"). Veo alustaja peab olema ise märgitud veoselehele kas omanikuks või vedajaks. Kui metsamaterjali saaja on EVR'iga liitunud asutus, peab veoselehel märgitud tarnekoht kuuluma ka saaja asutusele. Toimingu õnnestumisel tagastatakse loodud veoselehe number. + + :param start_waybill_request: Veoselehe andmed (required) + :type start_waybill_request: StartWaybillRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_post_serialize( + start_waybill_request=start_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "200": "str", + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def waybills_post_without_preload_content( + self, + start_waybill_request: Annotated[ + StartWaybillRequest, Field(description="Veoselehe andmed") + ], + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehe loomine + + Loob veoselehe staatusega \"vedu alustatud\" (status: \"shipping\"). Veo alustaja peab olema ise märgitud veoselehele kas omanikuks või vedajaks. Kui metsamaterjali saaja on EVR'iga liitunud asutus, peab veoselehel märgitud tarnekoht kuuluma ka saaja asutusele. Toimingu õnnestumisel tagastatakse loodud veoselehe number. + + :param start_waybill_request: Veoselehe andmed (required) + :type start_waybill_request: StartWaybillRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_post_serialize( + start_waybill_request=start_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { "401": "ProblemDetails", "403": "ProblemDetails", "200": "str", "400": "ValidationResult", } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response + + def _waybills_post_serialize( + self, + start_waybill_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language + # process the form parameters + # process the body parameter + if start_waybill_request is not None: + _body_params = start_waybill_request + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type - return self.api_client.call_api( - "/api/waybills", - "POST", - _path_params, - _query_params, - _header_params, + # authentication setting + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/waybills", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) - @validate_arguments + @validate_call def waybills_unload( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], unload_waybill_request: UnloadWaybillRequest, evr_language: Annotated[ @@ -1730,16 +2801,21 @@ def waybills_unload( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> None: # noqa: E501 - """Veoselehel veo lõpetamine # noqa: E501 - - Lõpetab veo veoselehel ja veoselehe staatuseks märgitakse \"koorem maas\" (status: \"unloaded\"). Vedu saab lõpetada veoselehe looja või vedaja ja seda ainult \"vedu alustatud\" (status: shipping) staatuses. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Veoselehel veo lõpetamine - >>> thread = api.waybills_unload(number, unload_waybill_request, evr_language, async_req=True) - >>> result = thread.get() + Lõpetab veo veoselehel ja veoselehe staatuseks märgitakse \"koorem maas\" (status: \"unloaded\"). Vedu saab lõpetada veoselehe looja või vedaja ja seda ainult \"vedu alustatud\" (status: shipping) staatuses. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -1747,30 +2823,59 @@ def waybills_unload( :type unload_waybill_request: UnloadWaybillRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs["_return_http_data_only"] = True - if "_preload_content" in kwargs: - message = "Error! Please call the waybills_unload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.waybills_unload_with_http_info( - number, unload_waybill_request, evr_language, **kwargs - ) # noqa: E501 - - @validate_arguments + """ # noqa: E501 + + _param = self._waybills_unload_serialize( + number=number, + unload_waybill_request=unload_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call def waybills_unload_with_http_info( self, number: Annotated[ - StrictStr, Field(..., description="Veoselehe number (tõstutundetu)") + StrictStr, Field(description="Veoselehe number (tõstutundetu)") ], unload_waybill_request: UnloadWaybillRequest, evr_language: Annotated[ @@ -1779,16 +2884,104 @@ def waybills_unload_with_http_info( description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' ), ] = None, - **kwargs - ) -> ApiResponse: # noqa: E501 - """Veoselehel veo lõpetamine # noqa: E501 + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Veoselehel veo lõpetamine + + Lõpetab veo veoselehel ja veoselehe staatuseks märgitakse \"koorem maas\" (status: \"unloaded\"). Vedu saab lõpetada veoselehe looja või vedaja ja seda ainult \"vedu alustatud\" (status: shipping) staatuses. + + :param number: Veoselehe number (tõstutundetu) (required) + :type number: str + :param unload_waybill_request: (required) + :type unload_waybill_request: UnloadWaybillRequest + :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). + :type evr_language: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._waybills_unload_serialize( + number=number, + unload_waybill_request=unload_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Lõpetab veo veoselehel ja veoselehe staatuseks märgitakse \"koorem maas\" (status: \"unloaded\"). Vedu saab lõpetada veoselehe looja või vedaja ja seda ainult \"vedu alustatud\" (status: shipping) staatuses. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def waybills_unload_without_preload_content( + self, + number: Annotated[ + StrictStr, Field(description="Veoselehe number (tõstutundetu)") + ], + unload_waybill_request: UnloadWaybillRequest, + evr_language: Annotated[ + Optional[StrictStr], + Field( + description='Defineerib keele tagastatavatele veateadetele (toetatud on väärtused "et" eesti keele ning "en" inglise keele jaoks).' + ), + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)] + ], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Veoselehel veo lõpetamine - >>> thread = api.waybills_unload_with_http_info(number, unload_waybill_request, evr_language, async_req=True) - >>> result = thread.get() + Lõpetab veo veoselehel ja veoselehe staatuseks märgitakse \"koorem maas\" (status: \"unloaded\"). Vedu saab lõpetada veoselehe looja või vedaja ja seda ainult \"vedu alustatud\" (status: shipping) staatuses. :param number: Veoselehe number (tõstutundetu) (required) :type number: str @@ -1796,111 +2989,115 @@ def waybills_unload_with_http_info( :type unload_waybill_request: UnloadWaybillRequest :param evr_language: Defineerib keele tagastatavatele veateadetele (toetatud on väärtused \"et\" eesti keele ning \"en\" inglise keele jaoks). :type evr_language: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = ["number", "unload_waybill_request", "evr_language"] - _all_params.extend( - [ - "async_req", - "_return_http_data_only", - "_preload_content", - "_request_timeout", - "_request_auth", - "_content_type", - "_headers", - ] - ) - - # validate the arguments - for _key, _val in _params["kwargs"].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method waybills_unload" % _key - ) - _params[_key] = _val - del _params["kwargs"] + """ # noqa: E501 + + _param = self._waybills_unload_serialize( + number=number, + unload_waybill_request=unload_waybill_request, + evr_language=evr_language, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + "401": "ProblemDetails", + "403": "ProblemDetails", + "404": "ProblemDetails", + "200": None, + "400": "ValidationResult", + } + response_data = self.api_client.call_api( + *_param, _request_timeout=_request_timeout + ) + return response_data.response - # process the path parameters - _path_params = {} - if _params["number"]: - _path_params["number"] = _params["number"] + def _waybills_unload_serialize( + self, + number, + unload_waybill_request, + evr_language, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if number is not None: + _path_params["number"] = number # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get("_headers", {})) - if _params["evr_language"]: - _header_params["EVR-LANGUAGE"] = _params["evr_language"] - + if evr_language is not None: + _header_params["EVR-LANGUAGE"] = evr_language # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params["unload_waybill_request"] is not None: - _body_params = _params["unload_waybill_request"] + if unload_waybill_request is not None: + _body_params = unload_waybill_request # set the HTTP header `Accept` - _header_params["Accept"] = self.api_client.select_header_accept( - ["application/json"] - ) # noqa: E501 + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept( + ["application/json"] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get( - "_content_type", - self.api_client.select_header_content_type(["application/json"]), - ) - if _content_types_list: - _header_params["Content-Type"] = _content_types_list + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type( + ["application/json"] + ) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type # authentication setting - _auth_settings = ["SecretApiKey"] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - "/api/waybills/{number}/unload", - "POST", - _path_params, - _query_params, - _header_params, + _auth_settings: List[str] = ["SecretApiKey"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/waybills/{number}/unload", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get("async_req"), - _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501 - _preload_content=_params.get("_preload_content", True), - _request_timeout=_params.get("_request_timeout"), collection_formats=_collection_formats, - _request_auth=_params.get("_request_auth"), + _host=_host, + _request_auth=_request_auth, ) diff --git a/pyevr/openapi_client/api_client.py b/pyevr/openapi_client/api_client.py index fcd6b81..a810b9e 100644 --- a/pyevr/openapi_client/api_client.py +++ b/pyevr/openapi_client/api_client.py @@ -1,34 +1,46 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - -import atexit import datetime -from dateutil.parser import parse +import decimal import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile - +from enum import Enum +from typing import Dict, List, Optional, Tuple, Union from urllib.parse import quote -from pyevr.openapi_client.configuration import Configuration -from pyevr.openapi_client.api_response import ApiResponse +from dateutil.parser import parse +from pydantic import SecretStr + import pyevr.openapi_client.models from pyevr.openapi_client import rest -from pyevr.openapi_client.exceptions import ApiValueError, ApiException +from pyevr.openapi_client.api_response import ApiResponse +from pyevr.openapi_client.api_response import T as ApiResponseT +from pyevr.openapi_client.configuration import Configuration +from pyevr.openapi_client.exceptions import ( + ApiException, + ApiValueError, + BadRequestException, + ForbiddenException, + NotFoundException, + ServiceException, + UnauthorizedException, +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: @@ -45,8 +57,6 @@ class ApiClient: the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, str, int) @@ -58,23 +68,18 @@ class ApiClient: "bool": bool, "date": datetime.date, "datetime": datetime.datetime, + "decimal": decimal.Decimal, "object": object, } _pool = None def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None, - pool_threads=1, + self, configuration=None, header_name=None, header_value=None, cookie=None ) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -89,25 +94,7 @@ def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, "unregister"): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -147,25 +134,43 @@ def set_default(cls, default): """ cls._default = default - def __call_api( + def param_serialize( self, - resource_path, method, + resource_path, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, - _request_timeout=None, _host=None, _request_auth=None, - ): + ) -> RequestSerialized: + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + config = self.configuration # header parameters @@ -194,7 +199,8 @@ def __call_api( post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) post_params = self.parameters_to_tuples(post_params, collection_formats) - post_params.extend(self.files_parameters(files)) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( @@ -212,7 +218,7 @@ def __call_api( body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -224,74 +230,112 @@ def __call_api( url_query = self.parameters_to_url_query(query_params, collection_formats) url += "?" + url_query + return method, url, header_params, body, post_params + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None, + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( + response_data = self.rest_client.request( method, url, - query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, + post_params=post_params, _request_timeout=_request_timeout, ) + except ApiException as e: - if e.body: - e.body = e.body.decode("utf-8") raise e - self.last_response = response_data - - return_data = None # assuming derialization is not needed - # data needs deserialization or returns HTTP data (deserialized) only - if _preload_content or _return_http_data_only: - response_type = response_types_map.get(str(response_data.status), None) - if ( - not response_type - and isinstance(response_data.status, int) - and 100 <= response_data.status <= 599 - ): - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get( - str(response_data.status)[0] + "XX", None - ) + return response_data + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]] = None, + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None + ) + + # deserialize response data + response_text = None + return_data = None + try: if response_type == "bytearray": - response_data.data = response_data.data - else: + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: match = None content_type = response_data.getheader("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - if response_type == "bytearray": - return_data = response_data.data - elif response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + response_text = response_data.data.decode(encoding) + return_data = self.deserialize( + response_text, response_type, content_type + ) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) - if _return_http_data_only: - return return_data - else: - return ApiResponse( - status_code=response_data.status, - data=return_data, - headers=response_data.getheaders(), - raw_data=response_data.data, - ) + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -301,6 +345,10 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): @@ -309,8 +357,10 @@ def sanitize_for_serialization(self, obj): return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -318,31 +368,49 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = obj.to_dict() + if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ return { key: self.sanitize_for_serialization(val) for key, val in obj_dict.items() } - def deserialize(self, response, response_type): + def deserialize( + self, response_text: str, response_type: str, content_type: Optional[str] + ): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match( + r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", + content_type, + re.IGNORECASE, + ): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -359,11 +427,15 @@ def __deserialize(self, data, klass): if isinstance(klass, str): if klass.startswith("List["): - sub_kls = re.match(r"List\[(.*)]", klass).group(1) + m = re.match(r"List\[(.*)]", klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith("Dict["): - sub_kls = re.match(r"Dict\[([^,]*), (.*)]", klass).group(2) + m = re.match(r"Dict\[([^,]*), (.*)]", klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} # convert str to class @@ -380,193 +452,13 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) - def call_api( - self, - resource_path, - method, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, - response_types_map=None, - auth_settings=None, - async_req=None, - _return_http_data_only=None, - collection_formats=None, - _preload_content=True, - _request_timeout=None, - _host=None, - _request_auth=None, - ): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _request_auth, - ) - - return self.pool.apply_async( - self.__call_api, - ( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _request_auth, - ), - ) - - def request( - self, - method, - url, - query_params=None, - headers=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.get_request( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) - elif method == "HEAD": - return self.rest_client.head_request( - url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers, - ) - elif method == "OPTIONS": - return self.rest_client.options_request( - url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - ) - elif method == "POST": - return self.rest_client.post_request( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "PUT": - return self.rest_client.put_request( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "PATCH": - return self.rest_client.patch_request( - url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - elif method == "DELETE": - return self.rest_client.delete_request( - url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -574,12 +466,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in ( - params.items() if isinstance(params, dict) else params - ): # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": @@ -605,23 +495,21 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in ( - params.items() if isinstance(params, dict) else params - ): # noqa: E501 - if isinstance(v, (int, float)): - v = str(v) + for k, v in params.items() if isinstance(params, dict) else params: if isinstance(v, bool): v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) if isinstance(v, dict): v = json.dumps(v) if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, value) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -637,41 +525,46 @@ def parameters_to_url_query(self, params, collection_formats): else: new_params.append((k, quote(str(v)))) - return "&".join(["=".join(item) for item in new_params]) + return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, "rb") as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = ( - mimetypes.guess_type(filename)[0] - or "application/octet-stream" - ) - params.append(tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, "rb") as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([k, tuple([filename, filedata, mimetype])])) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None for accept in accepts: if re.search("json", accept, re.IGNORECASE): @@ -703,7 +596,7 @@ def update_params_for_auth( method, body, request_auth=None, - ): + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -723,18 +616,17 @@ def update_params_for_auth( self._apply_auth_params( headers, queries, resource_path, method, body, request_auth ) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, queries, resource_path, method, body, auth_setting - ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, queries, resource_path, method, body, auth_setting + ) def _apply_auth_params( self, headers, queries, resource_path, method, body, auth_setting - ): + ) -> None: """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. @@ -761,6 +653,9 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -770,9 +665,9 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search( - r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition - ).group(1) + m = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -835,6 +730,20 @@ def __deserialize_datetime(self, string): reason=("Failed to parse `{0}` as datetime object".format(string)), ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, reason=("Failed to parse `{0}` as `{1}`".format(data, klass)) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/pyevr/openapi_client/api_response.py b/pyevr/openapi_client/api_response.py index bb7e400..ca801da 100644 --- a/pyevr/openapi_client/api_response.py +++ b/pyevr/openapi_client/api_response.py @@ -1,28 +1,22 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from typing import Generic, Mapping, Optional, TypeVar -class ApiResponse: +from pydantic import BaseModel, Field, StrictBytes, StrictInt + +T = TypeVar("T") + + +class ApiResponse(BaseModel, Generic[T]): """ API response object """ - status_code: Optional[StrictInt] = Field(None, description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field( - None, description="HTTP headers" - ) - data: Optional[Any] = Field( - None, description="Deserialized data given the data type" - ) - raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") - - def __init__( - self, status_code=None, headers=None, data=None, raw_data=None - ) -> None: - self.status_code = status_code - self.headers = headers - self.data = data - self.raw_data = raw_data + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = {"arbitrary_types_allowed": True} diff --git a/pyevr/openapi_client/configuration.py b/pyevr/openapi_client/configuration.py index c77758d..73232e4 100644 --- a/pyevr/openapi_client/configuration.py +++ b/pyevr/openapi_client/configuration.py @@ -1,24 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - import copy +import http.client as httplib import logging import multiprocessing import sys -import urllib3 +from logging import FileHandler +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union -import http.client as httplib +import urllib3 +from typing_extensions import NotRequired, Self JSON_SCHEMA_VALIDATION_KEYWORDS = { "multipleOf", @@ -33,11 +35,114 @@ "minItems", } +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "SecretApiKey": APIKeyAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -60,6 +165,9 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. :Example: @@ -83,21 +191,26 @@ class Configuration: Cookie: JSESSIONID abc123 """ - _default = None + _default: ClassVar[Optional[Self]] = None def __init__( self, - host=None, - api_key=None, - api_key_prefix=None, - username=None, - password=None, - access_token=None, - server_index=None, - server_variables=None, - server_operation_index=None, - server_operation_variables=None, - ssl_ca_cert=None, + host: Optional[str] = None, + api_key: Optional[Dict[str, str]] = None, + api_key_prefix: Optional[Dict[str, str]] = None, + username: Optional[str] = None, + password: Optional[str] = None, + access_token: Optional[str] = None, + server_index: Optional[int] = None, + server_variables: Optional[ServerVariablesT] = None, + server_operation_index: Optional[Dict[int, int]] = None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]] = None, + ignore_operation_servers: bool = False, + ssl_ca_cert: Optional[str] = None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + *, + debug: Optional[bool] = None, ) -> None: """Constructor""" self._base_path = "https://evr.veoseleht.ee" if host is None else host @@ -111,6 +224,9 @@ def __init__( self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -148,13 +264,16 @@ def __init__( self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -166,6 +285,10 @@ def __init__( self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ self.cert_file = None """client certificate file """ @@ -188,7 +311,7 @@ def __init__( cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ self.proxy_headers = None @@ -197,7 +320,7 @@ def __init__( self.safe_chars_for_path_param = "" """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation @@ -215,7 +338,7 @@ def __init__( """date format """ - def __deepcopy__(self, memo): + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -229,11 +352,11 @@ def __deepcopy__(self, memo): result.debug = self.debug return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -244,7 +367,7 @@ def set_default(cls, default): cls._default = default @classmethod - def get_default_copy(cls): + def get_default_copy(cls) -> Self: """Deprecated. Please use `get_default` instead. Deprecated. Please use `get_default` instead. @@ -254,7 +377,7 @@ def get_default_copy(cls): return cls.get_default() @classmethod - def get_default(cls): + def get_default(cls) -> Self: """Return the default configuration. This method returns newly created, based on default constructor, @@ -264,11 +387,11 @@ def get_default(cls): :return: The configuration object. """ if cls._default is None: - cls._default = Configuration() + cls._default = cls() return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -280,7 +403,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -299,7 +422,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -308,7 +431,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -330,7 +453,7 @@ def debug(self, value): httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -341,7 +464,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -352,7 +475,9 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix( + self, identifier: str, alias: Optional[str] = None + ) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -371,7 +496,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -386,12 +513,12 @@ def get_basic_auth_token(self): "authorization" ) - def auth_settings(self): + def auth_settings(self) -> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if "SecretApiKey" in self.api_key: auth["SecretApiKey"] = { "type": "api_key", @@ -403,7 +530,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -412,11 +539,11 @@ def to_debug_report(self): "Python SDK Debug Report:\n" "OS: {env}\n" "Python Version: {pyversion}\n" - "Version of the API: 1.14.0\n" + "Version of the API: 1.40.1\n" "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) ) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -428,7 +555,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -468,14 +600,14 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings( self.server_index, variables=self.server_variables ) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/pyevr/openapi_client/exceptions.py b/pyevr/openapi_client/exceptions.py index 4f467e9..0cd65fc 100644 --- a/pyevr/openapi_client/exceptions.py +++ b/pyevr/openapi_client/exceptions.py @@ -1,16 +1,20 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 +from typing import Any, Optional + +from typing_extensions import Self + class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -101,53 +105,108 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode("utf-8") + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException( + http_resp=http_resp, body=body, data=data + ) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\nReason: {1}\n".format(self.status, self.reason) if self.headers: error_message += "HTTP response headers: {0}\n".format(self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message class BadRequestException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(BadRequestException, self).__init__(status, reason, http_resp) + pass class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(NotFoundException, self).__init__(status, reason, http_resp) + pass class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(UnauthorizedException, self).__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ServiceException, self).__init__(status, reason, http_resp) + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass def render_path(path_to_item): diff --git a/pyevr/openapi_client/models/__init__.py b/pyevr/openapi_client/models/__init__.py index 4d2b18c..62be4e6 100644 --- a/pyevr/openapi_client/models/__init__.py +++ b/pyevr/openapi_client/models/__init__.py @@ -2,17 +2,16 @@ # flake8: noqa """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - # import models into model package from pyevr.openapi_client.models.add_measurement_act_request import ( AddMeasurementActRequest, @@ -20,26 +19,38 @@ from pyevr.openapi_client.models.add_shipments_to_waybill_request import ( AddShipmentsToWaybillRequest, ) +from pyevr.openapi_client.models.add_timber_report_request import AddTimberReportRequest from pyevr.openapi_client.models.add_waybill_note_request import AddWaybillNoteRequest from pyevr.openapi_client.models.address import Address +from pyevr.openapi_client.models.agricultural_biomass import AgriculturalBiomass from pyevr.openapi_client.models.assortment import Assortment from pyevr.openapi_client.models.authorization_type import AuthorizationType +from pyevr.openapi_client.models.baltpool_quality import BaltpoolQuality from pyevr.openapi_client.models.cancel_waybill_request import CancelWaybillRequest from pyevr.openapi_client.models.certificate import Certificate from pyevr.openapi_client.models.certificate_claim import CertificateClaim from pyevr.openapi_client.models.consolidated_act import ConsolidatedAct +from pyevr.openapi_client.models.consolidated_act_source_item import ( + ConsolidatedActSourceItem, +) from pyevr.openapi_client.models.contact_person import ContactPerson from pyevr.openapi_client.models.contract_for_transfer_of_cutting_rights import ( ContractForTransferOfCuttingRights, ) from pyevr.openapi_client.models.coordinates import Coordinates +from pyevr.openapi_client.models.defect_code import DefectCode +from pyevr.openapi_client.models.deforestation_biomass import DeforestationBiomass from pyevr.openapi_client.models.entity import Entity +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.forest_act import ForestAct from pyevr.openapi_client.models.forest_notice import ForestNotice from pyevr.openapi_client.models.holding_base import HoldingBase +from pyevr.openapi_client.models.holding_base_type import HoldingBaseType from pyevr.openapi_client.models.inventory_act import InventoryAct +from pyevr.openapi_client.models.measurement import Measurement from pyevr.openapi_client.models.measurement_act import MeasurementAct from pyevr.openapi_client.models.measurement_unit import MeasurementUnit +from pyevr.openapi_client.models.non_forest_wood_biomass import NonForestWoodBiomass from pyevr.openapi_client.models.organization import Organization from pyevr.openapi_client.models.owner import Owner from pyevr.openapi_client.models.pack import Pack @@ -72,11 +83,17 @@ from pyevr.openapi_client.models.receiver import Receiver from pyevr.openapi_client.models.representer import Representer from pyevr.openapi_client.models.sales_contract import SalesContract +from pyevr.openapi_client.models.secondary_waste_wood import SecondaryWasteWood +from pyevr.openapi_client.models.secondary_wood_biomass import SecondaryWoodBiomass from pyevr.openapi_client.models.shipment import Shipment from pyevr.openapi_client.models.shipment_assortment import ShipmentAssortment from pyevr.openapi_client.models.shipment_item import ShipmentItem +from pyevr.openapi_client.models.shipment_item_base import ShipmentItemBase from pyevr.openapi_client.models.source import Source from pyevr.openapi_client.models.start_waybill_request import StartWaybillRequest +from pyevr.openapi_client.models.subcontractor import Subcontractor +from pyevr.openapi_client.models.timber_report import TimberReport +from pyevr.openapi_client.models.timber_report_item import TimberReportItem from pyevr.openapi_client.models.total import Total from pyevr.openapi_client.models.transport import Transport from pyevr.openapi_client.models.transporter import Transporter @@ -91,3 +108,5 @@ from pyevr.openapi_client.models.waybill_sort_field import WaybillSortField from pyevr.openapi_client.models.waybill_status import WaybillStatus from pyevr.openapi_client.models.without_forest_notice import WithoutForestNotice +from pyevr.openapi_client.models.wood_quality import WoodQuality +from pyevr.openapi_client.models.wood_type import WoodType diff --git a/pyevr/openapi_client/models/add_measurement_act_request.py b/pyevr/openapi_client/models/add_measurement_act_request.py index 6fe9a8e..cf53ee3 100644 --- a/pyevr/openapi_client/models/add_measurement_act_request.py +++ b/pyevr/openapi_client/models/add_measurement_act_request.py @@ -1,50 +1,52 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Any, List, Optional -from pydantic import BaseModel, Field, conlist, constr -from pyevr.openapi_client.models.shipment_item import ShipmentItem +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.measurement import Measurement from pyevr.openapi_client.models.total import Total class AddMeasurementActRequest(BaseModel): """ AddMeasurementActRequest - """ + """ # noqa: E501 - act_number: Optional[constr(strict=True, max_length=25)] = Field( - None, alias="actNumber", description="Mõõtmisakti number" + act_number: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field( + default=None, description="Mõõtmisakti number", alias="actNumber" ) act_date: Optional[datetime] = Field( - None, alias="actDate", description="Mõõtmisakti kuupäev" + default=None, description="Mõõtmisakti kuupäev", alias="actDate" ) - measurements: Optional[conlist(ShipmentItem)] = Field( - None, description="Mõõtmistulemused" + measurements: Optional[List[Measurement]] = Field( + default=None, description="Mõõtmistulemused" ) custom_measurement_data: Optional[Any] = Field( - None, - alias="customMeasurementData", + default=None, description="Mõõtmistulemused vabas formaadis.", + alias="customMeasurementData", ) total: Optional[Total] = None - __properties = [ + __properties: ClassVar[List[str]] = [ "actNumber", "actDate", "measurements", @@ -52,83 +54,98 @@ class AddMeasurementActRequest(BaseModel): "total", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AddMeasurementActRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddMeasurementActRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in measurements (list) _items = [] if self.measurements: - for _item in self.measurements: - if _item: - _items.append(_item.to_dict()) + for _item_measurements in self.measurements: + if _item_measurements: + _items.append(_item_measurements.to_dict()) _dict["measurements"] = _items # override the default output from pydantic by calling `to_dict()` of total if self.total: _dict["total"] = self.total.to_dict() # set to None if act_number (nullable) is None - # and __fields_set__ contains the field - if self.act_number is None and "act_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.act_number is None and "act_number" in self.model_fields_set: _dict["actNumber"] = None # set to None if act_date (nullable) is None - # and __fields_set__ contains the field - if self.act_date is None and "act_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.act_date is None and "act_date" in self.model_fields_set: _dict["actDate"] = None # set to None if measurements (nullable) is None - # and __fields_set__ contains the field - if self.measurements is None and "measurements" in self.__fields_set__: + # and model_fields_set contains the field + if self.measurements is None and "measurements" in self.model_fields_set: _dict["measurements"] = None # set to None if custom_measurement_data (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.custom_measurement_data is None - and "custom_measurement_data" in self.__fields_set__ + and "custom_measurement_data" in self.model_fields_set ): _dict["customMeasurementData"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> AddMeasurementActRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddMeasurementActRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddMeasurementActRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddMeasurementActRequest.parse_obj( + _obj = cls.model_validate( { - "act_number": obj.get("actNumber"), - "act_date": obj.get("actDate"), + "actNumber": obj.get("actNumber"), + "actDate": obj.get("actDate"), "measurements": [ - ShipmentItem.from_dict(_item) for _item in obj.get("measurements") + Measurement.from_dict(_item) for _item in obj["measurements"] ] if obj.get("measurements") is not None else None, - "custom_measurement_data": obj.get("customMeasurementData"), - "total": Total.from_dict(obj.get("total")) + "customMeasurementData": obj.get("customMeasurementData"), + "total": Total.from_dict(obj["total"]) if obj.get("total") is not None else None, } diff --git a/pyevr/openapi_client/models/add_shipments_to_waybill_request.py b/pyevr/openapi_client/models/add_shipments_to_waybill_request.py index 7291812..70a5ffe 100644 --- a/pyevr/openapi_client/models/add_shipments_to_waybill_request.py +++ b/pyevr/openapi_client/models/add_shipments_to_waybill_request.py @@ -1,83 +1,97 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import List -from pydantic import BaseModel, Field, conlist from pyevr.openapi_client.models.shipment import Shipment class AddShipmentsToWaybillRequest(BaseModel): """ AddShipmentsToWaybillRequest - """ + """ # noqa: E501 - shipments: conlist(Shipment, max_items=25, min_items=1) = Field( - ..., description="Lisatavad veose andmed" + shipments: Annotated[List[Shipment], Field(min_length=1, max_length=25)] = Field( + description="Lisatavad veose andmed" ) - __properties = ["shipments"] - - class Config: - """Pydantic configuration""" + __properties: ClassVar[List[str]] = ["shipments"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AddShipmentsToWaybillRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddShipmentsToWaybillRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in shipments (list) _items = [] if self.shipments: - for _item in self.shipments: - if _item: - _items.append(_item.to_dict()) + for _item_shipments in self.shipments: + if _item_shipments: + _items.append(_item_shipments.to_dict()) _dict["shipments"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> AddShipmentsToWaybillRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddShipmentsToWaybillRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddShipmentsToWaybillRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddShipmentsToWaybillRequest.parse_obj( + _obj = cls.model_validate( { - "shipments": [ - Shipment.from_dict(_item) for _item in obj.get("shipments") - ] + "shipments": [Shipment.from_dict(_item) for _item in obj["shipments"]] if obj.get("shipments") is not None else None } diff --git a/pyevr/openapi_client/models/add_timber_report_request.py b/pyevr/openapi_client/models/add_timber_report_request.py new file mode 100644 index 0000000..5bfd3f3 --- /dev/null +++ b/pyevr/openapi_client/models/add_timber_report_request.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.timber_report_item import TimberReportItem + + +class AddTimberReportRequest(BaseModel): + """ + AddTimberReportRequest + """ # noqa: E501 + + report_number: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field( + default=None, description="Mõõtmisraporti number", alias="reportNumber" + ) + items: List[TimberReportItem] = Field(description="Palgi mõõtmisraporti andmed") + report_date: Optional[datetime] = Field( + default=None, description="Palgi mõõtmisraporti aeg", alias="reportDate" + ) + __properties: ClassVar[List[str]] = ["reportNumber", "items", "reportDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddTimberReportRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict["items"] = _items + # set to None if report_number (nullable) is None + # and model_fields_set contains the field + if self.report_number is None and "report_number" in self.model_fields_set: + _dict["reportNumber"] = None + + # set to None if report_date (nullable) is None + # and model_fields_set contains the field + if self.report_date is None and "report_date" in self.model_fields_set: + _dict["reportDate"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddTimberReportRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "reportNumber": obj.get("reportNumber"), + "items": [TimberReportItem.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None, + "reportDate": obj.get("reportDate"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/add_waybill_note_request.py b/pyevr/openapi_client/models/add_waybill_note_request.py index 8371ffc..7d30389 100644 --- a/pyevr/openapi_client/models/add_waybill_note_request.py +++ b/pyevr/openapi_client/models/add_waybill_note_request.py @@ -1,69 +1,84 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from typing import Optional -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class AddWaybillNoteRequest(BaseModel): """ AddWaybillNoteRequest - """ + """ # noqa: E501 - message: Optional[constr(strict=True, max_length=1000)] = Field( - None, description="Sõnum" + message: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field( + default=None, description="Sõnum" ) - __properties = ["message"] + __properties: ClassVar[List[str]] = ["message"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> AddWaybillNoteRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of AddWaybillNoteRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> AddWaybillNoteRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of AddWaybillNoteRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return AddWaybillNoteRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = AddWaybillNoteRequest.parse_obj({"message": obj.get("message")}) + _obj = cls.model_validate({"message": obj.get("message")}) return _obj diff --git a/pyevr/openapi_client/models/address.py b/pyevr/openapi_client/models/address.py index 2771c91..c335c73 100644 --- a/pyevr/openapi_client/models/address.py +++ b/pyevr/openapi_client/models/address.py @@ -1,81 +1,97 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class Address(BaseModel): """ Address - """ + """ # noqa: E501 - country_code: constr(strict=True, max_length=3, min_length=3) = Field( - ..., alias="countryCode", description="Riigi kood" + country_code: Annotated[str, Field(min_length=3, strict=True, max_length=3)] = ( + Field(description="Riigi kood", alias="countryCode") ) - county: constr(strict=True, max_length=100, min_length=0) = Field( - ..., description="Maakond" + county: Annotated[str, Field(min_length=0, strict=True, max_length=100)] = Field( + description="Maakond" ) - city: constr(strict=True, max_length=100, min_length=0) = Field( - ..., description="Linn/vald" + city: Annotated[str, Field(min_length=0, strict=True, max_length=100)] = Field( + description="Linn/vald" ) - street: constr(strict=True, max_length=100, min_length=0) = Field( - ..., description="Tänav/küla" + street: Annotated[str, Field(min_length=0, strict=True, max_length=100)] = Field( + description="Tänav/küla" ) - __properties = ["countryCode", "county", "city", "street"] + __properties: ClassVar[List[str]] = ["countryCode", "county", "city", "street"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Address: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Address from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Address: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Address from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Address.parse_obj(obj) + return cls.model_validate(obj) - _obj = Address.parse_obj( + _obj = cls.model_validate( { - "country_code": obj.get("countryCode"), + "countryCode": obj.get("countryCode"), "county": obj.get("county"), "city": obj.get("city"), "street": obj.get("street"), diff --git a/pyevr/openapi_client/models/agricultural_biomass.py b/pyevr/openapi_client/models/agricultural_biomass.py new file mode 100644 index 0000000..bbf3a8a --- /dev/null +++ b/pyevr/openapi_client/models/agricultural_biomass.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber +from pyevr.openapi_client.models.holding_base import HoldingBase +from pyevr.openapi_client.models.previous_owner import PreviousOwner + + +class AgriculturalBiomass(HoldingBase): + """ + AgriculturalBiomass + """ # noqa: E501 + + contract_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Dokumendi number", alias="contractNumber") + ) + contract_date: Optional[datetime] = Field( + default=None, description="Dokumendi kuupäev", alias="contractDate" + ) + cadaster: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field( + description="Katastritunnus" + ) + agricultural_area_name: Optional[ + Annotated[str, Field(strict=True, max_length=500)] + ] = Field(default=None, description="Kõlviku nimetus", alias="agriculturalAreaName") + previous_owner: Optional[PreviousOwner] = Field(default=None, alias="previousOwner") + __properties: ClassVar[List[str]] = [ + "eudrNumbers", + "type", + "contractNumber", + "contractDate", + "cadaster", + "agriculturalAreaName", + "previousOwner", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgriculturalBiomass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # override the default output from pydantic by calling `to_dict()` of previous_owner + if self.previous_owner: + _dict["previousOwner"] = self.previous_owner.to_dict() + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + + # set to None if contract_number (nullable) is None + # and model_fields_set contains the field + if self.contract_number is None and "contract_number" in self.model_fields_set: + _dict["contractNumber"] = None + + # set to None if contract_date (nullable) is None + # and model_fields_set contains the field + if self.contract_date is None and "contract_date" in self.model_fields_set: + _dict["contractDate"] = None + + # set to None if agricultural_area_name (nullable) is None + # and model_fields_set contains the field + if ( + self.agricultural_area_name is None + and "agricultural_area_name" in self.model_fields_set + ): + _dict["agriculturalAreaName"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgriculturalBiomass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, + "type": obj.get("type"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), + "cadaster": obj.get("cadaster"), + "agriculturalAreaName": obj.get("agriculturalAreaName"), + "previousOwner": PreviousOwner.from_dict(obj["previousOwner"]) + if obj.get("previousOwner") is not None + else None, + } + ) + return _obj diff --git a/pyevr/openapi_client/models/assortment.py b/pyevr/openapi_client/models/assortment.py index 1f05eb9..11297cc 100644 --- a/pyevr/openapi_client/models/assortment.py +++ b/pyevr/openapi_client/models/assortment.py @@ -1,81 +1,101 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self class Assortment(BaseModel): """ Assortment - """ + """ # noqa: E501 - code: Optional[StrictStr] = Field(None, description="Sortimendi kood") + code: Optional[StrictStr] = Field(default=None, description="Sortimendi kood") product_group_code: Optional[StrictStr] = Field( - None, alias="productGroupCode", description="Sortimendi tootegrupp" + default=None, description="Sortimendi tootegrupp", alias="productGroupCode" ) - name: Optional[StrictStr] = Field(None, description="Sortimendi nimi") + name: Optional[StrictStr] = Field(default=None, description="Sortimendi nimi") measurement_unit_code: Optional[StrictStr] = Field( - None, alias="measurementUnitCode", description="Sortimendi mõõtühik" + default=None, description="Sortimendi mõõtühik", alias="measurementUnitCode" + ) + __properties: ClassVar[List[str]] = [ + "code", + "productGroupCode", + "name", + "measurementUnitCode", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["code", "productGroupCode", "name", "measurementUnitCode"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Assortment: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Assortment from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Assortment: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Assortment from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Assortment.parse_obj(obj) + return cls.model_validate(obj) - _obj = Assortment.parse_obj( + _obj = cls.model_validate( { "code": obj.get("code"), - "product_group_code": obj.get("productGroupCode"), + "productGroupCode": obj.get("productGroupCode"), "name": obj.get("name"), - "measurement_unit_code": obj.get("measurementUnitCode"), + "measurementUnitCode": obj.get("measurementUnitCode"), } ) return _obj diff --git a/pyevr/openapi_client/models/authorization_type.py b/pyevr/openapi_client/models/authorization_type.py index 0f56ae4..ee19f98 100644 --- a/pyevr/openapi_client/models/authorization_type.py +++ b/pyevr/openapi_client/models/authorization_type.py @@ -1,21 +1,22 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg +from enum import Enum + +from typing_extensions import Self class AuthorizationType(str, Enum): @@ -28,6 +29,6 @@ class AuthorizationType(str, Enum): FORMEASURING = "forMeasuring" @classmethod - def from_json(cls, json_str: str) -> "AuthorizationType": + def from_json(cls, json_str: str) -> Self: """Create an instance of AuthorizationType from a JSON string""" - return AuthorizationType(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/baltpool_quality.py b/pyevr/openapi_client/models/baltpool_quality.py new file mode 100644 index 0000000..2e57e9b --- /dev/null +++ b/pyevr/openapi_client/models/baltpool_quality.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class BaltpoolQuality(str, Enum): + """ """ + + """ + allowed enum values + """ + SM1 = "sm1" + SM1W = "sm1w" + SM2 = "sm2" + SM3D = "sm3d" + SM3 = "sm3" + SM4 = "sm4" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BaltpoolQuality from a JSON string""" + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/cancel_waybill_request.py b/pyevr/openapi_client/models/cancel_waybill_request.py index ac9553e..1afb372 100644 --- a/pyevr/openapi_client/models/cancel_waybill_request.py +++ b/pyevr/openapi_client/models/cancel_waybill_request.py @@ -1,68 +1,97 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from pydantic import BaseModel, Field, constr +from pyevr.openapi_client.models.coordinates import Coordinates class CancelWaybillRequest(BaseModel): """ CancelWaybillRequest - """ + """ # noqa: E501 - reason: constr(strict=True, max_length=400, min_length=0) = Field( - ..., description="Selgitus" + reason: Annotated[str, Field(min_length=0, strict=True, max_length=400)] = Field( + description="Selgitus" ) - __properties = ["reason"] - - class Config: - """Pydantic configuration""" + coordinates: Optional[Coordinates] = None + __properties: ClassVar[List[str]] = ["reason", "coordinates"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CancelWaybillRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CancelWaybillRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict["coordinates"] = self.coordinates.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> CancelWaybillRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CancelWaybillRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CancelWaybillRequest.parse_obj(obj) - - _obj = CancelWaybillRequest.parse_obj({"reason": obj.get("reason")}) + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "reason": obj.get("reason"), + "coordinates": Coordinates.from_dict(obj["coordinates"]) + if obj.get("coordinates") is not None + else None, + } + ) return _obj diff --git a/pyevr/openapi_client/models/certificate.py b/pyevr/openapi_client/models/certificate.py index 9cae1ff..48bd3ac 100644 --- a/pyevr/openapi_client/models/certificate.py +++ b/pyevr/openapi_client/models/certificate.py @@ -1,68 +1,83 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self class Certificate(BaseModel): """ Certificate - """ - - code: Optional[StrictStr] = Field(None, description="Sertifikaadi kood") - name: Optional[StrictStr] = Field(None, description="Sertifikaadi nimetus") - __properties = ["code", "name"] + """ # noqa: E501 - class Config: - """Pydantic configuration""" + code: Optional[StrictStr] = Field(default=None, description="Sertifikaadi kood") + name: Optional[StrictStr] = Field(default=None, description="Sertifikaadi nimetus") + __properties: ClassVar[List[str]] = ["code", "name"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Certificate: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Certificate from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Certificate: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Certificate from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Certificate.parse_obj(obj) + return cls.model_validate(obj) - _obj = Certificate.parse_obj({"code": obj.get("code"), "name": obj.get("name")}) + _obj = cls.model_validate({"code": obj.get("code"), "name": obj.get("name")}) return _obj diff --git a/pyevr/openapi_client/models/certificate_claim.py b/pyevr/openapi_client/models/certificate_claim.py index 8d7f41a..6a01b64 100644 --- a/pyevr/openapi_client/models/certificate_claim.py +++ b/pyevr/openapi_client/models/certificate_claim.py @@ -1,80 +1,94 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from typing import Optional -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class CertificateClaim(BaseModel): """ CertificateClaim - """ + """ # noqa: E501 - code: constr(strict=True, max_length=50, min_length=0) = Field( - ..., - description="[Tarneahela sertifikaadi väite kood](#operation/Certificates_List)", + code: Annotated[str, Field(min_length=0, strict=True, max_length=50)] = Field( + description="[Tarneahela sertifikaadi väite kood](#operation/Certificates_List)" ) - number: Optional[constr(strict=True, max_length=50)] = Field( - None, description="Sertifikaadi number" + number: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field( + default=None, description="Sertifikaadi number" ) - __properties = ["code", "number"] + __properties: ClassVar[List[str]] = ["code", "number"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CertificateClaim: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CertificateClaim from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if number (nullable) is None - # and __fields_set__ contains the field - if self.number is None and "number" in self.__fields_set__: + # and model_fields_set contains the field + if self.number is None and "number" in self.model_fields_set: _dict["number"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> CertificateClaim: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CertificateClaim from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CertificateClaim.parse_obj(obj) + return cls.model_validate(obj) - _obj = CertificateClaim.parse_obj( + _obj = cls.model_validate( {"code": obj.get("code"), "number": obj.get("number")} ) return _obj diff --git a/pyevr/openapi_client/models/consolidated_act.py b/pyevr/openapi_client/models/consolidated_act.py index ca0adac..a00407b 100644 --- a/pyevr/openapi_client/models/consolidated_act.py +++ b/pyevr/openapi_client/models/consolidated_act.py @@ -1,111 +1,187 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Optional -from pydantic import Field, StrictStr, constr +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.consolidated_act_source_item import ( + ConsolidatedActSourceItem, +) +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.holding_base import HoldingBase class ConsolidatedAct(HoldingBase): """ ConsolidatedAct - """ + """ # noqa: E501 - contract_number: constr(strict=True, max_length=500, min_length=0) = Field( - ..., alias="contractNumber", description="Dokumendi number" - ) + contract_number: Annotated[ + str, Field(min_length=0, strict=True, max_length=500) + ] = Field(description="Dokumendi number", alias="contractNumber") contract_date: datetime = Field( - ..., alias="contractDate", description="Dokumendi kuupäev" + description="Dokumendi kuupäev", alias="contractDate" ) - cadaster: constr(strict=True, max_length=500, min_length=0) = Field( - ..., description="Katastritunnus" + cadaster: Annotated[str, Field(min_length=0, strict=True, max_length=500)] = Field( + description="Katastritunnus" ) - compartment: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Kvartal" + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" ) - forest_allocation_number: Optional[StrictStr] = Field( - None, alias="forestAllocationNumber", description="Metsaeraldis" + forest_allocation_number: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field(default=None, description="Metsaeraldis", alias="forestAllocationNumber") + forest_notice_number: Optional[ + Annotated[str, Field(strict=True, max_length=500)] + ] = Field( + default=None, description="Metsateatise number", alias="forestNoticeNumber" ) - __properties = [ + sources: Optional[List[ConsolidatedActSourceItem]] = Field( + default=None, description="Koormas olevate saadetiste päritolud" + ) + __properties: ClassVar[List[str]] = [ + "eudrNumbers", "type", "contractNumber", "contractDate", "cadaster", "compartment", "forestAllocationNumber", + "forestNoticeNumber", + "sources", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ConsolidatedAct: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ConsolidatedAct from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + if _item_sources: + _items.append(_item_sources.to_dict()) + _dict["sources"] = _items + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None # set to None if forest_allocation_number (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.forest_allocation_number is None - and "forest_allocation_number" in self.__fields_set__ + and "forest_allocation_number" in self.model_fields_set ): _dict["forestAllocationNumber"] = None + # set to None if forest_notice_number (nullable) is None + # and model_fields_set contains the field + if ( + self.forest_notice_number is None + and "forest_notice_number" in self.model_fields_set + ): + _dict["forestNoticeNumber"] = None + + # set to None if sources (nullable) is None + # and model_fields_set contains the field + if self.sources is None and "sources" in self.model_fields_set: + _dict["sources"] = None + return _dict @classmethod - def from_dict(cls, obj: dict) -> ConsolidatedAct: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ConsolidatedAct from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ConsolidatedAct.parse_obj(obj) + return cls.model_validate(obj) - _obj = ConsolidatedAct.parse_obj( + _obj = cls.model_validate( { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, "type": obj.get("type"), - "contract_number": obj.get("contractNumber"), - "contract_date": obj.get("contractDate"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), "cadaster": obj.get("cadaster"), "compartment": obj.get("compartment"), - "forest_allocation_number": obj.get("forestAllocationNumber"), + "forestAllocationNumber": obj.get("forestAllocationNumber"), + "forestNoticeNumber": obj.get("forestNoticeNumber"), + "sources": [ + ConsolidatedActSourceItem.from_dict(_item) + for _item in obj["sources"] + ] + if obj.get("sources") is not None + else None, } ) return _obj diff --git a/pyevr/openapi_client/models/consolidated_act_source_item.py b/pyevr/openapi_client/models/consolidated_act_source_item.py new file mode 100644 index 0000000..78e6aeb --- /dev/null +++ b/pyevr/openapi_client/models/consolidated_act_source_item.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.certificate_claim import CertificateClaim +from pyevr.openapi_client.models.holding_base_type import HoldingBaseType +from pyevr.openapi_client.models.previous_owner import PreviousOwner +from pyevr.openapi_client.models.shipment_assortment import ShipmentAssortment + + +class ConsolidatedActSourceItem(BaseModel): + """ + ConsolidatedActSourceItem + """ # noqa: E501 + + property_name: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field( + default=None, alias="propertyName" + ) + cadaster: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field( + description="Katastritunnus" + ) + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" + ) + assortment: ShipmentAssortment + amount: StrictInt = Field(description="Kogus") + unit_code: Annotated[str, Field(min_length=1, strict=True, max_length=10)] = Field( + description="[Mõõtühiku kood](#operation/MeasurementUnits_List)", + alias="unitCode", + ) + holding_base_type: HoldingBaseType = Field(alias="holdingBaseType") + forest_notice_number: Optional[ + Annotated[str, Field(strict=True, max_length=500)] + ] = Field( + default=None, description="Metsateatise number", alias="forestNoticeNumber" + ) + contract_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Dokumendi number", alias="contractNumber") + ) + contract_date: Optional[datetime] = Field( + default=None, description="Dokumendi kuupäev", alias="contractDate" + ) + certificate: Optional[CertificateClaim] = None + previous_owner: Optional[PreviousOwner] = Field(default=None, alias="previousOwner") + __properties: ClassVar[List[str]] = [ + "propertyName", + "cadaster", + "compartment", + "assortment", + "amount", + "unitCode", + "holdingBaseType", + "forestNoticeNumber", + "contractNumber", + "contractDate", + "certificate", + "previousOwner", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ConsolidatedActSourceItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of assortment + if self.assortment: + _dict["assortment"] = self.assortment.to_dict() + # override the default output from pydantic by calling `to_dict()` of certificate + if self.certificate: + _dict["certificate"] = self.certificate.to_dict() + # override the default output from pydantic by calling `to_dict()` of previous_owner + if self.previous_owner: + _dict["previousOwner"] = self.previous_owner.to_dict() + # set to None if property_name (nullable) is None + # and model_fields_set contains the field + if self.property_name is None and "property_name" in self.model_fields_set: + _dict["propertyName"] = None + + # set to None if compartment (nullable) is None + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: + _dict["compartment"] = None + + # set to None if forest_notice_number (nullable) is None + # and model_fields_set contains the field + if ( + self.forest_notice_number is None + and "forest_notice_number" in self.model_fields_set + ): + _dict["forestNoticeNumber"] = None + + # set to None if contract_number (nullable) is None + # and model_fields_set contains the field + if self.contract_number is None and "contract_number" in self.model_fields_set: + _dict["contractNumber"] = None + + # set to None if contract_date (nullable) is None + # and model_fields_set contains the field + if self.contract_date is None and "contract_date" in self.model_fields_set: + _dict["contractDate"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ConsolidatedActSourceItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "propertyName": obj.get("propertyName"), + "cadaster": obj.get("cadaster"), + "compartment": obj.get("compartment"), + "assortment": ShipmentAssortment.from_dict(obj["assortment"]) + if obj.get("assortment") is not None + else None, + "amount": obj.get("amount"), + "unitCode": obj.get("unitCode"), + "holdingBaseType": obj.get("holdingBaseType"), + "forestNoticeNumber": obj.get("forestNoticeNumber"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), + "certificate": CertificateClaim.from_dict(obj["certificate"]) + if obj.get("certificate") is not None + else None, + "previousOwner": PreviousOwner.from_dict(obj["previousOwner"]) + if obj.get("previousOwner") is not None + else None, + } + ) + return _obj diff --git a/pyevr/openapi_client/models/contact_person.py b/pyevr/openapi_client/models/contact_person.py index 3e7b6e9..61fbf30 100644 --- a/pyevr/openapi_client/models/contact_person.py +++ b/pyevr/openapi_client/models/contact_person.py @@ -1,92 +1,107 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from typing import Optional -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class ContactPerson(BaseModel): """ ContactPerson - """ + """ # noqa: E501 - name: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Nimi" + name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Nimi" ) - phone: Optional[constr(strict=True, max_length=25)] = Field( - None, description="Telefoninumber" + phone: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field( + default=None, description="Telefoninumber" ) - email: Optional[constr(strict=True, max_length=254)] = Field( - None, description="Email" + email: Optional[Annotated[str, Field(strict=True, max_length=254)]] = Field( + default=None, description="Email" ) - __properties = ["name", "phone", "email"] + __properties: ClassVar[List[str]] = ["name", "phone", "email"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ContactPerson: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ContactPerson from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if name (nullable) is None - # and __fields_set__ contains the field - if self.name is None and "name" in self.__fields_set__: + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: _dict["name"] = None # set to None if phone (nullable) is None - # and __fields_set__ contains the field - if self.phone is None and "phone" in self.__fields_set__: + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: _dict["phone"] = None # set to None if email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict["email"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ContactPerson: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ContactPerson from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ContactPerson.parse_obj(obj) + return cls.model_validate(obj) - _obj = ContactPerson.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "phone": obj.get("phone"), diff --git a/pyevr/openapi_client/models/contract_for_transfer_of_cutting_rights.py b/pyevr/openapi_client/models/contract_for_transfer_of_cutting_rights.py index feb0eab..7acc23d 100644 --- a/pyevr/openapi_client/models/contract_for_transfer_of_cutting_rights.py +++ b/pyevr/openapi_client/models/contract_for_transfer_of_cutting_rights.py @@ -1,25 +1,28 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Optional -from pydantic import Field, StrictStr, constr +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.holding_base import HoldingBase from pyevr.openapi_client.models.previous_owner import PreviousOwner @@ -27,25 +30,31 @@ class ContractForTransferOfCuttingRights(HoldingBase): """ ContractForTransferOfCuttingRights - """ + """ # noqa: E501 - contract_number: constr(strict=True, max_length=500, min_length=0) = Field( - ..., alias="contractNumber", description="Dokumendi number" - ) + contract_number: Annotated[ + str, Field(min_length=0, strict=True, max_length=500) + ] = Field(description="Dokumendi number", alias="contractNumber") contract_date: datetime = Field( - ..., alias="contractDate", description="Dokumendi kuupäev" + description="Dokumendi kuupäev", alias="contractDate" ) - cadaster: constr(strict=True, max_length=500, min_length=0) = Field( - ..., description="Katastritunnus" + cadaster: Annotated[str, Field(min_length=0, strict=True, max_length=500)] = Field( + description="Katastritunnus" ) - compartment: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Kvartal" + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" ) - forest_allocation_number: Optional[StrictStr] = Field( - None, alias="forestAllocationNumber", description="Metsaeraldis" + forest_allocation_number: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field(default=None, description="Metsaeraldis", alias="forestAllocationNumber") + previous_owner: PreviousOwner = Field(alias="previousOwner") + forest_notice_number: Optional[ + Annotated[str, Field(strict=True, max_length=500)] + ] = Field( + default=None, description="Metsateatise number", alias="forestNoticeNumber" ) - previous_owner: PreviousOwner = Field(..., alias="previousOwner") - __properties = [ + __properties: ClassVar[List[str]] = [ + "eudrNumbers", "type", "contractNumber", "contractDate", @@ -53,68 +62,110 @@ class ContractForTransferOfCuttingRights(HoldingBase): "compartment", "forestAllocationNumber", "previousOwner", + "forestNoticeNumber", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ContractForTransferOfCuttingRights: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ContractForTransferOfCuttingRights from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items # override the default output from pydantic by calling `to_dict()` of previous_owner if self.previous_owner: _dict["previousOwner"] = self.previous_owner.to_dict() + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None # set to None if forest_allocation_number (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.forest_allocation_number is None - and "forest_allocation_number" in self.__fields_set__ + and "forest_allocation_number" in self.model_fields_set ): _dict["forestAllocationNumber"] = None + # set to None if forest_notice_number (nullable) is None + # and model_fields_set contains the field + if ( + self.forest_notice_number is None + and "forest_notice_number" in self.model_fields_set + ): + _dict["forestNoticeNumber"] = None + return _dict @classmethod - def from_dict(cls, obj: dict) -> ContractForTransferOfCuttingRights: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ContractForTransferOfCuttingRights from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ContractForTransferOfCuttingRights.parse_obj(obj) + return cls.model_validate(obj) - _obj = ContractForTransferOfCuttingRights.parse_obj( + _obj = cls.model_validate( { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, "type": obj.get("type"), - "contract_number": obj.get("contractNumber"), - "contract_date": obj.get("contractDate"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), "cadaster": obj.get("cadaster"), "compartment": obj.get("compartment"), - "forest_allocation_number": obj.get("forestAllocationNumber"), - "previous_owner": PreviousOwner.from_dict(obj.get("previousOwner")) + "forestAllocationNumber": obj.get("forestAllocationNumber"), + "previousOwner": PreviousOwner.from_dict(obj["previousOwner"]) if obj.get("previousOwner") is not None else None, + "forestNoticeNumber": obj.get("forestNoticeNumber"), } ) return _obj diff --git a/pyevr/openapi_client/models/coordinates.py b/pyevr/openapi_client/models/coordinates.py index 5f07ca4..e2179d2 100644 --- a/pyevr/openapi_client/models/coordinates.py +++ b/pyevr/openapi_client/models/coordinates.py @@ -1,78 +1,94 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set, Union -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, conint +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing_extensions import Annotated, Self class Coordinates(BaseModel): """ Coordinates - """ + """ # noqa: E501 - x: Union[StrictFloat, StrictInt] = Field(..., description="X koordinaat") - y: Union[StrictFloat, StrictInt] = Field(..., description="Y koordinaat") - epsg: Optional[conint(strict=True, le=99999, ge=1000)] = Field( - None, description="EPSG formaadis koordinaatsüsteemiväärtus (näide: 3301)" + x: Union[StrictFloat, StrictInt] = Field(description="X koordinaat") + y: Union[StrictFloat, StrictInt] = Field(description="Y koordinaat") + epsg: Optional[Annotated[int, Field(le=99999, strict=True, ge=1000)]] = Field( + default=None, + description="EPSG formaadis koordinaatsüsteemiväärtus (näide: 3301)", ) - __properties = ["x", "y", "epsg"] + __properties: ClassVar[List[str]] = ["x", "y", "epsg"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Coordinates: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Coordinates from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if epsg (nullable) is None - # and __fields_set__ contains the field - if self.epsg is None and "epsg" in self.__fields_set__: + # and model_fields_set contains the field + if self.epsg is None and "epsg" in self.model_fields_set: _dict["epsg"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Coordinates: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Coordinates from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Coordinates.parse_obj(obj) + return cls.model_validate(obj) - _obj = Coordinates.parse_obj( + _obj = cls.model_validate( {"x": obj.get("x"), "y": obj.get("y"), "epsg": obj.get("epsg")} ) return _obj diff --git a/pyevr/openapi_client/models/defect_code.py b/pyevr/openapi_client/models/defect_code.py new file mode 100644 index 0000000..0d8a869 --- /dev/null +++ b/pyevr/openapi_client/models/defect_code.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class DefectCode(str, Enum): + """ """ + + """ + allowed enum values + """ + PEE = "pee" + JAM = "jam" + LYH = "lyh" + PIK = "pik" + KAA = "kaa" + MET = "met" + MAD = "mad" + KOV = "kov" + OKS = "oks" + RIK = "rik" + YTO = "yto" + SIN = "sin" + PUT = "put" + TAH = "tah" + TYY = "tyy" + MUU = "muu" + VPL = "vpl" + SYD = "syd" + LOH = "loh" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of DefectCode from a JSON string""" + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/deforestation_biomass.py b/pyevr/openapi_client/models/deforestation_biomass.py new file mode 100644 index 0000000..9adea3e --- /dev/null +++ b/pyevr/openapi_client/models/deforestation_biomass.py @@ -0,0 +1,134 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber +from pyevr.openapi_client.models.holding_base import HoldingBase + + +class DeforestationBiomass(HoldingBase): + """ + DeforestationBiomass + """ # noqa: E501 + + cadaster: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field( + description="Katastritunnus" + ) + contract_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Dokumendi number", alias="contractNumber") + ) + contract_date: Optional[datetime] = Field( + default=None, description="Dokumendi kuupäev", alias="contractDate" + ) + __properties: ClassVar[List[str]] = [ + "eudrNumbers", + "type", + "cadaster", + "contractNumber", + "contractDate", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DeforestationBiomass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + + # set to None if contract_number (nullable) is None + # and model_fields_set contains the field + if self.contract_number is None and "contract_number" in self.model_fields_set: + _dict["contractNumber"] = None + + # set to None if contract_date (nullable) is None + # and model_fields_set contains the field + if self.contract_date is None and "contract_date" in self.model_fields_set: + _dict["contractDate"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DeforestationBiomass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, + "type": obj.get("type"), + "cadaster": obj.get("cadaster"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/entity.py b/pyevr/openapi_client/models/entity.py index 138646f..c6e1f24 100644 --- a/pyevr/openapi_client/models/entity.py +++ b/pyevr/openapi_client/models/entity.py @@ -1,71 +1,87 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class Entity(BaseModel): """ Entity - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Nimi" + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="Nimi" ) - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Isiku- või registrikood" + code: Annotated[str, Field(min_length=1, strict=True, max_length=20)] = Field( + description="Isiku- või registrikood" ) - __properties = ["name", "code"] + __properties: ClassVar[List[str]] = ["name", "code"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Entity: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Entity from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Entity: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Entity from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Entity.parse_obj(obj) + return cls.model_validate(obj) - _obj = Entity.parse_obj({"name": obj.get("name"), "code": obj.get("code")}) + _obj = cls.model_validate({"name": obj.get("name"), "code": obj.get("code")}) return _obj diff --git a/pyevr/openapi_client/models/eudr_number.py b/pyevr/openapi_client/models/eudr_number.py new file mode 100644 index 0000000..2d61053 --- /dev/null +++ b/pyevr/openapi_client/models/eudr_number.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + + +class EudrNumber(BaseModel): + """ + EudrNumber + """ # noqa: E501 + + reference_number: Optional[Annotated[str, Field(strict=True, max_length=50)]] = ( + Field(default=None, description="Viitenumber", alias="referenceNumber") + ) + verification_number: Optional[Annotated[str, Field(strict=True, max_length=50)]] = ( + Field(default=None, description="Kontroll number", alias="verificationNumber") + ) + __properties: ClassVar[List[str]] = ["referenceNumber", "verificationNumber"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EudrNumber from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EudrNumber from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "referenceNumber": obj.get("referenceNumber"), + "verificationNumber": obj.get("verificationNumber"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/forest_act.py b/pyevr/openapi_client/models/forest_act.py index 0511484..137b6a8 100644 --- a/pyevr/openapi_client/models/forest_act.py +++ b/pyevr/openapi_client/models/forest_act.py @@ -1,49 +1,53 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Optional -from pydantic import Field, StrictStr, constr +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.holding_base import HoldingBase class ForestAct(HoldingBase): """ ForestAct - """ + """ # noqa: E501 - contract_number: constr(strict=True, max_length=500, min_length=0) = Field( - ..., alias="contractNumber", description="Dokumendi number" + contract_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Dokumendi number", alias="contractNumber") ) - contract_date: datetime = Field( - ..., alias="contractDate", description="Dokumendi kuupäev" + contract_date: Optional[datetime] = Field( + default=None, description="Dokumendi kuupäev", alias="contractDate" ) - cadaster: constr(strict=True, max_length=500, min_length=0) = Field( - ..., description="Katastritunnus" + cadaster: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field( + description="Katastritunnus" ) - compartment: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Kvartal" + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" ) - forest_allocation_number: Optional[StrictStr] = Field( - None, alias="forestAllocationNumber", description="Metsaeraldis" - ) - __properties = [ + forest_allocation_number: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field(default=None, description="Metsaeraldis", alias="forestAllocationNumber") + __properties: ClassVar[List[str]] = [ + "eudrNumbers", "type", "contractNumber", "contractDate", @@ -52,60 +56,102 @@ class ForestAct(HoldingBase): "forestAllocationNumber", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ForestAct: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ForestAct from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + + # set to None if contract_number (nullable) is None + # and model_fields_set contains the field + if self.contract_number is None and "contract_number" in self.model_fields_set: + _dict["contractNumber"] = None + + # set to None if contract_date (nullable) is None + # and model_fields_set contains the field + if self.contract_date is None and "contract_date" in self.model_fields_set: + _dict["contractDate"] = None + # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None # set to None if forest_allocation_number (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.forest_allocation_number is None - and "forest_allocation_number" in self.__fields_set__ + and "forest_allocation_number" in self.model_fields_set ): _dict["forestAllocationNumber"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ForestAct: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ForestAct from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ForestAct.parse_obj(obj) + return cls.model_validate(obj) - _obj = ForestAct.parse_obj( + _obj = cls.model_validate( { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, "type": obj.get("type"), - "contract_number": obj.get("contractNumber"), - "contract_date": obj.get("contractDate"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), "cadaster": obj.get("cadaster"), "compartment": obj.get("compartment"), - "forest_allocation_number": obj.get("forestAllocationNumber"), + "forestAllocationNumber": obj.get("forestAllocationNumber"), } ) return _obj diff --git a/pyevr/openapi_client/models/forest_notice.py b/pyevr/openapi_client/models/forest_notice.py index 9b0c654..aa4d66d 100644 --- a/pyevr/openapi_client/models/forest_notice.py +++ b/pyevr/openapi_client/models/forest_notice.py @@ -1,46 +1,49 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import Field, constr +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.holding_base import HoldingBase class ForestNotice(HoldingBase): """ ForestNotice - """ + """ # noqa: E501 - cadaster: constr(strict=True, max_length=500, min_length=0) = Field( - ..., description="Katastritunnus" - ) - compartment: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Kvartal" + cadaster: Annotated[str, Field(min_length=0, strict=True, max_length=500)] = Field( + description="Katastritunnus" ) - forest_allocation_number: Optional[constr(strict=True, max_length=200)] = Field( - None, alias="forestAllocationNumber", description="Metsaeraldis" + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" ) - number: Optional[constr(strict=True, max_length=500)] = Field( - None, description="Metsateatise number" + forest_allocation_number: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field(default=None, description="Metsaeraldis", alias="forestAllocationNumber") + number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field( + default=None, description="Metsateatise number" ) - __properties = [ + __properties: ClassVar[List[str]] = [ + "eudrNumbers", "type", "cadaster", "compartment", @@ -48,50 +51,82 @@ class ForestNotice(HoldingBase): "number", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ForestNotice: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ForestNotice from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ForestNotice: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ForestNotice from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ForestNotice.parse_obj(obj) + return cls.model_validate(obj) - _obj = ForestNotice.parse_obj( + _obj = cls.model_validate( { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, "type": obj.get("type"), "cadaster": obj.get("cadaster"), "compartment": obj.get("compartment"), - "forest_allocation_number": obj.get("forestAllocationNumber"), + "forestAllocationNumber": obj.get("forestAllocationNumber"), "number": obj.get("number"), } ) diff --git a/pyevr/openapi_client/models/holding_base.py b/pyevr/openapi_client/models/holding_base.py index e2ec4fa..0de6c5c 100644 --- a/pyevr/openapi_client/models/holding_base.py +++ b/pyevr/openapi_client/models/holding_base.py @@ -1,57 +1,84 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from importlib import import_module +from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Annotated, Self +from pyevr.openapi_client.models.eudr_number import EudrNumber -from typing import Union -from pydantic import BaseModel, Field, StrictStr +if TYPE_CHECKING: + from pyevr.openapi_client.models.agricultural_biomass import AgriculturalBiomass + from pyevr.openapi_client.models.consolidated_act import ConsolidatedAct + from pyevr.openapi_client.models.contract_for_transfer_of_cutting_rights import ( + ContractForTransferOfCuttingRights, + ) + from pyevr.openapi_client.models.deforestation_biomass import DeforestationBiomass + from pyevr.openapi_client.models.forest_act import ForestAct + from pyevr.openapi_client.models.forest_notice import ForestNotice + from pyevr.openapi_client.models.inventory_act import InventoryAct + from pyevr.openapi_client.models.non_forest_wood_biomass import NonForestWoodBiomass + from pyevr.openapi_client.models.sales_contract import SalesContract + from pyevr.openapi_client.models.secondary_waste_wood import SecondaryWasteWood + from pyevr.openapi_client.models.secondary_wood_biomass import SecondaryWoodBiomass + from pyevr.openapi_client.models.without_forest_notice import WithoutForestNotice class HoldingBase(BaseModel): """ HoldingBase - """ - - type: StrictStr = Field(...) - __properties = ["type"] + """ # noqa: E501 - class Config: - """Pydantic configuration""" + eudr_numbers: Optional[Annotated[List[EudrNumber], Field(max_length=50)]] = Field( + default=None, alias="eudrNumbers" + ) + type: StrictStr + __properties: ClassVar[List[str]] = ["eudrNumbers", "type"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) # JSON field name that stores the object type - __discriminator_property_name = "type" + __discriminator_property_name: ClassVar[str] = "type" # discriminator mappings - __discriminator_value_class_map = { + __discriminator_value_class_map: ClassVar[Dict[str, str]] = { + "AgriculturalBiomass": "AgriculturalBiomass", "ConsolidatedAct": "ConsolidatedAct", "ContractForTransferOfCuttingRights": "ContractForTransferOfCuttingRights", + "DeforestationBiomass": "DeforestationBiomass", "ForestAct": "ForestAct", "ForestNotice": "ForestNotice", "InventoryAct": "InventoryAct", + "NonForestWoodBiomass": "NonForestWoodBiomass", "SalesContract": "SalesContract", + "SecondaryWasteWood": "SecondaryWasteWood", + "SecondaryWoodBiomass": "SecondaryWoodBiomass", "WithoutForestNotice": "WithoutForestNotice", } @classmethod - def get_discriminator_value(cls, obj: dict) -> str: + def get_discriminator_value(cls, obj: Dict[str, Any]) -> Optional[str]: """Returns the discriminator value (object type) of the data""" discriminator_value = obj[cls.__discriminator_property_name] if discriminator_value: @@ -61,69 +88,142 @@ def get_discriminator_value(cls, obj: dict) -> str: def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod def from_json( cls, json_str: str - ) -> Union( - ConsolidatedAct, - ContractForTransferOfCuttingRights, - ForestAct, - ForestNotice, - InventoryAct, - SalesContract, - WithoutForestNotice, - ): + ) -> Optional[ + Union[ + AgriculturalBiomass, + ConsolidatedAct, + ContractForTransferOfCuttingRights, + DeforestationBiomass, + ForestAct, + ForestNotice, + InventoryAct, + NonForestWoodBiomass, + SalesContract, + SecondaryWasteWood, + SecondaryWoodBiomass, + WithoutForestNotice, + ] + ]: """Create an instance of HoldingBase from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + return _dict @classmethod def from_dict( - cls, obj: dict - ) -> Union( - ConsolidatedAct, - ContractForTransferOfCuttingRights, - ForestAct, - ForestNotice, - InventoryAct, - SalesContract, - WithoutForestNotice, - ): + cls, obj: Dict[str, Any] + ) -> Optional[ + Union[ + AgriculturalBiomass, + ConsolidatedAct, + ContractForTransferOfCuttingRights, + DeforestationBiomass, + ForestAct, + ForestNotice, + InventoryAct, + NonForestWoodBiomass, + SalesContract, + SecondaryWasteWood, + SecondaryWoodBiomass, + WithoutForestNotice, + ] + ]: """Create an instance of HoldingBase from a dict""" # look up the object type based on discriminator mapping object_type = cls.get_discriminator_value(obj) - if object_type: - klass = globals()[object_type] - return klass.from_dict(obj) - else: - raise ValueError( - "HoldingBase failed to lookup discriminator value from " - + json.dumps(obj) - + ". Discriminator property name: " - + cls.__discriminator_property_name - + ", mapping: " - + json.dumps(cls.__discriminator_value_class_map) - ) - - -from pyevr.openapi_client.models.consolidated_act import ConsolidatedAct -from pyevr.openapi_client.models.contract_for_transfer_of_cutting_rights import ( - ContractForTransferOfCuttingRights, -) -from pyevr.openapi_client.models.forest_act import ForestAct -from pyevr.openapi_client.models.forest_notice import ForestNotice -from pyevr.openapi_client.models.inventory_act import InventoryAct -from pyevr.openapi_client.models.sales_contract import SalesContract -from pyevr.openapi_client.models.without_forest_notice import WithoutForestNotice - -HoldingBase.update_forward_refs() + if object_type == "AgriculturalBiomass": + return import_module( + "pyevr.openapi_client.models.agricultural_biomass" + ).AgriculturalBiomass.from_dict(obj) + if object_type == "ConsolidatedAct": + return import_module( + "pyevr.openapi_client.models.consolidated_act" + ).ConsolidatedAct.from_dict(obj) + if object_type == "ContractForTransferOfCuttingRights": + return import_module( + "pyevr.openapi_client.models.contract_for_transfer_of_cutting_rights" + ).ContractForTransferOfCuttingRights.from_dict(obj) + if object_type == "DeforestationBiomass": + return import_module( + "pyevr.openapi_client.models.deforestation_biomass" + ).DeforestationBiomass.from_dict(obj) + if object_type == "ForestAct": + return import_module( + "pyevr.openapi_client.models.forest_act" + ).ForestAct.from_dict(obj) + if object_type == "ForestNotice": + return import_module( + "pyevr.openapi_client.models.forest_notice" + ).ForestNotice.from_dict(obj) + if object_type == "InventoryAct": + return import_module( + "pyevr.openapi_client.models.inventory_act" + ).InventoryAct.from_dict(obj) + if object_type == "NonForestWoodBiomass": + return import_module( + "pyevr.openapi_client.models.non_forest_wood_biomass" + ).NonForestWoodBiomass.from_dict(obj) + if object_type == "SalesContract": + return import_module( + "pyevr.openapi_client.models.sales_contract" + ).SalesContract.from_dict(obj) + if object_type == "SecondaryWasteWood": + return import_module( + "pyevr.openapi_client.models.secondary_waste_wood" + ).SecondaryWasteWood.from_dict(obj) + if object_type == "SecondaryWoodBiomass": + return import_module( + "pyevr.openapi_client.models.secondary_wood_biomass" + ).SecondaryWoodBiomass.from_dict(obj) + if object_type == "WithoutForestNotice": + return import_module( + "pyevr.openapi_client.models.without_forest_notice" + ).WithoutForestNotice.from_dict(obj) + + raise ValueError( + "HoldingBase failed to lookup discriminator value from " + + json.dumps(obj) + + ". Discriminator property name: " + + cls.__discriminator_property_name + + ", mapping: " + + json.dumps(cls.__discriminator_value_class_map) + ) diff --git a/pyevr/openapi_client/models/holding_base_type.py b/pyevr/openapi_client/models/holding_base_type.py new file mode 100644 index 0000000..13e4b08 --- /dev/null +++ b/pyevr/openapi_client/models/holding_base_type.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class HoldingBaseType(str, Enum): + """ """ + + """ + allowed enum values + """ + FORESTNOTICE = "forestNotice" + INVENTORYACT = "inventoryAct" + CONSOLIDATEDACT = "consolidatedAct" + FORESTACT = "forestAct" + SALESCONTRACT = "salesContract" + CONTRACTFORTRANSFEROFCUTTINGRIGHTS = "contractForTransferOfCuttingRights" + WITHOUTFORESTNOTICE = "withoutForestNotice" + AGRICULTURALBIOMASS = "agriculturalBiomass" + DEFORESTATIONBIOMASS = "deforestationBiomass" + NONFORESTWOODBIOMASS = "nonForestWoodBiomass" + SECONDARYWASTEWOOD = "secondaryWasteWood" + SECONDARYWOODBIOMASS = "secondaryWoodBiomass" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of HoldingBaseType from a JSON string""" + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/inventory_act.py b/pyevr/openapi_client/models/inventory_act.py index 680164a..94e9d26 100644 --- a/pyevr/openapi_client/models/inventory_act.py +++ b/pyevr/openapi_client/models/inventory_act.py @@ -1,111 +1,162 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Optional -from pydantic import Field, constr +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.holding_base import HoldingBase class InventoryAct(HoldingBase): """ InventoryAct - """ + """ # noqa: E501 - contract_number: constr(strict=True, max_length=500, min_length=0) = Field( - ..., alias="contractNumber", description="Dokumendi number" - ) + contract_number: Annotated[ + str, Field(min_length=0, strict=True, max_length=500) + ] = Field(description="Dokumendi number", alias="contractNumber") contract_date: datetime = Field( - ..., alias="contractDate", description="Dokumendi kuupäev" + description="Dokumendi kuupäev", alias="contractDate" ) - cadaster: constr(strict=True, max_length=500, min_length=0) = Field( - ..., description="Katastritunnus" + cadaster: Annotated[str, Field(min_length=0, strict=True, max_length=500)] = Field( + description="Katastritunnus" ) - compartment: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Kvartal" + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" ) - forest_allocation_number: Optional[constr(strict=True, max_length=200)] = Field( - None, alias="forestAllocationNumber", description="Metsaeraldis" + forest_allocation_number: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field(default=None, description="Metsaeraldis", alias="forestAllocationNumber") + forest_notice_number: Optional[ + Annotated[str, Field(strict=True, max_length=500)] + ] = Field( + default=None, description="Metsateatise number", alias="forestNoticeNumber" ) - __properties = [ + __properties: ClassVar[List[str]] = [ + "eudrNumbers", "type", "contractNumber", "contractDate", "cadaster", "compartment", "forestAllocationNumber", + "forestNoticeNumber", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> InventoryAct: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of InventoryAct from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None # set to None if forest_allocation_number (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.forest_allocation_number is None - and "forest_allocation_number" in self.__fields_set__ + and "forest_allocation_number" in self.model_fields_set ): _dict["forestAllocationNumber"] = None + # set to None if forest_notice_number (nullable) is None + # and model_fields_set contains the field + if ( + self.forest_notice_number is None + and "forest_notice_number" in self.model_fields_set + ): + _dict["forestNoticeNumber"] = None + return _dict @classmethod - def from_dict(cls, obj: dict) -> InventoryAct: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of InventoryAct from a dict""" if obj is None: return None if not isinstance(obj, dict): - return InventoryAct.parse_obj(obj) + return cls.model_validate(obj) - _obj = InventoryAct.parse_obj( + _obj = cls.model_validate( { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, "type": obj.get("type"), - "contract_number": obj.get("contractNumber"), - "contract_date": obj.get("contractDate"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), "cadaster": obj.get("cadaster"), "compartment": obj.get("compartment"), - "forest_allocation_number": obj.get("forestAllocationNumber"), + "forestAllocationNumber": obj.get("forestAllocationNumber"), + "forestNoticeNumber": obj.get("forestNoticeNumber"), } ) return _obj diff --git a/pyevr/openapi_client/models/measurement.py b/pyevr/openapi_client/models/measurement.py new file mode 100644 index 0000000..3b84c78 --- /dev/null +++ b/pyevr/openapi_client/models/measurement.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.pack import Pack +from pyevr.openapi_client.models.shipment_assortment import ShipmentAssortment + + +class Measurement(BaseModel): + """ + Measurement + """ # noqa: E501 + + amount: Union[ + Annotated[float, Field(le=1000000000, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Kogus") + pack: Optional[Pack] = None + unit_code: Annotated[str, Field(min_length=0, strict=True, max_length=10)] = Field( + description="[Mõõtühiku kood](#operation/MeasurementUnits_List)", + alias="unitCode", + ) + assortment: ShipmentAssortment + moisture_percentage: Optional[ + Union[ + Annotated[float, Field(le=1.0, strict=True, ge=0.0)], + Annotated[int, Field(le=1, strict=True, ge=0)], + ] + ] = Field(default=None, description="Niiskuse protsent", alias="moisturePercentage") + energy_mwh: Optional[ + Union[ + Annotated[float, Field(le=1.0e9, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] + ] = Field( + default=None, description="Mõõdetud energia megavatt-tunnis", alias="energyMWh" + ) + measurement_report_url: Optional[ + Annotated[str, Field(strict=True, max_length=2000)] + ] = Field( + default=None, + description="Mõõtmisandmete raporti link", + alias="measurementReportUrl", + ) + __properties: ClassVar[List[str]] = [ + "amount", + "pack", + "unitCode", + "assortment", + "moisturePercentage", + "energyMWh", + "measurementReportUrl", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Measurement from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pack + if self.pack: + _dict["pack"] = self.pack.to_dict() + # override the default output from pydantic by calling `to_dict()` of assortment + if self.assortment: + _dict["assortment"] = self.assortment.to_dict() + # set to None if moisture_percentage (nullable) is None + # and model_fields_set contains the field + if ( + self.moisture_percentage is None + and "moisture_percentage" in self.model_fields_set + ): + _dict["moisturePercentage"] = None + + # set to None if energy_mwh (nullable) is None + # and model_fields_set contains the field + if self.energy_mwh is None and "energy_mwh" in self.model_fields_set: + _dict["energyMWh"] = None + + # set to None if measurement_report_url (nullable) is None + # and model_fields_set contains the field + if ( + self.measurement_report_url is None + and "measurement_report_url" in self.model_fields_set + ): + _dict["measurementReportUrl"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Measurement from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "amount": obj.get("amount"), + "pack": Pack.from_dict(obj["pack"]) + if obj.get("pack") is not None + else None, + "unitCode": obj.get("unitCode"), + "assortment": ShipmentAssortment.from_dict(obj["assortment"]) + if obj.get("assortment") is not None + else None, + "moisturePercentage": obj.get("moisturePercentage"), + "energyMWh": obj.get("energyMWh"), + "measurementReportUrl": obj.get("measurementReportUrl"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/measurement_act.py b/pyevr/openapi_client/models/measurement_act.py index bc90eed..f52bfd4 100644 --- a/pyevr/openapi_client/models/measurement_act.py +++ b/pyevr/openapi_client/models/measurement_act.py @@ -1,56 +1,58 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist, constr -from pyevr.openapi_client.models.shipment_item import ShipmentItem +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.measurement import Measurement from pyevr.openapi_client.models.total import Total class MeasurementAct(BaseModel): """ MeasurementAct - """ + """ # noqa: E501 - act_number: Optional[constr(strict=True, max_length=25, min_length=0)] = Field( - None, alias="actNumber", description="Mõõtmisakti number" - ) + act_number: Optional[ + Annotated[str, Field(min_length=0, strict=True, max_length=25)] + ] = Field(default=None, description="Mõõtmisakti number", alias="actNumber") act_date: Optional[datetime] = Field( - None, alias="actDate", description="Mõõtmisakti kuupäev" + default=None, description="Mõõtmisakti kuupäev", alias="actDate" ) - measurements: Optional[conlist(ShipmentItem)] = Field( - None, description="Mõõtmistulemused EVR poolt sätestatud formaadis " + measurements: Optional[List[Measurement]] = Field( + default=None, description="Mõõtmistulemused EVR poolt sätestatud formaadis " ) custom_measurement_data: Optional[Any] = Field( - None, - alias="customMeasurementData", + default=None, description="Mõõtmistulemused vabas formaadis", + alias="customMeasurementData", ) measurer_code: Optional[StrictStr] = Field( - None, alias="measurerCode", description="Mõõtja registri kood" + default=None, description="Mõõtja registri kood", alias="measurerCode" ) creation_time: Optional[datetime] = Field( - None, alias="creationTime", description="Lisamise aeg" + default=None, description="Lisamise aeg", alias="creationTime" ) total: Optional[Total] = None - __properties = [ + __properties: ClassVar[List[str]] = [ "actNumber", "actDate", "measurements", @@ -60,85 +62,100 @@ class MeasurementAct(BaseModel): "total", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> MeasurementAct: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MeasurementAct from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in measurements (list) _items = [] if self.measurements: - for _item in self.measurements: - if _item: - _items.append(_item.to_dict()) + for _item_measurements in self.measurements: + if _item_measurements: + _items.append(_item_measurements.to_dict()) _dict["measurements"] = _items # override the default output from pydantic by calling `to_dict()` of total if self.total: _dict["total"] = self.total.to_dict() # set to None if act_number (nullable) is None - # and __fields_set__ contains the field - if self.act_number is None and "act_number" in self.__fields_set__: + # and model_fields_set contains the field + if self.act_number is None and "act_number" in self.model_fields_set: _dict["actNumber"] = None # set to None if act_date (nullable) is None - # and __fields_set__ contains the field - if self.act_date is None and "act_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.act_date is None and "act_date" in self.model_fields_set: _dict["actDate"] = None # set to None if measurements (nullable) is None - # and __fields_set__ contains the field - if self.measurements is None and "measurements" in self.__fields_set__: + # and model_fields_set contains the field + if self.measurements is None and "measurements" in self.model_fields_set: _dict["measurements"] = None # set to None if custom_measurement_data (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.custom_measurement_data is None - and "custom_measurement_data" in self.__fields_set__ + and "custom_measurement_data" in self.model_fields_set ): _dict["customMeasurementData"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> MeasurementAct: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MeasurementAct from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MeasurementAct.parse_obj(obj) + return cls.model_validate(obj) - _obj = MeasurementAct.parse_obj( + _obj = cls.model_validate( { - "act_number": obj.get("actNumber"), - "act_date": obj.get("actDate"), + "actNumber": obj.get("actNumber"), + "actDate": obj.get("actDate"), "measurements": [ - ShipmentItem.from_dict(_item) for _item in obj.get("measurements") + Measurement.from_dict(_item) for _item in obj["measurements"] ] if obj.get("measurements") is not None else None, - "custom_measurement_data": obj.get("customMeasurementData"), - "measurer_code": obj.get("measurerCode"), - "creation_time": obj.get("creationTime"), - "total": Total.from_dict(obj.get("total")) + "customMeasurementData": obj.get("customMeasurementData"), + "measurerCode": obj.get("measurerCode"), + "creationTime": obj.get("creationTime"), + "total": Total.from_dict(obj["total"]) if obj.get("total") is not None else None, } diff --git a/pyevr/openapi_client/models/measurement_unit.py b/pyevr/openapi_client/models/measurement_unit.py index 7aa0273..d1c16c6 100644 --- a/pyevr/openapi_client/models/measurement_unit.py +++ b/pyevr/openapi_client/models/measurement_unit.py @@ -1,70 +1,83 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self class MeasurementUnit(BaseModel): """ MeasurementUnit - """ + """ # noqa: E501 - code: Optional[StrictStr] = Field(None, description="Mõõtühiku kood") - name: Optional[StrictStr] = Field(None, description="Mõõtühiku nimetus") - __properties = ["code", "name"] + code: Optional[StrictStr] = Field(default=None, description="Mõõtühiku kood") + name: Optional[StrictStr] = Field(default=None, description="Mõõtühiku nimetus") + __properties: ClassVar[List[str]] = ["code", "name"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> MeasurementUnit: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of MeasurementUnit from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> MeasurementUnit: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of MeasurementUnit from a dict""" if obj is None: return None if not isinstance(obj, dict): - return MeasurementUnit.parse_obj(obj) + return cls.model_validate(obj) - _obj = MeasurementUnit.parse_obj( - {"code": obj.get("code"), "name": obj.get("name")} - ) + _obj = cls.model_validate({"code": obj.get("code"), "name": obj.get("name")}) return _obj diff --git a/pyevr/openapi_client/models/non_forest_wood_biomass.py b/pyevr/openapi_client/models/non_forest_wood_biomass.py new file mode 100644 index 0000000..371a954 --- /dev/null +++ b/pyevr/openapi_client/models/non_forest_wood_biomass.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber +from pyevr.openapi_client.models.holding_base import HoldingBase +from pyevr.openapi_client.models.previous_owner import PreviousOwner + + +class NonForestWoodBiomass(HoldingBase): + """ + NonForestWoodBiomass + """ # noqa: E501 + + cadaster: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field( + description="Katastritunnus" + ) + contract_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Dokumendi number", alias="contractNumber") + ) + contract_date: Optional[datetime] = Field( + default=None, description="Dokumendi kuupäev", alias="contractDate" + ) + previous_owner: Optional[PreviousOwner] = Field(default=None, alias="previousOwner") + __properties: ClassVar[List[str]] = [ + "eudrNumbers", + "type", + "cadaster", + "contractNumber", + "contractDate", + "previousOwner", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NonForestWoodBiomass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # override the default output from pydantic by calling `to_dict()` of previous_owner + if self.previous_owner: + _dict["previousOwner"] = self.previous_owner.to_dict() + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + + # set to None if contract_number (nullable) is None + # and model_fields_set contains the field + if self.contract_number is None and "contract_number" in self.model_fields_set: + _dict["contractNumber"] = None + + # set to None if contract_date (nullable) is None + # and model_fields_set contains the field + if self.contract_date is None and "contract_date" in self.model_fields_set: + _dict["contractDate"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NonForestWoodBiomass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, + "type": obj.get("type"), + "cadaster": obj.get("cadaster"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), + "previousOwner": PreviousOwner.from_dict(obj["previousOwner"]) + if obj.get("previousOwner") is not None + else None, + } + ) + return _obj diff --git a/pyevr/openapi_client/models/organization.py b/pyevr/openapi_client/models/organization.py index ee96a91..dc65a64 100644 --- a/pyevr/openapi_client/models/organization.py +++ b/pyevr/openapi_client/models/organization.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictStr, conlist from pyevr.openapi_client.models.address import Address from pyevr.openapi_client.models.contact_person import ContactPerson @@ -27,22 +28,22 @@ class Organization(BaseModel): """ Organization - """ + """ # noqa: E501 - name: Optional[StrictStr] = Field(None, description="Asutuse nimi") + name: Optional[StrictStr] = Field(default=None, description="Asutuse nimi") waybill_number_prefix: Optional[StrictStr] = Field( - None, alias="waybillNumberPrefix" + default=None, alias="waybillNumberPrefix" ) register_code: Optional[StrictStr] = Field( - None, alias="registerCode", description="Registrikood" + default=None, description="Registrikood", alias="registerCode" ) address: Optional[Address] = None - email: Optional[StrictStr] = Field(None, description="Asutuse üldemail") - phone: Optional[StrictStr] = Field(None, description="Asutuse üldtelefon") - contact_persons: Optional[conlist(ContactPerson)] = Field( - None, alias="contactPersons", description="Kontaktisikud" + email: Optional[StrictStr] = Field(default=None, description="Asutuse üldemail") + phone: Optional[StrictStr] = Field(default=None, description="Asutuse üldtelefon") + contact_persons: Optional[List[ContactPerson]] = Field( + default=None, description="Kontaktisikud", alias="contactPersons" ) - __properties = [ + __properties: ClassVar[List[str]] = [ "name", "waybillNumberPrefix", "registerCode", @@ -52,62 +53,76 @@ class Organization(BaseModel): "contactPersons", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Organization: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Organization from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of address if self.address: _dict["address"] = self.address.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in contact_persons (list) _items = [] if self.contact_persons: - for _item in self.contact_persons: - if _item: - _items.append(_item.to_dict()) + for _item_contact_persons in self.contact_persons: + if _item_contact_persons: + _items.append(_item_contact_persons.to_dict()) _dict["contactPersons"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> Organization: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Organization from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Organization.parse_obj(obj) + return cls.model_validate(obj) - _obj = Organization.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), - "waybill_number_prefix": obj.get("waybillNumberPrefix"), - "register_code": obj.get("registerCode"), - "address": Address.from_dict(obj.get("address")) + "waybillNumberPrefix": obj.get("waybillNumberPrefix"), + "registerCode": obj.get("registerCode"), + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, "email": obj.get("email"), "phone": obj.get("phone"), - "contact_persons": [ - ContactPerson.from_dict(_item) - for _item in obj.get("contactPersons") + "contactPersons": [ + ContactPerson.from_dict(_item) for _item in obj["contactPersons"] ] if obj.get("contactPersons") is not None else None, diff --git a/pyevr/openapi_client/models/owner.py b/pyevr/openapi_client/models/owner.py index 84be7ab..22ef7ca 100644 --- a/pyevr/openapi_client/models/owner.py +++ b/pyevr/openapi_client/models/owner.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import BaseModel, Field, constr from pyevr.openapi_client.models.address import Address from pyevr.openapi_client.models.contact_person import ContactPerson from pyevr.openapi_client.models.representer import Representer @@ -28,44 +29,66 @@ class Owner(BaseModel): """ Owner - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Nimi" + name: Annotated[str, Field(min_length=0, strict=True, max_length=200)] = Field( + description="Nimi" ) - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Isiku- või registrikood" + code: Annotated[str, Field(min_length=0, strict=True, max_length=20)] = Field( + description="Isiku- või registrikood" ) - email: Optional[constr(strict=True, max_length=254)] = Field( - None, description="Email" + email: Optional[Annotated[str, Field(strict=True, max_length=254)]] = Field( + default=None, description="Email" ) - address: Address = Field(...) - contact_person: Optional[ContactPerson] = Field(None, alias="contactPerson") + address: Address + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") representer: Optional[Representer] = None - __properties = ["name", "code", "email", "address", "contactPerson", "representer"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + __properties: ClassVar[List[str]] = [ + "name", + "code", + "email", + "address", + "contactPerson", + "representer", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Owner: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Owner from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of address if self.address: _dict["address"] = self.address.to_dict() @@ -76,33 +99,33 @@ def to_dict(self): if self.representer: _dict["representer"] = self.representer.to_dict() # set to None if email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict["email"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Owner: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Owner from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Owner.parse_obj(obj) + return cls.model_validate(obj) - _obj = Owner.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "code": obj.get("code"), "email": obj.get("email"), - "address": Address.from_dict(obj.get("address")) + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, - "contact_person": ContactPerson.from_dict(obj.get("contactPerson")) + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) if obj.get("contactPerson") is not None else None, - "representer": Representer.from_dict(obj.get("representer")) + "representer": Representer.from_dict(obj["representer"]) if obj.get("representer") is not None else None, } diff --git a/pyevr/openapi_client/models/pack.py b/pyevr/openapi_client/models/pack.py index fcaa852..17b5301 100644 --- a/pyevr/openapi_client/models/pack.py +++ b/pyevr/openapi_client/models/pack.py @@ -1,53 +1,55 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set, Union +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Union -from pydantic import BaseModel, Field, confloat, conint from pyevr.openapi_client.models.pack_location import PackLocation class Pack(BaseModel): """ Pack - """ + """ # noqa: E501 - pack_number: conint(strict=True, le=2147483647, ge=1) = Field( - ..., alias="packNumber", description="Paki number" + pack_number: Annotated[int, Field(le=2147483647, strict=True, ge=1)] = Field( + description="Paki number", alias="packNumber" ) length: Union[ - confloat(le=1.0e9, ge=0.0, strict=True), - conint(le=1000000000, ge=0, strict=True), - ] = Field(..., description="Koormapaki pikkus") + Annotated[float, Field(le=1.0e9, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Koormapaki pikkus") height: Union[ - confloat(le=1.0e9, ge=0.0, strict=True), - conint(le=1000000000, ge=0, strict=True), - ] = Field(..., description="Koosmapaki kõrgus") + Annotated[float, Field(le=1.0e9, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Koosmapaki kõrgus") width: Union[ - confloat(le=1.0e9, ge=0.0, strict=True), - conint(le=1000000000, ge=0, strict=True), - ] = Field(..., description="Koormapaki laius") + Annotated[float, Field(le=1.0e9, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Koormapaki laius") coefficient: Union[ - confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True) - ] = Field(..., description="Koeffitsient") - location: PackLocation = Field(...) - __properties = [ + Annotated[float, Field(le=1.0, strict=True, ge=0.0)], + Annotated[int, Field(le=1, strict=True, ge=0)], + ] = Field(description="Koeffitsient") + location: PackLocation + __properties: ClassVar[List[str]] = [ "packNumber", "length", "height", @@ -56,42 +58,57 @@ class Pack(BaseModel): "location", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Pack: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Pack from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Pack: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Pack from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Pack.parse_obj(obj) + return cls.model_validate(obj) - _obj = Pack.parse_obj( + _obj = cls.model_validate( { - "pack_number": obj.get("packNumber"), + "packNumber": obj.get("packNumber"), "length": obj.get("length"), "height": obj.get("height"), "width": obj.get("width"), diff --git a/pyevr/openapi_client/models/pack_location.py b/pyevr/openapi_client/models/pack_location.py index 3380a28..4949b02 100644 --- a/pyevr/openapi_client/models/pack_location.py +++ b/pyevr/openapi_client/models/pack_location.py @@ -1,21 +1,22 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg +from enum import Enum + +from typing_extensions import Self class PackLocation(str, Enum): @@ -28,6 +29,6 @@ class PackLocation(str, Enum): TRAILER = "trailer" @classmethod - def from_json(cls, json_str: str) -> "PackLocation": + def from_json(cls, json_str: str) -> Self: """Create an instance of PackLocation from a JSON string""" - return PackLocation(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/paged_result_of_assortment.py b/pyevr/openapi_client/models/paged_result_of_assortment.py index c5565c7..d69cead 100644 --- a/pyevr/openapi_client/models/paged_result_of_assortment.py +++ b/pyevr/openapi_client/models/paged_result_of_assortment.py @@ -1,97 +1,118 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, conlist from pyevr.openapi_client.models.assortment import Assortment class PagedResultOfAssortment(BaseModel): """ PagedResultOfAssortment - """ + """ # noqa: E501 page_number: Optional[StrictInt] = Field( - None, alias="pageNumber", description="Lehekülje number" + default=None, description="Lehekülje number", alias="pageNumber" ) page_size: Optional[StrictInt] = Field( - None, alias="pageSize", description="Lehekülje suurus" + default=None, description="Lehekülje suurus", alias="pageSize" ) - page_result: Optional[conlist(Assortment)] = Field( - None, alias="pageResult", description="Lehekülje tulemused" + page_result: Optional[List[Assortment]] = Field( + default=None, description="Lehekülje tulemused", alias="pageResult" ) total_count: Optional[StrictInt] = Field( - None, alias="totalCount", description="Päringu vastete arv kokku" + default=None, description="Päringu vastete arv kokku", alias="totalCount" + ) + __properties: ClassVar[List[str]] = [ + "pageNumber", + "pageSize", + "pageResult", + "totalCount", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["pageNumber", "pageSize", "pageResult", "totalCount"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PagedResultOfAssortment: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PagedResultOfAssortment from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in page_result (list) _items = [] if self.page_result: - for _item in self.page_result: - if _item: - _items.append(_item.to_dict()) + for _item_page_result in self.page_result: + if _item_page_result: + _items.append(_item_page_result.to_dict()) _dict["pageResult"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PagedResultOfAssortment: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PagedResultOfAssortment from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PagedResultOfAssortment.parse_obj(obj) + return cls.model_validate(obj) - _obj = PagedResultOfAssortment.parse_obj( + _obj = cls.model_validate( { - "page_number": obj.get("pageNumber"), - "page_size": obj.get("pageSize"), - "page_result": [ - Assortment.from_dict(_item) for _item in obj.get("pageResult") + "pageNumber": obj.get("pageNumber"), + "pageSize": obj.get("pageSize"), + "pageResult": [ + Assortment.from_dict(_item) for _item in obj["pageResult"] ] if obj.get("pageResult") is not None else None, - "total_count": obj.get("totalCount"), + "totalCount": obj.get("totalCount"), } ) return _obj diff --git a/pyevr/openapi_client/models/paged_result_of_certificate.py b/pyevr/openapi_client/models/paged_result_of_certificate.py index 9732c9a..afc6187 100644 --- a/pyevr/openapi_client/models/paged_result_of_certificate.py +++ b/pyevr/openapi_client/models/paged_result_of_certificate.py @@ -1,97 +1,118 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, conlist from pyevr.openapi_client.models.certificate import Certificate class PagedResultOfCertificate(BaseModel): """ PagedResultOfCertificate - """ + """ # noqa: E501 page_number: Optional[StrictInt] = Field( - None, alias="pageNumber", description="Lehekülje number" + default=None, description="Lehekülje number", alias="pageNumber" ) page_size: Optional[StrictInt] = Field( - None, alias="pageSize", description="Lehekülje suurus" + default=None, description="Lehekülje suurus", alias="pageSize" ) - page_result: Optional[conlist(Certificate)] = Field( - None, alias="pageResult", description="Lehekülje tulemused" + page_result: Optional[List[Certificate]] = Field( + default=None, description="Lehekülje tulemused", alias="pageResult" ) total_count: Optional[StrictInt] = Field( - None, alias="totalCount", description="Päringu vastete arv kokku" + default=None, description="Päringu vastete arv kokku", alias="totalCount" + ) + __properties: ClassVar[List[str]] = [ + "pageNumber", + "pageSize", + "pageResult", + "totalCount", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["pageNumber", "pageSize", "pageResult", "totalCount"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PagedResultOfCertificate: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PagedResultOfCertificate from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in page_result (list) _items = [] if self.page_result: - for _item in self.page_result: - if _item: - _items.append(_item.to_dict()) + for _item_page_result in self.page_result: + if _item_page_result: + _items.append(_item_page_result.to_dict()) _dict["pageResult"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PagedResultOfCertificate: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PagedResultOfCertificate from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PagedResultOfCertificate.parse_obj(obj) + return cls.model_validate(obj) - _obj = PagedResultOfCertificate.parse_obj( + _obj = cls.model_validate( { - "page_number": obj.get("pageNumber"), - "page_size": obj.get("pageSize"), - "page_result": [ - Certificate.from_dict(_item) for _item in obj.get("pageResult") + "pageNumber": obj.get("pageNumber"), + "pageSize": obj.get("pageSize"), + "pageResult": [ + Certificate.from_dict(_item) for _item in obj["pageResult"] ] if obj.get("pageResult") is not None else None, - "total_count": obj.get("totalCount"), + "totalCount": obj.get("totalCount"), } ) return _obj diff --git a/pyevr/openapi_client/models/paged_result_of_measurement_act.py b/pyevr/openapi_client/models/paged_result_of_measurement_act.py index d0b756d..24c5ce4 100644 --- a/pyevr/openapi_client/models/paged_result_of_measurement_act.py +++ b/pyevr/openapi_client/models/paged_result_of_measurement_act.py @@ -1,97 +1,118 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, conlist from pyevr.openapi_client.models.measurement_act import MeasurementAct class PagedResultOfMeasurementAct(BaseModel): """ PagedResultOfMeasurementAct - """ + """ # noqa: E501 page_number: Optional[StrictInt] = Field( - None, alias="pageNumber", description="Lehekülje number" + default=None, description="Lehekülje number", alias="pageNumber" ) page_size: Optional[StrictInt] = Field( - None, alias="pageSize", description="Lehekülje suurus" + default=None, description="Lehekülje suurus", alias="pageSize" ) - page_result: Optional[conlist(MeasurementAct)] = Field( - None, alias="pageResult", description="Lehekülje tulemused" + page_result: Optional[List[MeasurementAct]] = Field( + default=None, description="Lehekülje tulemused", alias="pageResult" ) total_count: Optional[StrictInt] = Field( - None, alias="totalCount", description="Päringu vastete arv kokku" + default=None, description="Päringu vastete arv kokku", alias="totalCount" + ) + __properties: ClassVar[List[str]] = [ + "pageNumber", + "pageSize", + "pageResult", + "totalCount", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["pageNumber", "pageSize", "pageResult", "totalCount"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PagedResultOfMeasurementAct: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PagedResultOfMeasurementAct from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in page_result (list) _items = [] if self.page_result: - for _item in self.page_result: - if _item: - _items.append(_item.to_dict()) + for _item_page_result in self.page_result: + if _item_page_result: + _items.append(_item_page_result.to_dict()) _dict["pageResult"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PagedResultOfMeasurementAct: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PagedResultOfMeasurementAct from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PagedResultOfMeasurementAct.parse_obj(obj) + return cls.model_validate(obj) - _obj = PagedResultOfMeasurementAct.parse_obj( + _obj = cls.model_validate( { - "page_number": obj.get("pageNumber"), - "page_size": obj.get("pageSize"), - "page_result": [ - MeasurementAct.from_dict(_item) for _item in obj.get("pageResult") + "pageNumber": obj.get("pageNumber"), + "pageSize": obj.get("pageSize"), + "pageResult": [ + MeasurementAct.from_dict(_item) for _item in obj["pageResult"] ] if obj.get("pageResult") is not None else None, - "total_count": obj.get("totalCount"), + "totalCount": obj.get("totalCount"), } ) return _obj diff --git a/pyevr/openapi_client/models/paged_result_of_measurement_unit.py b/pyevr/openapi_client/models/paged_result_of_measurement_unit.py index 7e7211f..ffef1e6 100644 --- a/pyevr/openapi_client/models/paged_result_of_measurement_unit.py +++ b/pyevr/openapi_client/models/paged_result_of_measurement_unit.py @@ -1,97 +1,118 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, conlist from pyevr.openapi_client.models.measurement_unit import MeasurementUnit class PagedResultOfMeasurementUnit(BaseModel): """ PagedResultOfMeasurementUnit - """ + """ # noqa: E501 page_number: Optional[StrictInt] = Field( - None, alias="pageNumber", description="Lehekülje number" + default=None, description="Lehekülje number", alias="pageNumber" ) page_size: Optional[StrictInt] = Field( - None, alias="pageSize", description="Lehekülje suurus" + default=None, description="Lehekülje suurus", alias="pageSize" ) - page_result: Optional[conlist(MeasurementUnit)] = Field( - None, alias="pageResult", description="Lehekülje tulemused" + page_result: Optional[List[MeasurementUnit]] = Field( + default=None, description="Lehekülje tulemused", alias="pageResult" ) total_count: Optional[StrictInt] = Field( - None, alias="totalCount", description="Päringu vastete arv kokku" + default=None, description="Päringu vastete arv kokku", alias="totalCount" + ) + __properties: ClassVar[List[str]] = [ + "pageNumber", + "pageSize", + "pageResult", + "totalCount", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["pageNumber", "pageSize", "pageResult", "totalCount"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PagedResultOfMeasurementUnit: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PagedResultOfMeasurementUnit from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in page_result (list) _items = [] if self.page_result: - for _item in self.page_result: - if _item: - _items.append(_item.to_dict()) + for _item_page_result in self.page_result: + if _item_page_result: + _items.append(_item_page_result.to_dict()) _dict["pageResult"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PagedResultOfMeasurementUnit: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PagedResultOfMeasurementUnit from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PagedResultOfMeasurementUnit.parse_obj(obj) + return cls.model_validate(obj) - _obj = PagedResultOfMeasurementUnit.parse_obj( + _obj = cls.model_validate( { - "page_number": obj.get("pageNumber"), - "page_size": obj.get("pageSize"), - "page_result": [ - MeasurementUnit.from_dict(_item) for _item in obj.get("pageResult") + "pageNumber": obj.get("pageNumber"), + "pageSize": obj.get("pageSize"), + "pageResult": [ + MeasurementUnit.from_dict(_item) for _item in obj["pageResult"] ] if obj.get("pageResult") is not None else None, - "total_count": obj.get("totalCount"), + "totalCount": obj.get("totalCount"), } ) return _obj diff --git a/pyevr/openapi_client/models/paged_result_of_organization.py b/pyevr/openapi_client/models/paged_result_of_organization.py index 98612e0..45f1e2b 100644 --- a/pyevr/openapi_client/models/paged_result_of_organization.py +++ b/pyevr/openapi_client/models/paged_result_of_organization.py @@ -1,97 +1,118 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, conlist from pyevr.openapi_client.models.organization import Organization class PagedResultOfOrganization(BaseModel): """ PagedResultOfOrganization - """ + """ # noqa: E501 page_number: Optional[StrictInt] = Field( - None, alias="pageNumber", description="Lehekülje number" + default=None, description="Lehekülje number", alias="pageNumber" ) page_size: Optional[StrictInt] = Field( - None, alias="pageSize", description="Lehekülje suurus" + default=None, description="Lehekülje suurus", alias="pageSize" ) - page_result: Optional[conlist(Organization)] = Field( - None, alias="pageResult", description="Lehekülje tulemused" + page_result: Optional[List[Organization]] = Field( + default=None, description="Lehekülje tulemused", alias="pageResult" ) total_count: Optional[StrictInt] = Field( - None, alias="totalCount", description="Päringu vastete arv kokku" + default=None, description="Päringu vastete arv kokku", alias="totalCount" + ) + __properties: ClassVar[List[str]] = [ + "pageNumber", + "pageSize", + "pageResult", + "totalCount", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["pageNumber", "pageSize", "pageResult", "totalCount"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PagedResultOfOrganization: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PagedResultOfOrganization from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in page_result (list) _items = [] if self.page_result: - for _item in self.page_result: - if _item: - _items.append(_item.to_dict()) + for _item_page_result in self.page_result: + if _item_page_result: + _items.append(_item_page_result.to_dict()) _dict["pageResult"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PagedResultOfOrganization: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PagedResultOfOrganization from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PagedResultOfOrganization.parse_obj(obj) + return cls.model_validate(obj) - _obj = PagedResultOfOrganization.parse_obj( + _obj = cls.model_validate( { - "page_number": obj.get("pageNumber"), - "page_size": obj.get("pageSize"), - "page_result": [ - Organization.from_dict(_item) for _item in obj.get("pageResult") + "pageNumber": obj.get("pageNumber"), + "pageSize": obj.get("pageSize"), + "pageResult": [ + Organization.from_dict(_item) for _item in obj["pageResult"] ] if obj.get("pageResult") is not None else None, - "total_count": obj.get("totalCount"), + "totalCount": obj.get("totalCount"), } ) return _obj diff --git a/pyevr/openapi_client/models/paged_result_of_place_of_delivery.py b/pyevr/openapi_client/models/paged_result_of_place_of_delivery.py index e840d04..c6a7751 100644 --- a/pyevr/openapi_client/models/paged_result_of_place_of_delivery.py +++ b/pyevr/openapi_client/models/paged_result_of_place_of_delivery.py @@ -1,97 +1,118 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, conlist from pyevr.openapi_client.models.place_of_delivery import PlaceOfDelivery class PagedResultOfPlaceOfDelivery(BaseModel): """ PagedResultOfPlaceOfDelivery - """ + """ # noqa: E501 page_number: Optional[StrictInt] = Field( - None, alias="pageNumber", description="Lehekülje number" + default=None, description="Lehekülje number", alias="pageNumber" ) page_size: Optional[StrictInt] = Field( - None, alias="pageSize", description="Lehekülje suurus" + default=None, description="Lehekülje suurus", alias="pageSize" ) - page_result: Optional[conlist(PlaceOfDelivery)] = Field( - None, alias="pageResult", description="Lehekülje tulemused" + page_result: Optional[List[PlaceOfDelivery]] = Field( + default=None, description="Lehekülje tulemused", alias="pageResult" ) total_count: Optional[StrictInt] = Field( - None, alias="totalCount", description="Päringu vastete arv kokku" + default=None, description="Päringu vastete arv kokku", alias="totalCount" + ) + __properties: ClassVar[List[str]] = [ + "pageNumber", + "pageSize", + "pageResult", + "totalCount", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["pageNumber", "pageSize", "pageResult", "totalCount"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PagedResultOfPlaceOfDelivery: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PagedResultOfPlaceOfDelivery from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in page_result (list) _items = [] if self.page_result: - for _item in self.page_result: - if _item: - _items.append(_item.to_dict()) + for _item_page_result in self.page_result: + if _item_page_result: + _items.append(_item_page_result.to_dict()) _dict["pageResult"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PagedResultOfPlaceOfDelivery: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PagedResultOfPlaceOfDelivery from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PagedResultOfPlaceOfDelivery.parse_obj(obj) + return cls.model_validate(obj) - _obj = PagedResultOfPlaceOfDelivery.parse_obj( + _obj = cls.model_validate( { - "page_number": obj.get("pageNumber"), - "page_size": obj.get("pageSize"), - "page_result": [ - PlaceOfDelivery.from_dict(_item) for _item in obj.get("pageResult") + "pageNumber": obj.get("pageNumber"), + "pageSize": obj.get("pageSize"), + "pageResult": [ + PlaceOfDelivery.from_dict(_item) for _item in obj["pageResult"] ] if obj.get("pageResult") is not None else None, - "total_count": obj.get("totalCount"), + "totalCount": obj.get("totalCount"), } ) return _obj diff --git a/pyevr/openapi_client/models/paged_result_of_waybill.py b/pyevr/openapi_client/models/paged_result_of_waybill.py index 0180d84..42277d6 100644 --- a/pyevr/openapi_client/models/paged_result_of_waybill.py +++ b/pyevr/openapi_client/models/paged_result_of_waybill.py @@ -1,97 +1,116 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing_extensions import Self -from typing import List, Optional -from pydantic import BaseModel, Field, StrictInt, conlist from pyevr.openapi_client.models.waybill import Waybill class PagedResultOfWaybill(BaseModel): """ PagedResultOfWaybill - """ + """ # noqa: E501 page_number: Optional[StrictInt] = Field( - None, alias="pageNumber", description="Lehekülje number" + default=None, description="Lehekülje number", alias="pageNumber" ) page_size: Optional[StrictInt] = Field( - None, alias="pageSize", description="Lehekülje suurus" + default=None, description="Lehekülje suurus", alias="pageSize" ) - page_result: Optional[conlist(Waybill)] = Field( - None, alias="pageResult", description="Lehekülje tulemused" + page_result: Optional[List[Waybill]] = Field( + default=None, description="Lehekülje tulemused", alias="pageResult" ) total_count: Optional[StrictInt] = Field( - None, alias="totalCount", description="Päringu vastete arv kokku" + default=None, description="Päringu vastete arv kokku", alias="totalCount" + ) + __properties: ClassVar[List[str]] = [ + "pageNumber", + "pageSize", + "pageResult", + "totalCount", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["pageNumber", "pageSize", "pageResult", "totalCount"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PagedResultOfWaybill: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PagedResultOfWaybill from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in page_result (list) _items = [] if self.page_result: - for _item in self.page_result: - if _item: - _items.append(_item.to_dict()) + for _item_page_result in self.page_result: + if _item_page_result: + _items.append(_item_page_result.to_dict()) _dict["pageResult"] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> PagedResultOfWaybill: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PagedResultOfWaybill from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PagedResultOfWaybill.parse_obj(obj) + return cls.model_validate(obj) - _obj = PagedResultOfWaybill.parse_obj( + _obj = cls.model_validate( { - "page_number": obj.get("pageNumber"), - "page_size": obj.get("pageSize"), - "page_result": [ - Waybill.from_dict(_item) for _item in obj.get("pageResult") - ] + "pageNumber": obj.get("pageNumber"), + "pageSize": obj.get("pageSize"), + "pageResult": [Waybill.from_dict(_item) for _item in obj["pageResult"]] if obj.get("pageResult") is not None else None, - "total_count": obj.get("totalCount"), + "totalCount": obj.get("totalCount"), } ) return _obj diff --git a/pyevr/openapi_client/models/place_of_delivery.py b/pyevr/openapi_client/models/place_of_delivery.py index e5a00c1..e77ebdb 100644 --- a/pyevr/openapi_client/models/place_of_delivery.py +++ b/pyevr/openapi_client/models/place_of_delivery.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing_extensions import Annotated, Self -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr from pyevr.openapi_client.models.address import Address from pyevr.openapi_client.models.contact_person import ContactPerson from pyevr.openapi_client.models.coordinates import Coordinates @@ -29,43 +30,42 @@ class PlaceOfDelivery(BaseModel): """ PlaceOfDelivery - """ + """ # noqa: E501 - name: Optional[StrictStr] = Field(None, description="Tarnekoha nimi") - code: Optional[StrictStr] = Field(None, description="Tarnekoha kood") + name: Optional[StrictStr] = Field(default=None, description="Tarnekoha nimi") + code: Optional[StrictStr] = Field(default=None, description="Tarnekoha kood") register_code: Optional[StrictStr] = Field( - None, alias="registerCode", description="Registrikood" + default=None, description="Registrikood", alias="registerCode" ) address: Optional[Address] = None near_address: Optional[StrictStr] = Field( - None, alias="nearAddress", description="Lähiaadress" + default=None, description="Lähiaadress", alias="nearAddress" ) coordinates: Optional[Coordinates] = None - open_times: Optional[conlist(StrictStr)] = Field( - None, alias="openTimes", description="Millal avatud" - ) - is_public: Optional[StrictBool] = Field( - None, alias="isPublic", description="Kas on avalik" + open_times: Optional[List[StrictStr]] = Field( + default=None, description="Millal avatud", alias="openTimes" ) is_active: Optional[StrictBool] = Field( - None, alias="isActive", description="Kas on aktiivne" + default=None, description="Kas on aktiivne", alias="isActive" ) - preferred_certificates: Optional[conlist(StrictStr)] = Field( - None, alias="preferredCertificates", description="Eelistatud sertifikaadid" + preferred_certificates: Optional[List[StrictStr]] = Field( + default=None, + description="Eelistatud sertifikaadid", + alias="preferredCertificates", ) - contact_person: Optional[ContactPerson] = Field(None, alias="contactPerson") - waybill_authorizations: Optional[conlist(WaybillAuthorization)] = Field( - None, alias="waybillAuthorizations", description="Volitused" + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") + waybill_authorizations: Optional[List[WaybillAuthorization]] = Field( + default=None, description="Volitused", alias="waybillAuthorizations" ) - description: Optional[constr(strict=True, max_length=400)] = Field( - None, description="Märkused" + description: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field( + default=None, description="Märkused" ) user_custom_data: Optional[Any] = Field( - None, - alias="userCustomData", + default=None, description="Api kasutaja poolt kohandatavad andmed", + alias="userCustomData", ) - __properties = [ + __properties: ClassVar[List[str]] = [ "name", "code", "registerCode", @@ -73,7 +73,6 @@ class PlaceOfDelivery(BaseModel): "nearAddress", "coordinates", "openTimes", - "isPublic", "isActive", "preferredCertificates", "contactPerson", @@ -82,28 +81,43 @@ class PlaceOfDelivery(BaseModel): "userCustomData", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PlaceOfDelivery: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PlaceOfDelivery from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of address if self.address: _dict["address"] = self.address.to_dict() @@ -116,53 +130,55 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each item in waybill_authorizations (list) _items = [] if self.waybill_authorizations: - for _item in self.waybill_authorizations: - if _item: - _items.append(_item.to_dict()) + for _item_waybill_authorizations in self.waybill_authorizations: + if _item_waybill_authorizations: + _items.append(_item_waybill_authorizations.to_dict()) _dict["waybillAuthorizations"] = _items # set to None if user_custom_data (nullable) is None - # and __fields_set__ contains the field - if self.user_custom_data is None and "user_custom_data" in self.__fields_set__: + # and model_fields_set contains the field + if ( + self.user_custom_data is None + and "user_custom_data" in self.model_fields_set + ): _dict["userCustomData"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PlaceOfDelivery: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PlaceOfDelivery from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PlaceOfDelivery.parse_obj(obj) + return cls.model_validate(obj) - _obj = PlaceOfDelivery.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "code": obj.get("code"), - "register_code": obj.get("registerCode"), - "address": Address.from_dict(obj.get("address")) + "registerCode": obj.get("registerCode"), + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, - "near_address": obj.get("nearAddress"), - "coordinates": Coordinates.from_dict(obj.get("coordinates")) + "nearAddress": obj.get("nearAddress"), + "coordinates": Coordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, - "open_times": obj.get("openTimes"), - "is_public": obj.get("isPublic"), - "is_active": obj.get("isActive"), - "preferred_certificates": obj.get("preferredCertificates"), - "contact_person": ContactPerson.from_dict(obj.get("contactPerson")) + "openTimes": obj.get("openTimes"), + "isActive": obj.get("isActive"), + "preferredCertificates": obj.get("preferredCertificates"), + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) if obj.get("contactPerson") is not None else None, - "waybill_authorizations": [ + "waybillAuthorizations": [ WaybillAuthorization.from_dict(_item) - for _item in obj.get("waybillAuthorizations") + for _item in obj["waybillAuthorizations"] ] if obj.get("waybillAuthorizations") is not None else None, "description": obj.get("description"), - "user_custom_data": obj.get("userCustomData"), + "userCustomData": obj.get("userCustomData"), } ) return _obj diff --git a/pyevr/openapi_client/models/previous_owner.py b/pyevr/openapi_client/models/previous_owner.py index aeb3392..53a29b5 100644 --- a/pyevr/openapi_client/models/previous_owner.py +++ b/pyevr/openapi_client/models/previous_owner.py @@ -1,76 +1,92 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class PreviousOwner(BaseModel): """ PreviousOwner - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=1) = Field( - ..., description="Nimi" + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="Nimi" ) - code: constr(strict=True, max_length=100, min_length=1) = Field( - ..., description="Eelmiste omanike isiku- või registrikoodid" + code: Annotated[str, Field(min_length=1, strict=True, max_length=100)] = Field( + description="Eelmiste omanike isiku- või registrikoodid" ) - address: constr(strict=True, max_length=200, min_length=1) = Field( - ..., description="Aadress" + address: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="Aadress" ) - __properties = ["name", "code", "address"] + __properties: ClassVar[List[str]] = ["name", "code", "address"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PreviousOwner: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PreviousOwner from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PreviousOwner: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PreviousOwner from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PreviousOwner.parse_obj(obj) + return cls.model_validate(obj) - _obj = PreviousOwner.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "code": obj.get("code"), diff --git a/pyevr/openapi_client/models/problem_details.py b/pyevr/openapi_client/models/problem_details.py index f0e28f7..62ed617 100644 --- a/pyevr/openapi_client/models/problem_details.py +++ b/pyevr/openapi_client/models/problem_details.py @@ -1,31 +1,31 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from typing import Any, Dict, Optional -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing_extensions import Self class ProblemDetails(BaseModel): """ ProblemDetails - """ + """ # noqa: E501 type: Optional[StrictStr] = None title: Optional[StrictStr] = None @@ -34,31 +34,56 @@ class ProblemDetails(BaseModel): instance: Optional[StrictStr] = None extensions: Optional[Dict[str, Any]] = None additional_properties: Dict[str, Any] = {} - __properties = ["type", "title", "status", "detail", "instance", "extensions"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + __properties: ClassVar[List[str]] = [ + "type", + "title", + "status", + "detail", + "instance", + "extensions", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ProblemDetails: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProblemDetails from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict( - by_alias=True, exclude={"additional_properties"}, exclude_none=True + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set( + [ + "additional_properties", + ] + ) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, ) # puts key-value pairs in additional_properties in the top level if self.additional_properties is not None: @@ -66,42 +91,42 @@ def to_dict(self): _dict[_key] = _value # set to None if type (nullable) is None - # and __fields_set__ contains the field - if self.type is None and "type" in self.__fields_set__: + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: _dict["type"] = None # set to None if title (nullable) is None - # and __fields_set__ contains the field - if self.title is None and "title" in self.__fields_set__: + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: _dict["title"] = None # set to None if status (nullable) is None - # and __fields_set__ contains the field - if self.status is None and "status" in self.__fields_set__: + # and model_fields_set contains the field + if self.status is None and "status" in self.model_fields_set: _dict["status"] = None # set to None if detail (nullable) is None - # and __fields_set__ contains the field - if self.detail is None and "detail" in self.__fields_set__: + # and model_fields_set contains the field + if self.detail is None and "detail" in self.model_fields_set: _dict["detail"] = None # set to None if instance (nullable) is None - # and __fields_set__ contains the field - if self.instance is None and "instance" in self.__fields_set__: + # and model_fields_set contains the field + if self.instance is None and "instance" in self.model_fields_set: _dict["instance"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ProblemDetails: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProblemDetails from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProblemDetails.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProblemDetails.parse_obj( + _obj = cls.model_validate( { "type": obj.get("type"), "title": obj.get("title"), diff --git a/pyevr/openapi_client/models/put_place_of_delivery_request.py b/pyevr/openapi_client/models/put_place_of_delivery_request.py index 1a78f7f..ced65d1 100644 --- a/pyevr/openapi_client/models/put_place_of_delivery_request.py +++ b/pyevr/openapi_client/models/put_place_of_delivery_request.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing_extensions import Annotated, Self -from typing import Any, List, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr from pyevr.openapi_client.models.address import Address from pyevr.openapi_client.models.contact_person import ContactPerson from pyevr.openapi_client.models.coordinates import Coordinates @@ -29,48 +30,44 @@ class PutPlaceOfDeliveryRequest(BaseModel): """ PutPlaceOfDeliveryRequest - """ + """ # noqa: E501 - name: constr(strict=True, min_length=0) = Field(..., description="Nimi") - address: Address = Field(...) - near_address: Optional[constr(strict=True, max_length=150)] = Field( - None, alias="nearAddress", description="Lähiaadress" - ) - coordinates: Coordinates = Field(...) - description: Optional[constr(strict=True, max_length=400)] = Field( - None, description="Märkused" + name: Annotated[str, Field(min_length=0, strict=True)] = Field(description="Nimi") + address: Address + near_address: Optional[Annotated[str, Field(strict=True, max_length=150)]] = Field( + default=None, description="Lähiaadress", alias="nearAddress" ) - is_active: StrictBool = Field(..., alias="isActive", description="Kas on aktiivne") - is_public: StrictBool = Field( - ..., - alias="isPublic", - description="Kas on avalik (avalikke ladusid näevad ka teised asutused)", + coordinates: Coordinates + description: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field( + default=None, description="Märkused" ) - preferred_certificates: Optional[conlist(StrictStr)] = Field( - None, alias="preferredCertificates", description="Eelistatud sertifikaadid" + is_active: StrictBool = Field(description="Kas on aktiivne", alias="isActive") + preferred_certificates: Optional[List[StrictStr]] = Field( + default=None, + description="Eelistatud sertifikaadid", + alias="preferredCertificates", ) - open_times: Optional[conlist(StrictStr)] = Field( - None, alias="openTimes", description="Millal avatud" + open_times: Optional[List[StrictStr]] = Field( + default=None, description="Millal avatud", alias="openTimes" ) - contact_person: Optional[ContactPerson] = Field(None, alias="contactPerson") - waybill_authorizations: Optional[conlist(WaybillAuthorization)] = Field( - None, - alias="waybillAuthorizations", + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") + waybill_authorizations: Optional[List[WaybillAuthorization]] = Field( + default=None, description="Volitatud mõõtjad ja vaatlejad", + alias="waybillAuthorizations", ) user_custom_data: Optional[Any] = Field( - None, - alias="userCustomData", + default=None, description="Api kasutaja poolt kohandatavad andmed", + alias="userCustomData", ) - __properties = [ + __properties: ClassVar[List[str]] = [ "name", "address", "nearAddress", "coordinates", "description", "isActive", - "isPublic", "preferredCertificates", "openTimes", "contactPerson", @@ -78,28 +75,43 @@ class PutPlaceOfDeliveryRequest(BaseModel): "userCustomData", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PutPlaceOfDeliveryRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PutPlaceOfDeliveryRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of address if self.address: _dict["address"] = self.address.to_dict() @@ -112,51 +124,53 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each item in waybill_authorizations (list) _items = [] if self.waybill_authorizations: - for _item in self.waybill_authorizations: - if _item: - _items.append(_item.to_dict()) + for _item_waybill_authorizations in self.waybill_authorizations: + if _item_waybill_authorizations: + _items.append(_item_waybill_authorizations.to_dict()) _dict["waybillAuthorizations"] = _items # set to None if user_custom_data (nullable) is None - # and __fields_set__ contains the field - if self.user_custom_data is None and "user_custom_data" in self.__fields_set__: + # and model_fields_set contains the field + if ( + self.user_custom_data is None + and "user_custom_data" in self.model_fields_set + ): _dict["userCustomData"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PutPlaceOfDeliveryRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PutPlaceOfDeliveryRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PutPlaceOfDeliveryRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PutPlaceOfDeliveryRequest.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), - "address": Address.from_dict(obj.get("address")) + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, - "near_address": obj.get("nearAddress"), - "coordinates": Coordinates.from_dict(obj.get("coordinates")) + "nearAddress": obj.get("nearAddress"), + "coordinates": Coordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, "description": obj.get("description"), - "is_active": obj.get("isActive"), - "is_public": obj.get("isPublic"), - "preferred_certificates": obj.get("preferredCertificates"), - "open_times": obj.get("openTimes"), - "contact_person": ContactPerson.from_dict(obj.get("contactPerson")) + "isActive": obj.get("isActive"), + "preferredCertificates": obj.get("preferredCertificates"), + "openTimes": obj.get("openTimes"), + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) if obj.get("contactPerson") is not None else None, - "waybill_authorizations": [ + "waybillAuthorizations": [ WaybillAuthorization.from_dict(_item) - for _item in obj.get("waybillAuthorizations") + for _item in obj["waybillAuthorizations"] ] if obj.get("waybillAuthorizations") is not None else None, - "user_custom_data": obj.get("userCustomData"), + "userCustomData": obj.get("userCustomData"), } ) return _obj diff --git a/pyevr/openapi_client/models/receiver.py b/pyevr/openapi_client/models/receiver.py index b256645..c248545 100644 --- a/pyevr/openapi_client/models/receiver.py +++ b/pyevr/openapi_client/models/receiver.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import BaseModel, Field, constr from pyevr.openapi_client.models.address import Address from pyevr.openapi_client.models.contact_person import ContactPerson @@ -27,40 +28,55 @@ class Receiver(BaseModel): """ Receiver - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Nimi" + name: Annotated[str, Field(min_length=0, strict=True, max_length=200)] = Field( + description="Nimi" ) - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Isiku- või registrikood" + code: Annotated[str, Field(min_length=0, strict=True, max_length=20)] = Field( + description="Isiku- või registrikood" + ) + address: Address + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") + __properties: ClassVar[List[str]] = ["name", "code", "address", "contactPerson"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - address: Address = Field(...) - contact_person: Optional[ContactPerson] = Field(None, alias="contactPerson") - __properties = ["name", "code", "address", "contactPerson"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Receiver: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Receiver from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of address if self.address: _dict["address"] = self.address.to_dict() @@ -70,22 +86,22 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> Receiver: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Receiver from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Receiver.parse_obj(obj) + return cls.model_validate(obj) - _obj = Receiver.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "code": obj.get("code"), - "address": Address.from_dict(obj.get("address")) + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, - "contact_person": ContactPerson.from_dict(obj.get("contactPerson")) + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) if obj.get("contactPerson") is not None else None, } diff --git a/pyevr/openapi_client/models/representer.py b/pyevr/openapi_client/models/representer.py index bbc0045..37298b6 100644 --- a/pyevr/openapi_client/models/representer.py +++ b/pyevr/openapi_client/models/representer.py @@ -1,50 +1,53 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import BaseModel, Field, constr from pyevr.openapi_client.models.address import Address class Representer(BaseModel): """ Representer - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Nimi" + name: Annotated[str, Field(min_length=0, strict=True, max_length=200)] = Field( + description="Nimi" ) - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Isiku- või registrikood" + code: Annotated[str, Field(min_length=0, strict=True, max_length=20)] = Field( + description="Isiku- või registrikood" ) - address: Address = Field(...) - right_of_representation: Optional[constr(strict=True, max_length=200)] = Field( - None, alias="rightOfRepresentation", description="Esindusõiguse alus" + address: Address + right_of_representation: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field( + default=None, description="Esindusõiguse alus", alias="rightOfRepresentation" ) - email: Optional[constr(strict=True, max_length=254)] = Field( - None, description="Email" + email: Optional[Annotated[str, Field(strict=True, max_length=254)]] = Field( + default=None, description="Email" ) - phone: Optional[constr(strict=True, max_length=25)] = Field( - None, description="Telefoninumber" + phone: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field( + default=None, description="Telefoninumber" ) - __properties = [ + __properties: ClassVar[List[str]] = [ "name", "code", "address", @@ -53,68 +56,83 @@ class Representer(BaseModel): "phone", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Representer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Representer from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of address if self.address: _dict["address"] = self.address.to_dict() # set to None if right_of_representation (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.right_of_representation is None - and "right_of_representation" in self.__fields_set__ + and "right_of_representation" in self.model_fields_set ): _dict["rightOfRepresentation"] = None # set to None if email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict["email"] = None # set to None if phone (nullable) is None - # and __fields_set__ contains the field - if self.phone is None and "phone" in self.__fields_set__: + # and model_fields_set contains the field + if self.phone is None and "phone" in self.model_fields_set: _dict["phone"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Representer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Representer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Representer.parse_obj(obj) + return cls.model_validate(obj) - _obj = Representer.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "code": obj.get("code"), - "address": Address.from_dict(obj.get("address")) + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, - "right_of_representation": obj.get("rightOfRepresentation"), + "rightOfRepresentation": obj.get("rightOfRepresentation"), "email": obj.get("email"), "phone": obj.get("phone"), } diff --git a/pyevr/openapi_client/models/sales_contract.py b/pyevr/openapi_client/models/sales_contract.py index a64314f..bde429f 100644 --- a/pyevr/openapi_client/models/sales_contract.py +++ b/pyevr/openapi_client/models/sales_contract.py @@ -1,25 +1,28 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Optional -from pydantic import Field, StrictStr, constr +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.holding_base import HoldingBase from pyevr.openapi_client.models.previous_owner import PreviousOwner @@ -27,92 +30,140 @@ class SalesContract(HoldingBase): """ SalesContract - """ + """ # noqa: E501 - contract_number: constr(strict=True, max_length=500, min_length=0) = Field( - ..., alias="contractNumber", description="Dokumendi number" - ) + contract_number: Annotated[ + str, Field(min_length=0, strict=True, max_length=500) + ] = Field(description="Dokumendi number", alias="contractNumber") contract_date: datetime = Field( - ..., alias="contractDate", description="Dokumendi kuupäev" + description="Dokumendi kuupäev", alias="contractDate" ) - cadaster: constr(strict=True, max_length=500, min_length=0) = Field( - ..., description="Katastritunnus" + cadaster: Annotated[str, Field(min_length=0, strict=True, max_length=500)] = Field( + description="Katastritunnus" ) - compartment: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Kvartal" + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" ) - forest_allocation_number: Optional[StrictStr] = Field( - None, alias="forestAllocationNumber", description="Metsaeraldis" + forest_allocation_number: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field(default=None, description="Metsaeraldis", alias="forestAllocationNumber") + forest_notice_number: Optional[ + Annotated[str, Field(strict=True, max_length=500)] + ] = Field( + default=None, description="Metsateatise number", alias="forestNoticeNumber" ) - previous_owner: PreviousOwner = Field(..., alias="previousOwner") - __properties = [ + previous_owner: PreviousOwner = Field(alias="previousOwner") + __properties: ClassVar[List[str]] = [ + "eudrNumbers", "type", "contractNumber", "contractDate", "cadaster", "compartment", "forestAllocationNumber", + "forestNoticeNumber", "previousOwner", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> SalesContract: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of SalesContract from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items # override the default output from pydantic by calling `to_dict()` of previous_owner if self.previous_owner: _dict["previousOwner"] = self.previous_owner.to_dict() + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None # set to None if forest_allocation_number (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.forest_allocation_number is None - and "forest_allocation_number" in self.__fields_set__ + and "forest_allocation_number" in self.model_fields_set ): _dict["forestAllocationNumber"] = None + # set to None if forest_notice_number (nullable) is None + # and model_fields_set contains the field + if ( + self.forest_notice_number is None + and "forest_notice_number" in self.model_fields_set + ): + _dict["forestNoticeNumber"] = None + return _dict @classmethod - def from_dict(cls, obj: dict) -> SalesContract: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of SalesContract from a dict""" if obj is None: return None if not isinstance(obj, dict): - return SalesContract.parse_obj(obj) + return cls.model_validate(obj) - _obj = SalesContract.parse_obj( + _obj = cls.model_validate( { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, "type": obj.get("type"), - "contract_number": obj.get("contractNumber"), - "contract_date": obj.get("contractDate"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), "cadaster": obj.get("cadaster"), "compartment": obj.get("compartment"), - "forest_allocation_number": obj.get("forestAllocationNumber"), - "previous_owner": PreviousOwner.from_dict(obj.get("previousOwner")) + "forestAllocationNumber": obj.get("forestAllocationNumber"), + "forestNoticeNumber": obj.get("forestNoticeNumber"), + "previousOwner": PreviousOwner.from_dict(obj["previousOwner"]) if obj.get("previousOwner") is not None else None, } diff --git a/pyevr/openapi_client/models/secondary_waste_wood.py b/pyevr/openapi_client/models/secondary_waste_wood.py new file mode 100644 index 0000000..3d80260 --- /dev/null +++ b/pyevr/openapi_client/models/secondary_waste_wood.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber +from pyevr.openapi_client.models.holding_base import HoldingBase +from pyevr.openapi_client.models.previous_owner import PreviousOwner + + +class SecondaryWasteWood(HoldingBase): + """ + SecondaryWasteWood + """ # noqa: E501 + + contract_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Dokumendi number", alias="contractNumber") + ) + contract_date: Optional[datetime] = Field( + default=None, description="Dokumendi kuupäev", alias="contractDate" + ) + previous_owner: Optional[PreviousOwner] = Field(default=None, alias="previousOwner") + cadaster: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field( + default=None, description="Katastritunnus" + ) + __properties: ClassVar[List[str]] = [ + "eudrNumbers", + "type", + "contractNumber", + "contractDate", + "previousOwner", + "cadaster", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SecondaryWasteWood from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # override the default output from pydantic by calling `to_dict()` of previous_owner + if self.previous_owner: + _dict["previousOwner"] = self.previous_owner.to_dict() + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + + # set to None if contract_number (nullable) is None + # and model_fields_set contains the field + if self.contract_number is None and "contract_number" in self.model_fields_set: + _dict["contractNumber"] = None + + # set to None if contract_date (nullable) is None + # and model_fields_set contains the field + if self.contract_date is None and "contract_date" in self.model_fields_set: + _dict["contractDate"] = None + + # set to None if cadaster (nullable) is None + # and model_fields_set contains the field + if self.cadaster is None and "cadaster" in self.model_fields_set: + _dict["cadaster"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SecondaryWasteWood from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, + "type": obj.get("type"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), + "previousOwner": PreviousOwner.from_dict(obj["previousOwner"]) + if obj.get("previousOwner") is not None + else None, + "cadaster": obj.get("cadaster"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/secondary_wood_biomass.py b/pyevr/openapi_client/models/secondary_wood_biomass.py new file mode 100644 index 0000000..d770858 --- /dev/null +++ b/pyevr/openapi_client/models/secondary_wood_biomass.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.eudr_number import EudrNumber +from pyevr.openapi_client.models.holding_base import HoldingBase +from pyevr.openapi_client.models.previous_owner import PreviousOwner + + +class SecondaryWoodBiomass(HoldingBase): + """ + SecondaryWoodBiomass + """ # noqa: E501 + + contract_number: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Dokumendi number", alias="contractNumber") + ) + contract_date: Optional[datetime] = Field( + default=None, description="Dokumendi kuupäev", alias="contractDate" + ) + previous_owner: Optional[PreviousOwner] = Field(default=None, alias="previousOwner") + cadaster: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field( + default=None, description="Katastritunnus" + ) + __properties: ClassVar[List[str]] = [ + "eudrNumbers", + "type", + "contractNumber", + "contractDate", + "previousOwner", + "cadaster", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SecondaryWoodBiomass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # override the default output from pydantic by calling `to_dict()` of previous_owner + if self.previous_owner: + _dict["previousOwner"] = self.previous_owner.to_dict() + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + + # set to None if contract_number (nullable) is None + # and model_fields_set contains the field + if self.contract_number is None and "contract_number" in self.model_fields_set: + _dict["contractNumber"] = None + + # set to None if contract_date (nullable) is None + # and model_fields_set contains the field + if self.contract_date is None and "contract_date" in self.model_fields_set: + _dict["contractDate"] = None + + # set to None if cadaster (nullable) is None + # and model_fields_set contains the field + if self.cadaster is None and "cadaster" in self.model_fields_set: + _dict["cadaster"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SecondaryWoodBiomass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, + "type": obj.get("type"), + "contractNumber": obj.get("contractNumber"), + "contractDate": obj.get("contractDate"), + "previousOwner": PreviousOwner.from_dict(obj["previousOwner"]) + if obj.get("previousOwner") is not None + else None, + "cadaster": obj.get("cadaster"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/shipment.py b/pyevr/openapi_client/models/shipment.py index 5b12db6..33378a5 100644 --- a/pyevr/openapi_client/models/shipment.py +++ b/pyevr/openapi_client/models/shipment.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Any, List, Optional -from pydantic import BaseModel, Field, conlist, constr from pyevr.openapi_client.models.certificate_claim import CertificateClaim from pyevr.openapi_client.models.holding_base import HoldingBase from pyevr.openapi_client.models.shipment_item import ShipmentItem @@ -29,23 +30,31 @@ class Shipment(BaseModel): """ Shipment - """ + """ # noqa: E501 - holding_base: HoldingBase = Field(..., alias="holdingBase") - source: Source = Field(...) - items: conlist(ShipmentItem, max_items=25) = Field(..., description="Saadetis") - certificate_claims: Optional[conlist(CertificateClaim, max_items=25)] = Field( - None, alias="certificateClaims", description="Tarneahela sertifikaadi väited" + holding_base: HoldingBase = Field(alias="holdingBase") + source: Source + items: Annotated[List[ShipmentItem], Field(max_length=25)] = Field( + description="Saadetis" + ) + certificate_claims: Optional[ + Annotated[List[CertificateClaim], Field(max_length=25)] + ] = Field( + default=None, + description="Tarneahela sertifikaadi väited", + alias="certificateClaims", ) user_custom_data: Optional[Any] = Field( - None, - alias="userCustomData", + default=None, description="Api kasutaja poolt kohandatavad andmed", + alias="userCustomData", ) - supply_contract_number: Optional[constr(strict=True, max_length=50)] = Field( - None, alias="supplyContractNumber", description="Tarnelepingu number" + supply_contract_number: Optional[ + Annotated[str, Field(strict=True, max_length=50)] + ] = Field( + default=None, description="Tarnelepingu number", alias="supplyContractNumber" ) - __properties = [ + __properties: ClassVar[List[str]] = [ "holdingBase", "source", "items", @@ -54,28 +63,43 @@ class Shipment(BaseModel): "supplyContractNumber", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Shipment: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Shipment from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of holding_base if self.holding_base: _dict["holdingBase"] = self.holding_base.to_dict() @@ -85,68 +109,71 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each item in items (list) _items = [] if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) _dict["items"] = _items # override the default output from pydantic by calling `to_dict()` of each item in certificate_claims (list) _items = [] if self.certificate_claims: - for _item in self.certificate_claims: - if _item: - _items.append(_item.to_dict()) + for _item_certificate_claims in self.certificate_claims: + if _item_certificate_claims: + _items.append(_item_certificate_claims.to_dict()) _dict["certificateClaims"] = _items # set to None if certificate_claims (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.certificate_claims is None - and "certificate_claims" in self.__fields_set__ + and "certificate_claims" in self.model_fields_set ): _dict["certificateClaims"] = None # set to None if user_custom_data (nullable) is None - # and __fields_set__ contains the field - if self.user_custom_data is None and "user_custom_data" in self.__fields_set__: + # and model_fields_set contains the field + if ( + self.user_custom_data is None + and "user_custom_data" in self.model_fields_set + ): _dict["userCustomData"] = None # set to None if supply_contract_number (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.supply_contract_number is None - and "supply_contract_number" in self.__fields_set__ + and "supply_contract_number" in self.model_fields_set ): _dict["supplyContractNumber"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Shipment: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Shipment from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Shipment.parse_obj(obj) + return cls.model_validate(obj) - _obj = Shipment.parse_obj( + _obj = cls.model_validate( { - "holding_base": HoldingBase.from_dict(obj.get("holdingBase")) + "holdingBase": HoldingBase.from_dict(obj["holdingBase"]) if obj.get("holdingBase") is not None else None, - "source": Source.from_dict(obj.get("source")) + "source": Source.from_dict(obj["source"]) if obj.get("source") is not None else None, - "items": [ShipmentItem.from_dict(_item) for _item in obj.get("items")] + "items": [ShipmentItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None, - "certificate_claims": [ + "certificateClaims": [ CertificateClaim.from_dict(_item) - for _item in obj.get("certificateClaims") + for _item in obj["certificateClaims"] ] if obj.get("certificateClaims") is not None else None, - "user_custom_data": obj.get("userCustomData"), - "supply_contract_number": obj.get("supplyContractNumber"), + "userCustomData": obj.get("userCustomData"), + "supplyContractNumber": obj.get("supplyContractNumber"), } ) return _obj diff --git a/pyevr/openapi_client/models/shipment_assortment.py b/pyevr/openapi_client/models/shipment_assortment.py index 9fa3487..5dbda6e 100644 --- a/pyevr/openapi_client/models/shipment_assortment.py +++ b/pyevr/openapi_client/models/shipment_assortment.py @@ -1,81 +1,96 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class ShipmentAssortment(BaseModel): """ ShipmentAssortment - """ + """ # noqa: E501 - code: constr(strict=True, max_length=10, min_length=0) = Field( - ..., - description="Sortimendi kood. Kui organisatsioon on seadistatud kasutama EVR sortimente, peab kood olema [üks EVR sortimentide koodist.](#operation/Assortments_List)", + code: Annotated[str, Field(min_length=0, strict=True, max_length=10)] = Field( + description="Sortimendi kood. Kui organisatsioon on seadistatud kasutama EVR sortimente, peab kood olema [üks EVR sortimentide koodist.](#operation/Assortments_List)" ) - name: constr(strict=True, max_length=100, min_length=0) = Field( - ..., description="Sortimendi nimetus" + name: Annotated[str, Field(min_length=0, strict=True, max_length=100)] = Field( + description="Sortimendi nimetus" ) - product_group: constr(strict=True, max_length=10, min_length=0) = Field( - ..., alias="productGroup", description="Tootegrupi kood" + product_group: Annotated[str, Field(min_length=0, strict=True, max_length=10)] = ( + Field(description="Tootegrupi kood", alias="productGroup") ) - __properties = ["code", "name", "productGroup"] + __properties: ClassVar[List[str]] = ["code", "name", "productGroup"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ShipmentAssortment: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ShipmentAssortment from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ShipmentAssortment: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ShipmentAssortment from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ShipmentAssortment.parse_obj(obj) + return cls.model_validate(obj) - _obj = ShipmentAssortment.parse_obj( + _obj = cls.model_validate( { "code": obj.get("code"), "name": obj.get("name"), - "product_group": obj.get("productGroup"), + "productGroup": obj.get("productGroup"), } ) return _obj diff --git a/pyevr/openapi_client/models/shipment_item.py b/pyevr/openapi_client/models/shipment_item.py index 48e4c87..0c43e4e 100644 --- a/pyevr/openapi_client/models/shipment_item.py +++ b/pyevr/openapi_client/models/shipment_item.py @@ -1,25 +1,27 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set, Union +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional, Union -from pydantic import BaseModel, Field, confloat, conint, constr +from pyevr.openapi_client.models.baltpool_quality import BaltpoolQuality from pyevr.openapi_client.models.pack import Pack from pyevr.openapi_client.models.shipment_assortment import ShipmentAssortment @@ -27,43 +29,66 @@ class ShipmentItem(BaseModel): """ ShipmentItem - """ + """ # noqa: E501 amount: Union[ - confloat(le=1.0e9, ge=0.0, strict=True), - conint(le=1000000000, ge=0, strict=True), - ] = Field(..., description="Kogus") + Annotated[float, Field(le=1000000000, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Kogus") pack: Optional[Pack] = None - unit_code: constr(strict=True, max_length=10, min_length=0) = Field( - ..., - alias="unitCode", + unit_code: Annotated[str, Field(min_length=0, strict=True, max_length=10)] = Field( description="[Mõõtühiku kood](#operation/MeasurementUnits_List)", + alias="unitCode", + ) + assortment: ShipmentAssortment + baltpool_quality: Optional[BaltpoolQuality] = Field( + default=None, alias="baltpoolQuality" + ) + __properties: ClassVar[List[str]] = [ + "amount", + "pack", + "unitCode", + "assortment", + "baltpoolQuality", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - assortment: ShipmentAssortment = Field(...) - __properties = ["amount", "pack", "unitCode", "assortment"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ShipmentItem: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ShipmentItem from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of pack if self.pack: _dict["pack"] = self.pack.to_dict() @@ -73,24 +98,25 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ShipmentItem: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ShipmentItem from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ShipmentItem.parse_obj(obj) + return cls.model_validate(obj) - _obj = ShipmentItem.parse_obj( + _obj = cls.model_validate( { "amount": obj.get("amount"), - "pack": Pack.from_dict(obj.get("pack")) + "pack": Pack.from_dict(obj["pack"]) if obj.get("pack") is not None else None, - "unit_code": obj.get("unitCode"), - "assortment": ShipmentAssortment.from_dict(obj.get("assortment")) + "unitCode": obj.get("unitCode"), + "assortment": ShipmentAssortment.from_dict(obj["assortment"]) if obj.get("assortment") is not None else None, + "baltpoolQuality": obj.get("baltpoolQuality"), } ) return _obj diff --git a/pyevr/openapi_client/models/shipment_item_base.py b/pyevr/openapi_client/models/shipment_item_base.py new file mode 100644 index 0000000..cbfa97d --- /dev/null +++ b/pyevr/openapi_client/models/shipment_item_base.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.pack import Pack +from pyevr.openapi_client.models.shipment_assortment import ShipmentAssortment + + +class ShipmentItemBase(BaseModel): + """ + ShipmentItemBase + """ # noqa: E501 + + amount: Union[ + Annotated[float, Field(le=1.0e9, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Kogus") + pack: Optional[Pack] = None + unit_code: Annotated[str, Field(min_length=0, strict=True, max_length=10)] = Field( + description="[Mõõtühiku kood](#operation/MeasurementUnits_List)", + alias="unitCode", + ) + assortment: ShipmentAssortment + __properties: ClassVar[List[str]] = ["amount", "pack", "unitCode", "assortment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ShipmentItemBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pack + if self.pack: + _dict["pack"] = self.pack.to_dict() + # override the default output from pydantic by calling `to_dict()` of assortment + if self.assortment: + _dict["assortment"] = self.assortment.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ShipmentItemBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "amount": obj.get("amount"), + "pack": Pack.from_dict(obj["pack"]) + if obj.get("pack") is not None + else None, + "unitCode": obj.get("unitCode"), + "assortment": ShipmentAssortment.from_dict(obj["assortment"]) + if obj.get("assortment") is not None + else None, + } + ) + return _obj diff --git a/pyevr/openapi_client/models/source.py b/pyevr/openapi_client/models/source.py index cd9b4e7..615f931 100644 --- a/pyevr/openapi_client/models/source.py +++ b/pyevr/openapi_client/models/source.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import BaseModel, Field, constr from pyevr.openapi_client.models.address import Address from pyevr.openapi_client.models.contact_person import ContactPerson from pyevr.openapi_client.models.coordinates import Coordinates @@ -28,33 +29,35 @@ class Source(BaseModel): """ Source - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Maaüksuse või laoplatsi nimi" + name: Annotated[str, Field(min_length=0, strict=True, max_length=200)] = Field( + description="Maaüksuse või laoplatsi nimi" ) - code: Optional[constr(strict=True, max_length=50)] = Field( - None, description="Laokood" + code: Optional[Annotated[str, Field(strict=True, max_length=50)]] = Field( + default=None, description="Laokood" ) - compartment: Optional[constr(strict=True, max_length=100)] = Field( - None, description="Kvartal" + compartment: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field( + default=None, description="Kvartal" ) - appropriation: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Eraldis" + appropriation: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Eraldis" ) - planning_area: Optional[constr(strict=True, max_length=100)] = Field( - None, alias="planningArea", description="Planeerimispiirkond" + planning_area: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field( + default=None, description="Planeerimispiirkond", alias="planningArea" ) - address: Address = Field(...) + address: Address coordinates: Optional[Coordinates] = None - contact_person: Optional[ContactPerson] = Field(None, alias="contactPerson") - near_address: Optional[constr(strict=True, max_length=150)] = Field( - None, alias="nearAddress", description="Lähiaadress" + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") + near_address: Optional[Annotated[str, Field(strict=True, max_length=150)]] = Field( + default=None, description="Lähiaadress", alias="nearAddress" ) - source_document_url: Optional[constr(strict=True, max_length=2000)] = Field( - None, alias="sourceDocumentUrl", description="Päritoludokumendi URL" + source_document_url: Optional[ + Annotated[str, Field(strict=True, max_length=2000)] + ] = Field( + default=None, description="Päritoludokumendi URL", alias="sourceDocumentUrl" ) - __properties = [ + __properties: ClassVar[List[str]] = [ "name", "code", "compartment", @@ -67,28 +70,43 @@ class Source(BaseModel): "sourceDocumentUrl", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Source: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Source from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of address if self.address: _dict["address"] = self.address.to_dict() @@ -99,67 +117,67 @@ def to_dict(self): if self.contact_person: _dict["contactPerson"] = self.contact_person.to_dict() # set to None if code (nullable) is None - # and __fields_set__ contains the field - if self.code is None and "code" in self.__fields_set__: + # and model_fields_set contains the field + if self.code is None and "code" in self.model_fields_set: _dict["code"] = None # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None # set to None if appropriation (nullable) is None - # and __fields_set__ contains the field - if self.appropriation is None and "appropriation" in self.__fields_set__: + # and model_fields_set contains the field + if self.appropriation is None and "appropriation" in self.model_fields_set: _dict["appropriation"] = None # set to None if planning_area (nullable) is None - # and __fields_set__ contains the field - if self.planning_area is None and "planning_area" in self.__fields_set__: + # and model_fields_set contains the field + if self.planning_area is None and "planning_area" in self.model_fields_set: _dict["planningArea"] = None # set to None if near_address (nullable) is None - # and __fields_set__ contains the field - if self.near_address is None and "near_address" in self.__fields_set__: + # and model_fields_set contains the field + if self.near_address is None and "near_address" in self.model_fields_set: _dict["nearAddress"] = None # set to None if source_document_url (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.source_document_url is None - and "source_document_url" in self.__fields_set__ + and "source_document_url" in self.model_fields_set ): _dict["sourceDocumentUrl"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Source: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Source from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Source.parse_obj(obj) + return cls.model_validate(obj) - _obj = Source.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "code": obj.get("code"), "compartment": obj.get("compartment"), "appropriation": obj.get("appropriation"), - "planning_area": obj.get("planningArea"), - "address": Address.from_dict(obj.get("address")) + "planningArea": obj.get("planningArea"), + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, - "coordinates": Coordinates.from_dict(obj.get("coordinates")) + "coordinates": Coordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, - "contact_person": ContactPerson.from_dict(obj.get("contactPerson")) + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) if obj.get("contactPerson") is not None else None, - "near_address": obj.get("nearAddress"), - "source_document_url": obj.get("sourceDocumentUrl"), + "nearAddress": obj.get("nearAddress"), + "sourceDocumentUrl": obj.get("sourceDocumentUrl"), } ) return _obj diff --git a/pyevr/openapi_client/models/start_waybill_request.py b/pyevr/openapi_client/models/start_waybill_request.py index 77c6a28..82cc052 100644 --- a/pyevr/openapi_client/models/start_waybill_request.py +++ b/pyevr/openapi_client/models/start_waybill_request.py @@ -1,25 +1,28 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Any, List, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, conint, conlist, constr +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.coordinates import Coordinates from pyevr.openapi_client.models.owner import Owner from pyevr.openapi_client.models.receiver import Receiver from pyevr.openapi_client.models.shipment import Shipment @@ -31,40 +34,47 @@ class StartWaybillRequest(BaseModel): """ StartWaybillRequest - """ - - owner: Owner = Field(...) - transport: Transport = Field(...) - receiver: Receiver = Field(...) - place_of_delivery: WaybillPlaceOfDelivery = Field(..., alias="placeOfDelivery") - comment: Optional[constr(strict=True, max_length=400)] = Field( - None, description="Märkused/lisainfo" + """ # noqa: E501 + + owner: Owner + transport: Transport + receiver: Receiver + place_of_delivery: WaybillPlaceOfDelivery = Field(alias="placeOfDelivery") + comment: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field( + default=None, description="Märkused/lisainfo" ) departure_time: datetime = Field( - ..., alias="departureTime", description="Väljasõidu aeg" + description="Väljasõidu aeg", alias="departureTime" ) submission_time: datetime = Field( - ..., alias="submissionTime", description="Veoselehe EVR-i saatmise aeg" + description="Veoselehe EVR-i saatmise aeg", alias="submissionTime" ) - shipments: conlist(Shipment, max_items=25) = Field( - ..., description="Lähetatud veose andmed" + shipments: Annotated[List[Shipment], Field(max_length=25)] = Field( + description="Lähetatud veose andmed" ) - pre_journey_mileage: Optional[conint(strict=True, le=100000, ge=0)] = Field( - None, alias="preJourneyMileage", description="Ettesõidu kilometraaž" + pre_journey_mileage: Optional[ + Annotated[int, Field(le=100000, strict=True, ge=0)] + ] = Field( + default=None, description="Ettesõidu kilometraaž", alias="preJourneyMileage" ) user_custom_data: Optional[Any] = Field( - None, - alias="userCustomData", + default=None, description="Api kasutaja poolt kohandatavad andmed", + alias="userCustomData", ) mass: Optional[Union[StrictFloat, StrictInt]] = Field( - None, description="Autorongi mass tonnides" + default=None, description="Autorongi mass tonnides" + ) + transport_order: Optional[Annotated[str, Field(strict=True, max_length=13)]] = ( + Field(default=None, description="Veotellimuse number", alias="transportOrder") ) - transport_order: Optional[constr(strict=True, max_length=13)] = Field( - None, alias="transportOrder", description="Veotellimuse number" + submission_coordinates: Optional[Coordinates] = Field( + default=None, alias="submissionCoordinates" ) - viewers: Optional[conlist(Viewer)] = Field(None, description="Veoselehe vaatlejad") - __properties = [ + viewers: Optional[List[Viewer]] = Field( + default=None, description="Veoselehe vaatlejad" + ) + __properties: ClassVar[List[str]] = [ "owner", "transport", "receiver", @@ -77,31 +87,47 @@ class StartWaybillRequest(BaseModel): "userCustomData", "mass", "transportOrder", + "submissionCoordinates", "viewers", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StartWaybillRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StartWaybillRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of owner if self.owner: _dict["owner"] = self.owner.to_dict() @@ -117,80 +143,89 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each item in shipments (list) _items = [] if self.shipments: - for _item in self.shipments: - if _item: - _items.append(_item.to_dict()) + for _item_shipments in self.shipments: + if _item_shipments: + _items.append(_item_shipments.to_dict()) _dict["shipments"] = _items + # override the default output from pydantic by calling `to_dict()` of submission_coordinates + if self.submission_coordinates: + _dict["submissionCoordinates"] = self.submission_coordinates.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in viewers (list) _items = [] if self.viewers: - for _item in self.viewers: - if _item: - _items.append(_item.to_dict()) + for _item_viewers in self.viewers: + if _item_viewers: + _items.append(_item_viewers.to_dict()) _dict["viewers"] = _items # set to None if pre_journey_mileage (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.pre_journey_mileage is None - and "pre_journey_mileage" in self.__fields_set__ + and "pre_journey_mileage" in self.model_fields_set ): _dict["preJourneyMileage"] = None # set to None if user_custom_data (nullable) is None - # and __fields_set__ contains the field - if self.user_custom_data is None and "user_custom_data" in self.__fields_set__: + # and model_fields_set contains the field + if ( + self.user_custom_data is None + and "user_custom_data" in self.model_fields_set + ): _dict["userCustomData"] = None # set to None if mass (nullable) is None - # and __fields_set__ contains the field - if self.mass is None and "mass" in self.__fields_set__: + # and model_fields_set contains the field + if self.mass is None and "mass" in self.model_fields_set: _dict["mass"] = None # set to None if viewers (nullable) is None - # and __fields_set__ contains the field - if self.viewers is None and "viewers" in self.__fields_set__: + # and model_fields_set contains the field + if self.viewers is None and "viewers" in self.model_fields_set: _dict["viewers"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StartWaybillRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StartWaybillRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StartWaybillRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = StartWaybillRequest.parse_obj( + _obj = cls.model_validate( { - "owner": Owner.from_dict(obj.get("owner")) + "owner": Owner.from_dict(obj["owner"]) if obj.get("owner") is not None else None, - "transport": Transport.from_dict(obj.get("transport")) + "transport": Transport.from_dict(obj["transport"]) if obj.get("transport") is not None else None, - "receiver": Receiver.from_dict(obj.get("receiver")) + "receiver": Receiver.from_dict(obj["receiver"]) if obj.get("receiver") is not None else None, - "place_of_delivery": WaybillPlaceOfDelivery.from_dict( - obj.get("placeOfDelivery") + "placeOfDelivery": WaybillPlaceOfDelivery.from_dict( + obj["placeOfDelivery"] ) if obj.get("placeOfDelivery") is not None else None, "comment": obj.get("comment"), - "departure_time": obj.get("departureTime"), - "submission_time": obj.get("submissionTime"), - "shipments": [ - Shipment.from_dict(_item) for _item in obj.get("shipments") - ] + "departureTime": obj.get("departureTime"), + "submissionTime": obj.get("submissionTime"), + "shipments": [Shipment.from_dict(_item) for _item in obj["shipments"]] if obj.get("shipments") is not None else None, - "pre_journey_mileage": obj.get("preJourneyMileage"), - "user_custom_data": obj.get("userCustomData"), + "preJourneyMileage": obj.get("preJourneyMileage"), + "userCustomData": obj.get("userCustomData"), "mass": obj.get("mass"), - "transport_order": obj.get("transportOrder"), - "viewers": [Viewer.from_dict(_item) for _item in obj.get("viewers")] + "transportOrder": obj.get("transportOrder"), + "submissionCoordinates": Coordinates.from_dict( + obj["submissionCoordinates"] + ) + if obj.get("submissionCoordinates") is not None + else None, + "viewers": [Viewer.from_dict(_item) for _item in obj["viewers"]] if obj.get("viewers") is not None else None, } diff --git a/pyevr/openapi_client/models/subcontractor.py b/pyevr/openapi_client/models/subcontractor.py new file mode 100644 index 0000000..fe10775 --- /dev/null +++ b/pyevr/openapi_client/models/subcontractor.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.contact_person import ContactPerson + + +class Subcontractor(BaseModel): + """ + Subcontractor + """ # noqa: E501 + + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="Nimi" + ) + code: Annotated[str, Field(min_length=1, strict=True, max_length=20)] = Field( + description="Isiku- või registrikood" + ) + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") + __properties: ClassVar[List[str]] = ["name", "code", "contactPerson"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Subcontractor from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of contact_person + if self.contact_person: + _dict["contactPerson"] = self.contact_person.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Subcontractor from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "name": obj.get("name"), + "code": obj.get("code"), + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) + if obj.get("contactPerson") is not None + else None, + } + ) + return _obj diff --git a/pyevr/openapi_client/models/timber_report.py b/pyevr/openapi_client/models/timber_report.py new file mode 100644 index 0000000..c7b6865 --- /dev/null +++ b/pyevr/openapi_client/models/timber_report.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from datetime import datetime +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.timber_report_item import TimberReportItem + + +class TimberReport(BaseModel): + """ + TimberReport + """ # noqa: E501 + + report_number: Optional[ + Annotated[str, Field(min_length=0, strict=True, max_length=25)] + ] = Field(default=None, description="Mõõtmisraporti number", alias="reportNumber") + items: List[TimberReportItem] = Field(description="Palgi mõõtmisraporti andmed") + report_date: Optional[datetime] = Field( + default=None, description="Palgi mõõtmisraporti aeg", alias="reportDate" + ) + __properties: ClassVar[List[str]] = ["reportNumber", "items", "reportDate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TimberReport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item_items in self.items: + if _item_items: + _items.append(_item_items.to_dict()) + _dict["items"] = _items + # set to None if report_number (nullable) is None + # and model_fields_set contains the field + if self.report_number is None and "report_number" in self.model_fields_set: + _dict["reportNumber"] = None + + # set to None if report_date (nullable) is None + # and model_fields_set contains the field + if self.report_date is None and "report_date" in self.model_fields_set: + _dict["reportDate"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TimberReport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "reportNumber": obj.get("reportNumber"), + "items": [TimberReportItem.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None, + "reportDate": obj.get("reportDate"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/timber_report_item.py b/pyevr/openapi_client/models/timber_report_item.py new file mode 100644 index 0000000..fa58b73 --- /dev/null +++ b/pyevr/openapi_client/models/timber_report_item.py @@ -0,0 +1,203 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.defect_code import DefectCode +from pyevr.openapi_client.models.wood_quality import WoodQuality +from pyevr.openapi_client.models.wood_type import WoodType + + +class TimberReportItem(BaseModel): + """ + TimberReportItem + """ # noqa: E501 + + wood_type: WoodType = Field(alias="woodType") + log_amount: Union[ + Annotated[float, Field(le=1.0e9, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Palkide arv (tk)", alias="logAmount") + wood_quality: WoodQuality = Field(alias="woodQuality") + defect_code: Optional[DefectCode] = Field(default=None, alias="defectCode") + buyer_product_code: Optional[Annotated[str, Field(strict=True, max_length=500)]] = ( + Field(default=None, description="Ostja kaubakood", alias="buyerProductCode") + ) + price_group_key: Annotated[str, Field(min_length=1, strict=True, max_length=50)] = ( + Field(description="Hinnagrupi võti", alias="priceGroupKey") + ) + tree_top_diameter_with_bark: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, + description="Ladva diameeter koorega - mm", + alias="treeTopDiameterWithBark", + ) + tree_top_diameter_without_bark: Union[StrictFloat, StrictInt] = Field( + description="Ladva diameeter kooreta - mm", alias="treeTopDiameterWithoutBark" + ) + snag_diameter: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, description="Tüüka diameeter - cm", alias="snagDiameter" + ) + estimated_diameter: Union[StrictFloat, StrictInt] = Field( + description="Arvestuslik diameeter – cm", alias="estimatedDiameter" + ) + actual_diameter: StrictInt = Field( + description="Tegelik mõõdetud pikkus – täissentimeetrites", + alias="actualDiameter", + ) + payable_length: StrictInt = Field( + description="Arvestuspikkus – täisdetsimeeter", alias="payableLength" + ) + price: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, description="Hind" + ) + actual_volume: Optional[Union[StrictFloat, StrictInt]] = Field( + default=None, description="Tegelik maht", alias="actualVolume" + ) + payable_volume: Union[StrictFloat, StrictInt] = Field( + description="Arvestusmaht", alias="payableVolume" + ) + measurer_name: Optional[StrictStr] = Field( + default=None, description="Mõõtja nimi", alias="measurerName" + ) + __properties: ClassVar[List[str]] = [ + "woodType", + "logAmount", + "woodQuality", + "defectCode", + "buyerProductCode", + "priceGroupKey", + "treeTopDiameterWithBark", + "treeTopDiameterWithoutBark", + "snagDiameter", + "estimatedDiameter", + "actualDiameter", + "payableLength", + "price", + "actualVolume", + "payableVolume", + "measurerName", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TimberReportItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if buyer_product_code (nullable) is None + # and model_fields_set contains the field + if ( + self.buyer_product_code is None + and "buyer_product_code" in self.model_fields_set + ): + _dict["buyerProductCode"] = None + + # set to None if tree_top_diameter_with_bark (nullable) is None + # and model_fields_set contains the field + if ( + self.tree_top_diameter_with_bark is None + and "tree_top_diameter_with_bark" in self.model_fields_set + ): + _dict["treeTopDiameterWithBark"] = None + + # set to None if snag_diameter (nullable) is None + # and model_fields_set contains the field + if self.snag_diameter is None and "snag_diameter" in self.model_fields_set: + _dict["snagDiameter"] = None + + # set to None if price (nullable) is None + # and model_fields_set contains the field + if self.price is None and "price" in self.model_fields_set: + _dict["price"] = None + + # set to None if actual_volume (nullable) is None + # and model_fields_set contains the field + if self.actual_volume is None and "actual_volume" in self.model_fields_set: + _dict["actualVolume"] = None + + # set to None if measurer_name (nullable) is None + # and model_fields_set contains the field + if self.measurer_name is None and "measurer_name" in self.model_fields_set: + _dict["measurerName"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TimberReportItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "woodType": obj.get("woodType"), + "logAmount": obj.get("logAmount"), + "woodQuality": obj.get("woodQuality"), + "defectCode": obj.get("defectCode"), + "buyerProductCode": obj.get("buyerProductCode"), + "priceGroupKey": obj.get("priceGroupKey"), + "treeTopDiameterWithBark": obj.get("treeTopDiameterWithBark"), + "treeTopDiameterWithoutBark": obj.get("treeTopDiameterWithoutBark"), + "snagDiameter": obj.get("snagDiameter"), + "estimatedDiameter": obj.get("estimatedDiameter"), + "actualDiameter": obj.get("actualDiameter"), + "payableLength": obj.get("payableLength"), + "price": obj.get("price"), + "actualVolume": obj.get("actualVolume"), + "payableVolume": obj.get("payableVolume"), + "measurerName": obj.get("measurerName"), + } + ) + return _obj diff --git a/pyevr/openapi_client/models/total.py b/pyevr/openapi_client/models/total.py index 6242fdb..7ca93c9 100644 --- a/pyevr/openapi_client/models/total.py +++ b/pyevr/openapi_client/models/total.py @@ -1,73 +1,90 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set, Union -from typing import Union -from pydantic import BaseModel, Field, confloat, conint, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class Total(BaseModel): """ Total - """ + """ # noqa: E501 amount: Union[ - confloat(le=1.0e9, ge=0.0, strict=True), - conint(le=1000000000, ge=0, strict=True), - ] = Field(..., description="Mõõdetud kogus") - unit: constr(strict=True, max_length=10, min_length=0) = Field( - ..., description="Mõõtühik" + Annotated[float, Field(le=1.0e9, strict=True, ge=0.0)], + Annotated[int, Field(le=1000000000, strict=True, ge=0)], + ] = Field(description="Mõõdetud kogus") + unit: Annotated[str, Field(min_length=0, strict=True, max_length=10)] = Field( + description="Mõõtühik" ) - __properties = ["amount", "unit"] + __properties: ClassVar[List[str]] = ["amount", "unit"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Total: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Total from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Total: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Total from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Total.parse_obj(obj) + return cls.model_validate(obj) - _obj = Total.parse_obj({"amount": obj.get("amount"), "unit": obj.get("unit")}) + _obj = cls.model_validate( + {"amount": obj.get("amount"), "unit": obj.get("unit")} + ) return _obj diff --git a/pyevr/openapi_client/models/transport.py b/pyevr/openapi_client/models/transport.py index a2252d2..56dab6d 100644 --- a/pyevr/openapi_client/models/transport.py +++ b/pyevr/openapi_client/models/transport.py @@ -1,121 +1,148 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import BaseModel, Field, constr +from pyevr.openapi_client.models.subcontractor import Subcontractor from pyevr.openapi_client.models.transporter import Transporter class Transport(BaseModel): """ Transport - """ + """ # noqa: E501 - transporter: Transporter = Field(...) - driver_name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., alias="driverName", description="Autojuhi nimi" + transporter: Transporter + driver_name: Annotated[str, Field(min_length=0, strict=True, max_length=200)] = ( + Field(description="Autojuhi nimi", alias="driverName") ) - driver_id_code: constr(strict=True, max_length=11, min_length=0) = Field( - ..., alias="driverIdCode", description="Autojuhi isikukood" + driver_id_code: Annotated[str, Field(min_length=0, strict=True, max_length=11)] = ( + Field(description="Autojuhi isikukood", alias="driverIdCode") ) - driver_phone: Optional[constr(strict=True, max_length=25)] = Field( - None, alias="driverPhone", description="Autojuhi telefoninumber" + driver_phone: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field( + default=None, description="Autojuhi telefoninumber", alias="driverPhone" ) - van_registration_number: constr(strict=True, max_length=10, min_length=0) = Field( - ..., - alias="vanRegistrationNumber", - description="Veoki riiklik registreerimisnumber", + van_registration_number: Annotated[ + str, Field(min_length=0, strict=True, max_length=10) + ] = Field( + description="Veoki riiklik registreerimisnumber", alias="vanRegistrationNumber" ) - trailer_registration_number: Optional[constr(strict=True, max_length=10)] = Field( - None, - alias="trailerRegistrationNumber", + trailer_registration_number: Optional[ + Annotated[str, Field(strict=True, max_length=10)] + ] = Field( + default=None, description="Haagise kasutamise korral haagise riiklik registreerimisnumber", + alias="trailerRegistrationNumber", ) - __properties = [ + subcontractor: Optional[Subcontractor] = None + __properties: ClassVar[List[str]] = [ "transporter", "driverName", "driverIdCode", "driverPhone", "vanRegistrationNumber", "trailerRegistrationNumber", + "subcontractor", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Transport: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Transport from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of transporter if self.transporter: _dict["transporter"] = self.transporter.to_dict() + # override the default output from pydantic by calling `to_dict()` of subcontractor + if self.subcontractor: + _dict["subcontractor"] = self.subcontractor.to_dict() # set to None if driver_phone (nullable) is None - # and __fields_set__ contains the field - if self.driver_phone is None and "driver_phone" in self.__fields_set__: + # and model_fields_set contains the field + if self.driver_phone is None and "driver_phone" in self.model_fields_set: _dict["driverPhone"] = None # set to None if trailer_registration_number (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.trailer_registration_number is None - and "trailer_registration_number" in self.__fields_set__ + and "trailer_registration_number" in self.model_fields_set ): _dict["trailerRegistrationNumber"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Transport: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Transport from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Transport.parse_obj(obj) + return cls.model_validate(obj) - _obj = Transport.parse_obj( + _obj = cls.model_validate( { - "transporter": Transporter.from_dict(obj.get("transporter")) + "transporter": Transporter.from_dict(obj["transporter"]) if obj.get("transporter") is not None else None, - "driver_name": obj.get("driverName"), - "driver_id_code": obj.get("driverIdCode"), - "driver_phone": obj.get("driverPhone"), - "van_registration_number": obj.get("vanRegistrationNumber"), - "trailer_registration_number": obj.get("trailerRegistrationNumber"), + "driverName": obj.get("driverName"), + "driverIdCode": obj.get("driverIdCode"), + "driverPhone": obj.get("driverPhone"), + "vanRegistrationNumber": obj.get("vanRegistrationNumber"), + "trailerRegistrationNumber": obj.get("trailerRegistrationNumber"), + "subcontractor": Subcontractor.from_dict(obj["subcontractor"]) + if obj.get("subcontractor") is not None + else None, } ) return _obj diff --git a/pyevr/openapi_client/models/transporter.py b/pyevr/openapi_client/models/transporter.py index b61e163..21ac53d 100644 --- a/pyevr/openapi_client/models/transporter.py +++ b/pyevr/openapi_client/models/transporter.py @@ -1,83 +1,99 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import BaseModel, Field, constr from pyevr.openapi_client.models.contact_person import ContactPerson class Transporter(BaseModel): """ Transporter - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Nimi" + name: Annotated[str, Field(min_length=0, strict=True, max_length=200)] = Field( + description="Nimi" ) - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Isiku- või registrikood" + code: Annotated[str, Field(min_length=0, strict=True, max_length=20)] = Field( + description="Isiku- või registrikood" ) - contact_person: Optional[ContactPerson] = Field(None, alias="contactPerson") - __properties = ["name", "code", "contactPerson"] - - class Config: - """Pydantic configuration""" + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") + __properties: ClassVar[List[str]] = ["name", "code", "contactPerson"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Transporter: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Transporter from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of contact_person if self.contact_person: _dict["contactPerson"] = self.contact_person.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> Transporter: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Transporter from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Transporter.parse_obj(obj) + return cls.model_validate(obj) - _obj = Transporter.parse_obj( + _obj = cls.model_validate( { "name": obj.get("name"), "code": obj.get("code"), - "contact_person": ContactPerson.from_dict(obj.get("contactPerson")) + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) if obj.get("contactPerson") is not None else None, } diff --git a/pyevr/openapi_client/models/unload_waybill_request.py b/pyevr/openapi_client/models/unload_waybill_request.py index 5d0feb1..35ef3f7 100644 --- a/pyevr/openapi_client/models/unload_waybill_request.py +++ b/pyevr/openapi_client/models/unload_waybill_request.py @@ -1,82 +1,110 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import BaseModel, Field, conint, constr +from pyevr.openapi_client.models.coordinates import Coordinates class UnloadWaybillRequest(BaseModel): """ UnloadWaybillRequest - """ + """ # noqa: E501 - total_journey_mileage: conint(strict=True, le=100000, ge=1) = Field( - ..., alias="totalJourneyMileage", description="Kilometraaž koormaga" + total_journey_mileage: Annotated[int, Field(le=100000, strict=True, ge=1)] = Field( + description="Kilometraaž koormaga", alias="totalJourneyMileage" ) - comment: Optional[constr(strict=True, max_length=400)] = Field( - None, description="Kommentaar" + comment: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field( + default=None, description="Kommentaar" + ) + coordinates: Optional[Coordinates] = None + __properties: ClassVar[List[str]] = [ + "totalJourneyMileage", + "comment", + "coordinates", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["totalJourneyMileage", "comment"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UnloadWaybillRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UnloadWaybillRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of coordinates + if self.coordinates: + _dict["coordinates"] = self.coordinates.to_dict() # set to None if comment (nullable) is None - # and __fields_set__ contains the field - if self.comment is None and "comment" in self.__fields_set__: + # and model_fields_set contains the field + if self.comment is None and "comment" in self.model_fields_set: _dict["comment"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UnloadWaybillRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UnloadWaybillRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UnloadWaybillRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = UnloadWaybillRequest.parse_obj( + _obj = cls.model_validate( { - "total_journey_mileage": obj.get("totalJourneyMileage"), + "totalJourneyMileage": obj.get("totalJourneyMileage"), "comment": obj.get("comment"), + "coordinates": Coordinates.from_dict(obj["coordinates"]) + if obj.get("coordinates") is not None + else None, } ) return _obj diff --git a/pyevr/openapi_client/models/validation_result.py b/pyevr/openapi_client/models/validation_result.py index dd1e17d..b9d3d34 100644 --- a/pyevr/openapi_client/models/validation_result.py +++ b/pyevr/openapi_client/models/validation_result.py @@ -1,76 +1,82 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from typing import Dict, List, Optional -from pydantic import BaseModel, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictStr +from typing_extensions import Self class ValidationResult(BaseModel): """ ValidationResult - """ - - errors: Optional[Dict[str, conlist(StrictStr)]] = None - __properties = ["errors"] + """ # noqa: E501 - class Config: - """Pydantic configuration""" + errors: Optional[Dict[str, List[StrictStr]]] = None + __properties: ClassVar[List[str]] = ["errors"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ValidationResult: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ValidationResult from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of each value in errors (dict of array) - _field_dict_of_array = {} - if self.errors: - for _key in self.errors: - if self.errors[_key]: - _field_dict_of_array[_key] = [ - _item.to_dict() for _item in self.errors[_key] - ] - _dict["errors"] = _field_dict_of_array + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ValidationResult: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ValidationResult from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ValidationResult.parse_obj(obj) + return cls.model_validate(obj) - _obj = ValidationResult.parse_obj({"errors": obj.get("errors")}) + _obj = cls.model_validate({"errors": obj.get("errors")}) return _obj diff --git a/pyevr/openapi_client/models/viewer.py b/pyevr/openapi_client/models/viewer.py index 6e04230..9c97d7c 100644 --- a/pyevr/openapi_client/models/viewer.py +++ b/pyevr/openapi_client/models/viewer.py @@ -1,68 +1,84 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - +from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class Viewer(BaseModel): """ Viewer - """ + """ # noqa: E501 - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Registrikood" + code: Annotated[str, Field(min_length=0, strict=True, max_length=20)] = Field( + description="Registrikood" ) - __properties = ["code"] + __properties: ClassVar[List[str]] = ["code"] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Viewer: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Viewer from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> Viewer: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Viewer from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Viewer.parse_obj(obj) + return cls.model_validate(obj) - _obj = Viewer.parse_obj({"code": obj.get("code")}) + _obj = cls.model_validate({"code": obj.get("code")}) return _obj diff --git a/pyevr/openapi_client/models/waybill.py b/pyevr/openapi_client/models/waybill.py index 11cb5f2..d3d5fd1 100644 --- a/pyevr/openapi_client/models/waybill.py +++ b/pyevr/openapi_client/models/waybill.py @@ -1,38 +1,33 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Any, List, Optional, Union -from pydantic import ( - BaseModel, - Field, - StrictFloat, - StrictInt, - StrictStr, - conint, - conlist, - constr, -) +from typing import Any, ClassVar, Dict, List, Optional, Set, Union + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing_extensions import Annotated, Self + +from pyevr.openapi_client.models.coordinates import Coordinates from pyevr.openapi_client.models.measurement_act import MeasurementAct from pyevr.openapi_client.models.owner import Owner from pyevr.openapi_client.models.receiver import Receiver from pyevr.openapi_client.models.shipment import Shipment +from pyevr.openapi_client.models.timber_report import TimberReport from pyevr.openapi_client.models.transport import Transport from pyevr.openapi_client.models.waybill_authorization import WaybillAuthorization from pyevr.openapi_client.models.waybill_note import WaybillNote @@ -43,86 +38,100 @@ class Waybill(BaseModel): """ Waybill - """ + """ # noqa: E501 - owner: Owner = Field(...) - transport: Transport = Field(...) - receiver: Receiver = Field(...) - place_of_delivery: WaybillPlaceOfDelivery = Field(..., alias="placeOfDelivery") - comment: Optional[constr(strict=True, max_length=400)] = Field( - None, description="Märkused/lisainfo" + owner: Owner + transport: Transport + receiver: Receiver + place_of_delivery: WaybillPlaceOfDelivery = Field(alias="placeOfDelivery") + comment: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field( + default=None, description="Märkused/lisainfo" ) departure_time: datetime = Field( - ..., alias="departureTime", description="Väljasõidu aeg" + description="Väljasõidu aeg", alias="departureTime" ) submission_time: datetime = Field( - ..., alias="submissionTime", description="Veoselehe EVR-i saatmise aeg" + description="Veoselehe EVR-i saatmise aeg", alias="submissionTime" ) - shipments: conlist(Shipment, max_items=25) = Field( - ..., description="Lähetatud veose andmed" + shipments: Annotated[List[Shipment], Field(max_length=25)] = Field( + description="Lähetatud veose andmed" ) - pre_journey_mileage: Optional[conint(strict=True, le=100000, ge=0)] = Field( - None, alias="preJourneyMileage", description="Ettesõidu kilometraaž" + pre_journey_mileage: Optional[ + Annotated[int, Field(le=100000, strict=True, ge=0)] + ] = Field( + default=None, description="Ettesõidu kilometraaž", alias="preJourneyMileage" ) user_custom_data: Optional[Any] = Field( - None, - alias="userCustomData", + default=None, description="Api kasutaja poolt kohandatavad andmed", + alias="userCustomData", ) mass: Optional[Union[StrictFloat, StrictInt]] = Field( - None, description="Autorongi mass tonnides" + default=None, description="Autorongi mass tonnides" + ) + transport_order: Optional[Annotated[str, Field(strict=True, max_length=13)]] = ( + Field(default=None, description="Veotellimuse number", alias="transportOrder") ) - transport_order: Optional[constr(strict=True, max_length=13)] = Field( - None, alias="transportOrder", description="Veotellimuse number" + submission_coordinates: Optional[Coordinates] = Field( + default=None, alias="submissionCoordinates" ) - number: Optional[StrictStr] = Field(None, description="Veoselehe number") + number: Optional[StrictStr] = Field(default=None, description="Veoselehe number") status: Optional[WaybillStatus] = None creation_time: Optional[datetime] = Field( - None, alias="creationTime", description="Loomise aeg" + default=None, description="Loomise aeg", alias="creationTime" ) cancellation_time: Optional[datetime] = Field( - None, - alias="cancellationTime", + default=None, description="Tühistamise aeg (kui veoseleht on tühistatud)", + alias="cancellationTime", ) cancellation_reason: Optional[StrictStr] = Field( - None, - alias="cancellationReason", + default=None, description="Tühistamise põhjus (kui veoseleht on tühistatud)", + alias="cancellationReason", + ) + cancellation_coordinates: Optional[Coordinates] = Field( + default=None, alias="cancellationCoordinates" ) total_journey_mileage: Optional[StrictInt] = Field( - None, - alias="totalJourneyMileage", + default=None, description="Kilometraaž koormaga (kui veoselehel on vedu lõpetatud)", + alias="totalJourneyMileage", ) unloading_comment: Optional[StrictStr] = Field( - None, - alias="unloadingComment", + default=None, description="Mahalaadimise kommentaar (kui veoselehel on vedu lõpetatud)", + alias="unloadingComment", ) unloading_time: Optional[datetime] = Field( - None, - alias="unloadingTime", + default=None, description="Mahalaadimise aeg (kui veoselehel on vedu lõpetatud)", + alias="unloadingTime", + ) + unloading_coordinates: Optional[Coordinates] = Field( + default=None, alias="unloadingCoordinates" ) finishing_time: Optional[datetime] = Field( - None, - alias="finishingTime", + default=None, description="Veoselehe lõpetamise aeg (kui veoseleht on lõpetatud)", + alias="finishingTime", ) last_modification_time: Optional[datetime] = Field( - None, alias="lastModificationTime", description="Veoselehe viimase muutmise aeg" + default=None, + description="Veoselehe viimase muutmise aeg", + alias="lastModificationTime", ) - notes: Optional[conlist(WaybillNote)] = Field( - None, description="Veoselehe märkused" + notes: Optional[List[WaybillNote]] = Field( + default=None, description="Veoselehe märkused" ) - waybill_authorizations: Optional[conlist(WaybillAuthorization)] = Field( - None, alias="waybillAuthorizations", description="Veoselehe volitused" + waybill_authorizations: Optional[List[WaybillAuthorization]] = Field( + default=None, description="Veoselehe volitused", alias="waybillAuthorizations" ) waybill_latest_measurements: Optional[MeasurementAct] = Field( - None, alias="waybillLatestMeasurements" + default=None, alias="waybillLatestMeasurements" ) - __properties = [ + timber_report: Optional[TimberReport] = Field(default=None, alias="timberReport") + __properties: ClassVar[List[str]] = [ "owner", "transport", "receiver", @@ -135,43 +144,62 @@ class Waybill(BaseModel): "userCustomData", "mass", "transportOrder", + "submissionCoordinates", "number", "status", "creationTime", "cancellationTime", "cancellationReason", + "cancellationCoordinates", "totalJourneyMileage", "unloadingComment", "unloadingTime", + "unloadingCoordinates", "finishingTime", "lastModificationTime", "notes", "waybillAuthorizations", "waybillLatestMeasurements", + "timberReport", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Waybill: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Waybill from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of owner if self.owner: _dict["owner"] = self.owner.to_dict() @@ -187,173 +215,204 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of each item in shipments (list) _items = [] if self.shipments: - for _item in self.shipments: - if _item: - _items.append(_item.to_dict()) + for _item_shipments in self.shipments: + if _item_shipments: + _items.append(_item_shipments.to_dict()) _dict["shipments"] = _items + # override the default output from pydantic by calling `to_dict()` of submission_coordinates + if self.submission_coordinates: + _dict["submissionCoordinates"] = self.submission_coordinates.to_dict() + # override the default output from pydantic by calling `to_dict()` of cancellation_coordinates + if self.cancellation_coordinates: + _dict["cancellationCoordinates"] = self.cancellation_coordinates.to_dict() + # override the default output from pydantic by calling `to_dict()` of unloading_coordinates + if self.unloading_coordinates: + _dict["unloadingCoordinates"] = self.unloading_coordinates.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in notes (list) _items = [] if self.notes: - for _item in self.notes: - if _item: - _items.append(_item.to_dict()) + for _item_notes in self.notes: + if _item_notes: + _items.append(_item_notes.to_dict()) _dict["notes"] = _items # override the default output from pydantic by calling `to_dict()` of each item in waybill_authorizations (list) _items = [] if self.waybill_authorizations: - for _item in self.waybill_authorizations: - if _item: - _items.append(_item.to_dict()) + for _item_waybill_authorizations in self.waybill_authorizations: + if _item_waybill_authorizations: + _items.append(_item_waybill_authorizations.to_dict()) _dict["waybillAuthorizations"] = _items # override the default output from pydantic by calling `to_dict()` of waybill_latest_measurements if self.waybill_latest_measurements: - _dict[ - "waybillLatestMeasurements" - ] = self.waybill_latest_measurements.to_dict() + _dict["waybillLatestMeasurements"] = ( + self.waybill_latest_measurements.to_dict() + ) + # override the default output from pydantic by calling `to_dict()` of timber_report + if self.timber_report: + _dict["timberReport"] = self.timber_report.to_dict() # set to None if pre_journey_mileage (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.pre_journey_mileage is None - and "pre_journey_mileage" in self.__fields_set__ + and "pre_journey_mileage" in self.model_fields_set ): _dict["preJourneyMileage"] = None # set to None if user_custom_data (nullable) is None - # and __fields_set__ contains the field - if self.user_custom_data is None and "user_custom_data" in self.__fields_set__: + # and model_fields_set contains the field + if ( + self.user_custom_data is None + and "user_custom_data" in self.model_fields_set + ): _dict["userCustomData"] = None # set to None if mass (nullable) is None - # and __fields_set__ contains the field - if self.mass is None and "mass" in self.__fields_set__: + # and model_fields_set contains the field + if self.mass is None and "mass" in self.model_fields_set: _dict["mass"] = None # set to None if cancellation_time (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.cancellation_time is None - and "cancellation_time" in self.__fields_set__ + and "cancellation_time" in self.model_fields_set ): _dict["cancellationTime"] = None # set to None if cancellation_reason (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.cancellation_reason is None - and "cancellation_reason" in self.__fields_set__ + and "cancellation_reason" in self.model_fields_set ): _dict["cancellationReason"] = None # set to None if total_journey_mileage (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.total_journey_mileage is None - and "total_journey_mileage" in self.__fields_set__ + and "total_journey_mileage" in self.model_fields_set ): _dict["totalJourneyMileage"] = None # set to None if unloading_comment (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.unloading_comment is None - and "unloading_comment" in self.__fields_set__ + and "unloading_comment" in self.model_fields_set ): _dict["unloadingComment"] = None # set to None if unloading_time (nullable) is None - # and __fields_set__ contains the field - if self.unloading_time is None and "unloading_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.unloading_time is None and "unloading_time" in self.model_fields_set: _dict["unloadingTime"] = None # set to None if finishing_time (nullable) is None - # and __fields_set__ contains the field - if self.finishing_time is None and "finishing_time" in self.__fields_set__: + # and model_fields_set contains the field + if self.finishing_time is None and "finishing_time" in self.model_fields_set: _dict["finishingTime"] = None # set to None if last_modification_time (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.last_modification_time is None - and "last_modification_time" in self.__fields_set__ + and "last_modification_time" in self.model_fields_set ): _dict["lastModificationTime"] = None # set to None if notes (nullable) is None - # and __fields_set__ contains the field - if self.notes is None and "notes" in self.__fields_set__: + # and model_fields_set contains the field + if self.notes is None and "notes" in self.model_fields_set: _dict["notes"] = None # set to None if waybill_authorizations (nullable) is None - # and __fields_set__ contains the field + # and model_fields_set contains the field if ( self.waybill_authorizations is None - and "waybill_authorizations" in self.__fields_set__ + and "waybill_authorizations" in self.model_fields_set ): _dict["waybillAuthorizations"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Waybill: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Waybill from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Waybill.parse_obj(obj) + return cls.model_validate(obj) - _obj = Waybill.parse_obj( + _obj = cls.model_validate( { - "owner": Owner.from_dict(obj.get("owner")) + "owner": Owner.from_dict(obj["owner"]) if obj.get("owner") is not None else None, - "transport": Transport.from_dict(obj.get("transport")) + "transport": Transport.from_dict(obj["transport"]) if obj.get("transport") is not None else None, - "receiver": Receiver.from_dict(obj.get("receiver")) + "receiver": Receiver.from_dict(obj["receiver"]) if obj.get("receiver") is not None else None, - "place_of_delivery": WaybillPlaceOfDelivery.from_dict( - obj.get("placeOfDelivery") + "placeOfDelivery": WaybillPlaceOfDelivery.from_dict( + obj["placeOfDelivery"] ) if obj.get("placeOfDelivery") is not None else None, "comment": obj.get("comment"), - "departure_time": obj.get("departureTime"), - "submission_time": obj.get("submissionTime"), - "shipments": [ - Shipment.from_dict(_item) for _item in obj.get("shipments") - ] + "departureTime": obj.get("departureTime"), + "submissionTime": obj.get("submissionTime"), + "shipments": [Shipment.from_dict(_item) for _item in obj["shipments"]] if obj.get("shipments") is not None else None, - "pre_journey_mileage": obj.get("preJourneyMileage"), - "user_custom_data": obj.get("userCustomData"), + "preJourneyMileage": obj.get("preJourneyMileage"), + "userCustomData": obj.get("userCustomData"), "mass": obj.get("mass"), - "transport_order": obj.get("transportOrder"), + "transportOrder": obj.get("transportOrder"), + "submissionCoordinates": Coordinates.from_dict( + obj["submissionCoordinates"] + ) + if obj.get("submissionCoordinates") is not None + else None, "number": obj.get("number"), "status": obj.get("status"), - "creation_time": obj.get("creationTime"), - "cancellation_time": obj.get("cancellationTime"), - "cancellation_reason": obj.get("cancellationReason"), - "total_journey_mileage": obj.get("totalJourneyMileage"), - "unloading_comment": obj.get("unloadingComment"), - "unloading_time": obj.get("unloadingTime"), - "finishing_time": obj.get("finishingTime"), - "last_modification_time": obj.get("lastModificationTime"), - "notes": [WaybillNote.from_dict(_item) for _item in obj.get("notes")] + "creationTime": obj.get("creationTime"), + "cancellationTime": obj.get("cancellationTime"), + "cancellationReason": obj.get("cancellationReason"), + "cancellationCoordinates": Coordinates.from_dict( + obj["cancellationCoordinates"] + ) + if obj.get("cancellationCoordinates") is not None + else None, + "totalJourneyMileage": obj.get("totalJourneyMileage"), + "unloadingComment": obj.get("unloadingComment"), + "unloadingTime": obj.get("unloadingTime"), + "unloadingCoordinates": Coordinates.from_dict( + obj["unloadingCoordinates"] + ) + if obj.get("unloadingCoordinates") is not None + else None, + "finishingTime": obj.get("finishingTime"), + "lastModificationTime": obj.get("lastModificationTime"), + "notes": [WaybillNote.from_dict(_item) for _item in obj["notes"]] if obj.get("notes") is not None else None, - "waybill_authorizations": [ + "waybillAuthorizations": [ WaybillAuthorization.from_dict(_item) - for _item in obj.get("waybillAuthorizations") + for _item in obj["waybillAuthorizations"] ] if obj.get("waybillAuthorizations") is not None else None, - "waybill_latest_measurements": MeasurementAct.from_dict( - obj.get("waybillLatestMeasurements") + "waybillLatestMeasurements": MeasurementAct.from_dict( + obj["waybillLatestMeasurements"] ) if obj.get("waybillLatestMeasurements") is not None else None, + "timberReport": TimberReport.from_dict(obj["timberReport"]) + if obj.get("timberReport") is not None + else None, } ) return _obj diff --git a/pyevr/openapi_client/models/waybill_authorization.py b/pyevr/openapi_client/models/waybill_authorization.py index 6875806..d909292 100644 --- a/pyevr/openapi_client/models/waybill_authorization.py +++ b/pyevr/openapi_client/models/waybill_authorization.py @@ -1,72 +1,87 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from pydantic import BaseModel, Field, constr from pyevr.openapi_client.models.authorization_type import AuthorizationType class WaybillAuthorization(BaseModel): """ WaybillAuthorization - """ + """ # noqa: E501 - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Registrikood" + code: Annotated[str, Field(min_length=0, strict=True, max_length=20)] = Field( + description="Registrikood" ) - type: AuthorizationType = Field(...) - __properties = ["code", "type"] - - class Config: - """Pydantic configuration""" + type: AuthorizationType + __properties: ClassVar[List[str]] = ["code", "type"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> WaybillAuthorization: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WaybillAuthorization from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> WaybillAuthorization: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WaybillAuthorization from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WaybillAuthorization.parse_obj(obj) + return cls.model_validate(obj) - _obj = WaybillAuthorization.parse_obj( - {"code": obj.get("code"), "type": obj.get("type")} - ) + _obj = cls.model_validate({"code": obj.get("code"), "type": obj.get("type")}) return _obj diff --git a/pyevr/openapi_client/models/waybill_note.py b/pyevr/openapi_client/models/waybill_note.py index f9e9428..c24f0ae 100644 --- a/pyevr/openapi_client/models/waybill_note.py +++ b/pyevr/openapi_client/models/waybill_note.py @@ -1,82 +1,99 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json - from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + from pyevr.openapi_client.models.waybill_note_creator import WaybillNoteCreator class WaybillNote(BaseModel): """ WaybillNote - """ + """ # noqa: E501 creator: Optional[WaybillNoteCreator] = None creation_time: Optional[datetime] = Field( - None, alias="creationTime", description="Loomise aeg" + default=None, description="Loomise aeg", alias="creationTime" ) - message: Optional[StrictStr] = Field(None, description="Sõnum") - __properties = ["creator", "creationTime", "message"] - - class Config: - """Pydantic configuration""" + message: Optional[StrictStr] = Field(default=None, description="Sõnum") + __properties: ClassVar[List[str]] = ["creator", "creationTime", "message"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> WaybillNote: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WaybillNote from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of creator if self.creator: _dict["creator"] = self.creator.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> WaybillNote: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WaybillNote from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WaybillNote.parse_obj(obj) + return cls.model_validate(obj) - _obj = WaybillNote.parse_obj( + _obj = cls.model_validate( { - "creator": WaybillNoteCreator.from_dict(obj.get("creator")) + "creator": WaybillNoteCreator.from_dict(obj["creator"]) if obj.get("creator") is not None else None, - "creation_time": obj.get("creationTime"), + "creationTime": obj.get("creationTime"), "message": obj.get("message"), } ) diff --git a/pyevr/openapi_client/models/waybill_note_creator.py b/pyevr/openapi_client/models/waybill_note_creator.py index 2c68182..eb2ed45 100644 --- a/pyevr/openapi_client/models/waybill_note_creator.py +++ b/pyevr/openapi_client/models/waybill_note_creator.py @@ -1,73 +1,87 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self class WaybillNoteCreator(BaseModel): """ WaybillNoteCreator - """ + """ # noqa: E501 - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Nimi" + name: Annotated[str, Field(min_length=1, strict=True, max_length=200)] = Field( + description="Nimi" ) - code: constr(strict=True, max_length=20, min_length=0) = Field( - ..., description="Isiku- või registrikood" + code: Annotated[str, Field(min_length=1, strict=True, max_length=20)] = Field( + description="Isiku- või registrikood" ) - __properties = ["name", "code"] - - class Config: - """Pydantic configuration""" + __properties: ClassVar[List[str]] = ["name", "code"] - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> WaybillNoteCreator: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WaybillNoteCreator from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> WaybillNoteCreator: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WaybillNoteCreator from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WaybillNoteCreator.parse_obj(obj) + return cls.model_validate(obj) - _obj = WaybillNoteCreator.parse_obj( - {"name": obj.get("name"), "code": obj.get("code")} - ) + _obj = cls.model_validate({"name": obj.get("name"), "code": obj.get("code")}) return _obj diff --git a/pyevr/openapi_client/models/waybill_place_of_delivery.py b/pyevr/openapi_client/models/waybill_place_of_delivery.py index 1f48059..52bd97a 100644 --- a/pyevr/openapi_client/models/waybill_place_of_delivery.py +++ b/pyevr/openapi_client/models/waybill_place_of_delivery.py @@ -1,25 +1,26 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import BaseModel, ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Any, Optional -from pydantic import BaseModel, Field, constr from pyevr.openapi_client.models.address import Address from pyevr.openapi_client.models.contact_person import ContactPerson from pyevr.openapi_client.models.coordinates import Coordinates @@ -28,26 +29,26 @@ class WaybillPlaceOfDelivery(BaseModel): """ WaybillPlaceOfDelivery - """ + """ # noqa: E501 - code: Optional[constr(strict=True, max_length=25)] = Field( - None, description="EVR tarnekoha kood (kui on EVR-i lisatud tarnekoht)" + code: Optional[Annotated[str, Field(strict=True, max_length=25)]] = Field( + default=None, description="EVR tarnekoha kood (kui on EVR-i lisatud tarnekoht)" ) - name: constr(strict=True, max_length=200, min_length=0) = Field( - ..., description="Tarnekoha nimi" + name: Annotated[str, Field(min_length=0, strict=True, max_length=200)] = Field( + description="Tarnekoha nimi" ) coordinates: Optional[Coordinates] = None - address: Address = Field(...) - contact_person: Optional[ContactPerson] = Field(None, alias="contactPerson") - near_address: Optional[constr(strict=True, max_length=150)] = Field( - None, alias="nearAddress", description="Lähiaadress" + address: Address + contact_person: Optional[ContactPerson] = Field(default=None, alias="contactPerson") + near_address: Optional[Annotated[str, Field(strict=True, max_length=150)]] = Field( + default=None, description="Lähiaadress", alias="nearAddress" ) user_custom_data: Optional[Any] = Field( - None, - alias="userCustomData", + default=None, description="Api kasutaja poolt kohandatavad andmed", + alias="userCustomData", ) - __properties = [ + __properties: ClassVar[List[str]] = [ "code", "name", "coordinates", @@ -57,28 +58,43 @@ class WaybillPlaceOfDelivery(BaseModel): "userCustomData", ] - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> WaybillPlaceOfDelivery: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WaybillPlaceOfDelivery from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of coordinates if self.coordinates: _dict["coordinates"] = self.coordinates.to_dict() @@ -89,46 +105,49 @@ def to_dict(self): if self.contact_person: _dict["contactPerson"] = self.contact_person.to_dict() # set to None if code (nullable) is None - # and __fields_set__ contains the field - if self.code is None and "code" in self.__fields_set__: + # and model_fields_set contains the field + if self.code is None and "code" in self.model_fields_set: _dict["code"] = None # set to None if near_address (nullable) is None - # and __fields_set__ contains the field - if self.near_address is None and "near_address" in self.__fields_set__: + # and model_fields_set contains the field + if self.near_address is None and "near_address" in self.model_fields_set: _dict["nearAddress"] = None # set to None if user_custom_data (nullable) is None - # and __fields_set__ contains the field - if self.user_custom_data is None and "user_custom_data" in self.__fields_set__: + # and model_fields_set contains the field + if ( + self.user_custom_data is None + and "user_custom_data" in self.model_fields_set + ): _dict["userCustomData"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> WaybillPlaceOfDelivery: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WaybillPlaceOfDelivery from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WaybillPlaceOfDelivery.parse_obj(obj) + return cls.model_validate(obj) - _obj = WaybillPlaceOfDelivery.parse_obj( + _obj = cls.model_validate( { "code": obj.get("code"), "name": obj.get("name"), - "coordinates": Coordinates.from_dict(obj.get("coordinates")) + "coordinates": Coordinates.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None, - "address": Address.from_dict(obj.get("address")) + "address": Address.from_dict(obj["address"]) if obj.get("address") is not None else None, - "contact_person": ContactPerson.from_dict(obj.get("contactPerson")) + "contactPerson": ContactPerson.from_dict(obj["contactPerson"]) if obj.get("contactPerson") is not None else None, - "near_address": obj.get("nearAddress"), - "user_custom_data": obj.get("userCustomData"), + "nearAddress": obj.get("nearAddress"), + "userCustomData": obj.get("userCustomData"), } ) return _obj diff --git a/pyevr/openapi_client/models/waybill_sort_field.py b/pyevr/openapi_client/models/waybill_sort_field.py index 6967710..d58c1e5 100644 --- a/pyevr/openapi_client/models/waybill_sort_field.py +++ b/pyevr/openapi_client/models/waybill_sort_field.py @@ -1,21 +1,22 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg +from enum import Enum + +from typing_extensions import Self class WaybillSortField(str, Enum): @@ -30,6 +31,6 @@ class WaybillSortField(str, Enum): LASTMODIFICATIONTIMEDESC = "lastModificationTimeDesc" @classmethod - def from_json(cls, json_str: str) -> "WaybillSortField": + def from_json(cls, json_str: str) -> Self: """Create an instance of WaybillSortField from a JSON string""" - return WaybillSortField(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/waybill_status.py b/pyevr/openapi_client/models/waybill_status.py index 8cbb55e..af305da 100644 --- a/pyevr/openapi_client/models/waybill_status.py +++ b/pyevr/openapi_client/models/waybill_status.py @@ -1,21 +1,22 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 +from __future__ import annotations import json -import pprint -import re # noqa: F401 -from aenum import Enum, no_arg +from enum import Enum + +from typing_extensions import Self class WaybillStatus(str, Enum): @@ -30,6 +31,6 @@ class WaybillStatus(str, Enum): FINISHED = "finished" @classmethod - def from_json(cls, json_str: str) -> "WaybillStatus": + def from_json(cls, json_str: str) -> Self: """Create an instance of WaybillStatus from a JSON string""" - return WaybillStatus(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/without_forest_notice.py b/pyevr/openapi_client/models/without_forest_notice.py index 1742747..5a2b567 100644 --- a/pyevr/openapi_client/models/without_forest_notice.py +++ b/pyevr/openapi_client/models/without_forest_notice.py @@ -1,88 +1,128 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - from __future__ import annotations + +import json import pprint import re # noqa: F401 -import json +from typing import Any, ClassVar, Dict, List, Optional, Set +from pydantic import ConfigDict, Field +from typing_extensions import Annotated, Self -from typing import Optional -from pydantic import Field, constr +from pyevr.openapi_client.models.eudr_number import EudrNumber from pyevr.openapi_client.models.holding_base import HoldingBase class WithoutForestNotice(HoldingBase): """ WithoutForestNotice - """ + """ # noqa: E501 - cadaster: constr(strict=True, max_length=500, min_length=1) = Field( - ..., description="Katastritunnus" + cadaster: Annotated[str, Field(min_length=1, strict=True, max_length=500)] = Field( + description="Katastritunnus" ) - compartment: Optional[constr(strict=True, max_length=200)] = Field( - None, description="Kvartal" + compartment: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field( + default=None, description="Kvartal" ) - forest_allocation_number: Optional[constr(strict=True, max_length=200)] = Field( - None, alias="forestAllocationNumber", description="Metsaeraldis" + forest_allocation_number: Optional[ + Annotated[str, Field(strict=True, max_length=200)] + ] = Field(default=None, description="Metsaeraldis", alias="forestAllocationNumber") + __properties: ClassVar[List[str]] = [ + "eudrNumbers", + "type", + "cadaster", + "compartment", + "forestAllocationNumber", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), ) - __properties = ["type", "cadaster", "compartment", "forestAllocationNumber"] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> WithoutForestNotice: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of WithoutForestNotice from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in eudr_numbers (list) + _items = [] + if self.eudr_numbers: + for _item_eudr_numbers in self.eudr_numbers: + if _item_eudr_numbers: + _items.append(_item_eudr_numbers.to_dict()) + _dict["eudrNumbers"] = _items + # set to None if eudr_numbers (nullable) is None + # and model_fields_set contains the field + if self.eudr_numbers is None and "eudr_numbers" in self.model_fields_set: + _dict["eudrNumbers"] = None + # set to None if compartment (nullable) is None - # and __fields_set__ contains the field - if self.compartment is None and "compartment" in self.__fields_set__: + # and model_fields_set contains the field + if self.compartment is None and "compartment" in self.model_fields_set: _dict["compartment"] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> WithoutForestNotice: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of WithoutForestNotice from a dict""" if obj is None: return None if not isinstance(obj, dict): - return WithoutForestNotice.parse_obj(obj) + return cls.model_validate(obj) - _obj = WithoutForestNotice.parse_obj( + _obj = cls.model_validate( { + "eudrNumbers": [ + EudrNumber.from_dict(_item) for _item in obj["eudrNumbers"] + ] + if obj.get("eudrNumbers") is not None + else None, "type": obj.get("type"), "cadaster": obj.get("cadaster"), "compartment": obj.get("compartment"), - "forest_allocation_number": obj.get("forestAllocationNumber"), + "forestAllocationNumber": obj.get("forestAllocationNumber"), } ) return _obj diff --git a/pyevr/openapi_client/models/wood_quality.py b/pyevr/openapi_client/models/wood_quality.py new file mode 100644 index 0000000..c2cddab --- /dev/null +++ b/pyevr/openapi_client/models/wood_quality.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class WoodQuality(str, Enum): + """ """ + + """ + allowed enum values + """ + EPLUS = "ePlus" + E = "e" + EA = "ea" + A = "a" + BC = "bc" + BC_II = "bc_II" + ABC = "abc" + ABCD = "abcd" + D = "d" + M = "m" + F = "f" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WoodQuality from a JSON string""" + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/models/wood_type.py b/pyevr/openapi_client/models/wood_type.py new file mode 100644 index 0000000..8126bfc --- /dev/null +++ b/pyevr/openapi_client/models/wood_type.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" +EVR API + +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. + +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class WoodType(str, Enum): + """ """ + + """ + allowed enum values + """ + KU = "ku" + MA = "ma" + KS = "ks" + LM = "lm" + HB = "hb" + LV = "lv" + SA = "sa" + TA = "ta" + NU = "nu" + PN = "pn" + PA = "pa" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of WoodType from a JSON string""" + return cls(json.loads(json_str)) diff --git a/pyevr/openapi_client/rest.py b/pyevr/openapi_client/rest.py index 0d02c47..300bfbe 100644 --- a/pyevr/openapi_client/rest.py +++ b/pyevr/openapi_client/rest.py @@ -1,62 +1,65 @@ # coding: utf-8 """ - EVR API +EVR API - OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. +OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida. - The version of the OpenAPI document: 1.14.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) +The version of the OpenAPI document: 1.40.1 +Generated by OpenAPI Generator (https://openapi-generator.tech) - Do not edit the class manually. +Do not edit the class manually. """ # noqa: E501 - import io import json -import logging import re import ssl -from urllib.parse import urlencode, quote_plus import urllib3 -from pyevr.openapi_client.exceptions import ( - ApiException, - UnauthorizedException, - ForbiddenException, - NotFoundException, - ServiceException, - ApiValueError, - BadRequestException, -) +from pyevr.openapi_client.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): def __init__(self, resp) -> None: - self.urllib3_response = resp + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None) -> None: + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -65,75 +68,63 @@ def __init__(self, configuration, pools_size=4, maxsize=None) -> None: else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } if configuration.assert_hostname is not None: - addition_pool_args[ - "assert_hostname" - ] = configuration.assert_hostname # noqa: E501 + pool_args["assert_hostname"] = configuration.assert_hostname if configuration.retries is not None: - addition_pool_args["retries"] = configuration.retries + pool_args["retries"] = configuration.retries if configuration.tls_server_name: - addition_pool_args["server_hostname"] = configuration.tls_server_name + pool_args["server_hostname"] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args["socket_options"] = configuration.socket_options + pool_args["socket_options"] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args["maxsize"] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) + self.pool_manager = urllib3.PoolManager(**pool_args) def request( self, method, url, - query_params=None, headers=None, body=None, post_params=None, - _preload_content=True, _request_timeout=None, ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -149,13 +140,10 @@ def request( post_params = post_params or {} headers = headers or {} - # url already contains the URL query string - # so reset query_params to empty dict - query_params = {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: timeout = urllib3.Timeout( @@ -166,9 +154,8 @@ def request( # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: # no content type provided or payload is json - if not headers.get("Content-Type") or re.search( - "json", headers["Content-Type"], re.IGNORECASE - ): + content_type = headers.get("Content-Type") + if not content_type or re.search("json", content_type, re.IGNORECASE): request_body = None if body is not None: request_body = json.dumps(body) @@ -176,46 +163,60 @@ def request( method, url, body=request_body, - preload_content=_preload_content, timeout=timeout, headers=headers, + preload_content=False, ) - elif ( - headers["Content-Type"] == "application/x-www-form-urlencoded" - ): # noqa: E501 + elif content_type == "application/x-www-form-urlencoded": r = self.pool_manager.request( method, url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, headers=headers, + preload_content=False, ) - elif headers["Content-Type"] == "multipart/form-data": + elif content_type == "multipart/form-data": # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers["Content-Type"] + # Ensures that dict objects are serialized + post_params = [ + (a, json.dumps(b)) if isinstance(b, dict) else (a, b) + for a, b in post_params + ] r = self.pool_manager.request( method, url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, headers=headers, + preload_content=False, ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False, + ) + elif headers["Content-Type"].startswith("text/") and isinstance( + body, bool + ): + request_body = "true" if body else "false" r = self.pool_manager.request( method, url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers, ) @@ -231,173 +232,12 @@ def request( method, url, fields={}, - preload_content=_preload_content, timeout=timeout, headers=headers, + preload_content=False, ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 400: - raise BadRequestException(http_resp=r) - - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def get_request( - self, - url, - headers=None, - query_params=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "GET", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def head_request( - self, - url, - headers=None, - query_params=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "HEAD", - url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params, - ) - - def options_request( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "OPTIONS", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def delete_request( - self, - url, - headers=None, - query_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "DELETE", - url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def post_request( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "POST", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def put_request( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PUT", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) - - def patch_request( - self, - url, - headers=None, - query_params=None, - post_params=None, - body=None, - _preload_content=True, - _request_timeout=None, - ): - return self.request( - "PATCH", - url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body, - ) + return RESTResponse(r) diff --git a/pyproject.toml b/pyproject.toml index ff6c6f3..b498779 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,30 +1,33 @@ -[tool.poetry] +[project] name = "pyevr" -version = "0.7.0" +version = "1.0.1.dev3" description = "EVR API" -authors = ["Thorgate "] +authors = [{name = "Thorgate Digital", email = "software@thorgate.eu" }] license = "MIT License" readme = "README.rst" -repository = "https://github.com/thorgate/pyevr.git" +repository = "https://github.com/thorgate/pywaybiller.git" keywords = ["OpenAPI", "OpenAPI-Generator", "pyevr"] include = ["openapi_client/py.typed"] +requires-python = ">=3.8,<4" +dependencies = [ + "urllib3 (>= 1.25.3,< 3.0.0)", + "python-dateutil (>=2.8.2)", + "pydantic (>=2)", + "typing-extensions (>=4.7.1)" +] -[tool.poetry.dependencies] -python = "^3.8" -urllib3 = ">= 1.25.3" -python-dateutil = ">=2.8.2" -pydantic = "^1.10.5, <2" -aenum = ">=3.1.11" +[tool.poetry] +authors = ["Thorgate Digital "] +description = "EVR API" +name = "pyevr" +version = "1.0.0" [tool.poetry.group.dev.dependencies] -pytest = ">=7.2.1" -tox = ">=3.9.0" -flake8 = ">=4.0.0" -black = "^23.10.1" +ruff = "*" +pytest = "*" +tox = "*" +json-stream = "*" [build-system] -requires = ["setuptools"] -build-backend = "setuptools.build_meta" - -[tool.pylint.'MESSAGES CONTROL'] -extension-pkg-whitelist = "pydantic" +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/tox.ini b/tox.ini index 049cd80..0f02c96 100644 --- a/tox.ini +++ b/tox.ini @@ -1,20 +1,7 @@ [tox] -envlist = py38, py39, py310, py311, py312, flake8 +envlist = py39, py310, py311, py312, py313 packages = '.' -[travis] -python = - 3.12: py312 - 3.11: py11 - 3.10: py310 - 3.9: py39 - 3.8: py38 - -[testenv:flake8] -basepython = python -deps = flake8 -commands = flake8 --select=E9,F63,F7,F82 pyevr - [testenv] setenv = PYTHONPATH = {toxinidir}