From 034a57a81017cb5088551f5157835875ac53d827 Mon Sep 17 00:00:00 2001 From: Mikhail Gubenko <19877114+Th3Un1q3@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:57:02 +0100 Subject: [PATCH] RC (#266) * feat: minimal python version warning (#260) * [Automated] Version Bump from 0.4.0 to 0.4.1 * Add check for minimal python version and e2e testing * refactor: add linter to the CI (#261) * Add lint check to CI * Modify lint check and perform format * Apply ruff format and modify readme and bump-version.yml * build(deps): bump the python group across 1 directory with 3 updates Bumps the python group with 3 updates in the / directory: [requests](https://github.com/psf/requests), [pydantic](https://github.com/pydantic/pydantic) and [ruff](https://github.com/astral-sh/ruff). Updates `requests` from 2.29.0 to 2.32.3 - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.29.0...v2.32.3) Updates `pydantic` from 1.10.19 to 2.10.1 - [Release notes](https://github.com/pydantic/pydantic/releases) - [Changelog](https://github.com/pydantic/pydantic/blob/main/HISTORY.md) - [Commits](https://github.com/pydantic/pydantic/compare/v1.10.19...v2.10.1) Updates `ruff` from 0.7.3 to 0.8.0 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.7.3...0.8.0) --- updated-dependencies: - dependency-name: requests dependency-type: direct:production update-type: version-update:semver-minor dependency-group: python - dependency-name: pydantic dependency-type: direct:production update-type: version-update:semver-major dependency-group: python - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python ... Signed-off-by: dependabot[bot] * refactor: add lint format check to CI (#267) * Add lint check to CI * Modify lint check and perform format * Apply ruff format and modify readme and bump-version.yml * Add ruff format check to CI * Add ruff format check to CI * Revert version change of pydantic and requests * fix: fix url lib and bump requests * fix: format remarks --------- Signed-off-by: dependabot[bot] Co-authored-by: marwin-roth <150677923+marwin-roth@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mikhail.gubenko --- .github/workflows/bump-version.yml | 2 +- .github/workflows/lint-check.yml | 20 + DEVELOPMENT.md | 29 +- Dockerfile.dev | 4 +- Dockerfile.e2e | 9 + Pipfile | 2 + Pipfile.lock | 733 ++++++---- docs/examples/device_lifecycle_management.py | 59 +- docs/examples/devices.py | 6 +- docs/examples/filtering_and_sorting.py | 9 +- docs/examples/first_operation.py | 2 +- docs/examples/mass_sim_activation.py | 21 +- docs/sphinx/conf.py | 14 +- emnify/__init__.py | 2 +- emnify/api_manager.py | 238 +++- emnify/constants.py | 115 +- emnify/emnify.py | 10 +- emnify/errors.py | 16 +- emnify/modules/__init__.py | 1 - emnify/modules/api/models.py | 1286 +++++++++--------- emnify/modules/device/__init__.py | 1 - emnify/modules/device/api_call_manager.py | 50 +- emnify/modules/device/manager.py | 183 ++- emnify/modules/device/models.py | 14 +- emnify/modules/operator/api_call_manager.py | 4 +- emnify/modules/operator/manager.py | 5 +- emnify/modules/sim/api_call_manager.py | 16 +- emnify/modules/sim/manager.py | 81 +- emnify/modules/sim/models.py | 8 +- emnify/version.py | 2 +- settings.py | 4 +- setup.py | 16 +- tests/__init__.py | 1 - tests/test_emnify.py | 224 ++- 34 files changed, 1847 insertions(+), 1340 deletions(-) create mode 100644 .github/workflows/lint-check.yml create mode 100644 Dockerfile.e2e diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 811ba09..cd1e078 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -47,7 +47,7 @@ jobs: cat > emnify/version.py << EOT # THIS FILE IS GENERATED AUTOMATICALLY, DON'T CHANGE ITS CONTENT!! - EMNIFY_PACKAGE_VERSION='${{ steps.tag_version.outputs.new_version }}' + EMNIFY_PACKAGE_VERSION="${{ steps.tag_version.outputs.new_version }}" EOT - uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/.github/workflows/lint-check.yml b/.github/workflows/lint-check.yml new file mode 100644 index 0000000..c2d1fa0 --- /dev/null +++ b/.github/workflows/lint-check.yml @@ -0,0 +1,20 @@ +name: Lint-Check +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4 + + - name: Install dependencies + run: pip install ruff + + - name: Run check + run: | + ruff check + ruff format --check \ No newline at end of file diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 9222bb7..8e8a85c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -14,7 +14,11 @@ Run a command: # [...args] - command arguments # Run unit tests -docker run -t -v $(pwd):/sdk emnify/python-sdk pytest --cov=emnify --cov-fail-under=90 +docker run -ti -v $(pwd):/sdk emnify/python-sdk pytest --cov=emnify --cov-fail-under=90 +``` +For end-to-end testing, make use of the other Dockerfile provided (it uses our package from [PyPI](https://pypi.org/project/emnify-sdk/)): +```shell +docker build . -f Dockerfile.e2e -t emnify/python-sdk-e2e ``` ### Local debug example @@ -26,6 +30,10 @@ Once your sandbox is set up, you can launch the file and view the results. ```shell docker run -t -e EMNIFY_SDK_APPLICATION_TOKEN= -e EMNIFY_SDK_API_ENDPOINT_URL= -v $(pwd):/sdk emnify/python-sdk python docs/examples/local_debug.py ``` +End-to-end: +```shell +docker run -t -e EMNIFY_SDK_APPLICATION_TOKEN= -e EMNIFY_SDK_API_ENDPOINT_URL= -v $(pwd):/sdk emnify/python-sdk-e2e python docs/examples/local_debug.py +``` ## Version Bump @@ -38,3 +46,22 @@ bump2version minor PR names must follow [angular convention](https://github.com/angular/angular/blob/main/CONTRIBUTING.md). Squash changes while merging to `development` and do regular merge to `main`. + +## Linting + +We use `ruff` for lint and format checks. To run the lint check, execute the following command: +```shell +pipenv run ruff check +``` +To fix the issues, run: +```shell +pipenv run ruff check --fix +``` +To run formatting checks only, execute: +```shell +pipenv run ruff format --check +``` +To fix the formatting issues, run: +```shell +pipenv run ruff format +``` \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev index 2898743..80eb97d 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -4,9 +4,9 @@ RUN pip install pipenv WORKDIR /sdk -COPY Pipfile Pipfile.lock ./ +COPY Pipfile ./ -RUN pipenv install --deploy --ignore-pipfile --dev +RUN pipenv install --deploy --dev COPY . . diff --git a/Dockerfile.e2e b/Dockerfile.e2e new file mode 100644 index 0000000..e1b0c34 --- /dev/null +++ b/Dockerfile.e2e @@ -0,0 +1,9 @@ +FROM python:latest + +RUN pip install emnify-sdk + +WORKDIR /sdk + +COPY . . + +CMD ["echo", "\"Enter Command(Read DEVELOPMENT.md)\""] diff --git a/Pipfile b/Pipfile index 90934b1..7d7a4c0 100644 --- a/Pipfile +++ b/Pipfile @@ -6,6 +6,7 @@ name = "pypi" [packages] requests = ">=2.27.0,<2.33.0" pydantic = ">=1.9.0,<2.0" +urllib3 = ">=1.26.0,<1.27" [dev-packages] vcrpy = "*" @@ -15,3 +16,4 @@ bump2version = "*" pytest-cov = "*" exceptiongroup = "*" tomli = "*" +ruff = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 7924593..477327e 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "a4b0ce74489616d274bd4bcb46c99eda96378a3f0f4f6a96c7ac75191beefef3" + "sha256": "9b9e9b70de3e5eb90e7a2cbd905417b1584e2e4a883b6a3f1f611ba5c171fed0" }, "pipfile-spec": 6, "requires": {}, @@ -143,61 +143,62 @@ }, "pydantic": { "hashes": [ - "sha256:069b9c9fc645474d5ea3653788b544a9e0ccd3dca3ad8c900c4c6eac844b4620", - "sha256:06a189b81ffc52746ec9c8c007f16e5167c8b0a696e1a726369327e3db7b2a82", - "sha256:11d9d9b87b50338b1b7de4ebf34fd29fdb0d219dc07ade29effc74d3d2609c62", - "sha256:15fdbe568beaca9aacfccd5ceadfb5f1a235087a127e8af5e48df9d8a45ae85c", - "sha256:19a3bd00b9dafc2cd7250d94d5b578edf7a0bd7daf102617153ff9a8fa37871c", - "sha256:23e8ec1ce4e57b4f441fc91e3c12adba023fedd06868445a5b5f1d48f0ab3682", - "sha256:24a4a159d0f7a8e26bf6463b0d3d60871d6a52eac5bb6a07a7df85c806f4c048", - "sha256:2ce3fcf75b2bae99aa31bd4968de0474ebe8c8258a0110903478bd83dfee4e3b", - "sha256:335a32d72c51a313b33fa3a9b0fe283503272ef6467910338e123f90925f0f03", - "sha256:3445426da503c7e40baccefb2b2989a0c5ce6b163679dd75f55493b460f05a8f", - "sha256:34a3613c7edb8c6fa578e58e9abe3c0f5e7430e0fc34a65a415a1683b9c32d9a", - "sha256:3d5492dbf953d7d849751917e3b2433fb26010d977aa7a0765c37425a4026ff1", - "sha256:44ae8a3e35a54d2e8fa88ed65e1b08967a9ef8c320819a969bfa09ce5528fafe", - "sha256:467a14ee2183bc9c902579bb2f04c3d3dac00eff52e252850509a562255b2a33", - "sha256:46f379b8cb8a3585e3f61bf9ae7d606c70d133943f339d38b76e041ec234953f", - "sha256:49e26c51ca854286bffc22b69787a8d4063a62bf7d83dc21d44d2ff426108518", - "sha256:65f7361a09b07915a98efd17fdec23103307a54db2000bb92095457ca758d485", - "sha256:6951f3f47cb5ca4da536ab161ac0163cab31417d20c54c6de5ddcab8bc813c3f", - "sha256:72fa46abace0a7743cc697dbb830a41ee84c9db8456e8d77a46d79b537efd7ec", - "sha256:74fe19dda960b193b0eb82c1f4d2c8e5e26918d9cda858cbf3f41dd28549cb70", - "sha256:7a4c5eec138a9b52c67f664c7d51d4c7234c5ad65dd8aacd919fb47445a62c86", - "sha256:80b982d42515632eb51f60fa1d217dfe0729f008e81a82d1544cc392e0a50ddf", - "sha256:941a2eb0a1509bd7f31e355912eb33b698eb0051730b2eaf9e70e2e1589cae1d", - "sha256:9f463abafdc92635da4b38807f5b9972276be7c8c5121989768549fceb8d2588", - "sha256:a00e63104346145389b8e8f500bc6a241e729feaf0559b88b8aa513dd2065481", - "sha256:aad8771ec8dbf9139b01b56f66386537c6fe4e76c8f7a47c10261b69ad25c2c9", - "sha256:ae6fa2008e1443c46b7b3a5eb03800121868d5ab6bc7cda20b5df3e133cde8b3", - "sha256:b661ce52c7b5e5f600c0c3c5839e71918346af2ef20062705ae76b5c16914cab", - "sha256:b74be007703547dc52e3c37344d130a7bfacca7df112a9e5ceeb840a9ce195c7", - "sha256:baebdff1907d1d96a139c25136a9bb7d17e118f133a76a2ef3b845e831e3403a", - "sha256:c20f682defc9ef81cd7eaa485879ab29a86a0ba58acf669a78ed868e72bb89e0", - "sha256:c3e742f62198c9eb9201781fbebe64533a3bbf6a76a91b8d438d62b813079dbc", - "sha256:c5ae6b7c8483b1e0bf59e5f1843e4fd8fd405e11df7de217ee65b98eb5462861", - "sha256:c6d0a9f9eccaf7f438671a64acf654ef0d045466e63f9f68a579e2383b63f357", - "sha256:cbfbca662ed3729204090c4d09ee4beeecc1a7ecba5a159a94b5a4eb24e3759a", - "sha256:d5389eb3b48a72da28c6e061a247ab224381435256eb541e175798483368fdd3", - "sha256:e306e280ebebc65040034bff1a0a81fd86b2f4f05daac0131f29541cafd80b80", - "sha256:e405ffcc1254d76bb0e760db101ee8916b620893e6edfbfee563b3c6f7a67c02", - "sha256:e9ee4e6ca1d9616797fa2e9c0bfb8815912c7d67aca96f77428e316741082a1b", - "sha256:ef0fe7ad7cbdb5f372463d42e6ed4ca9c443a52ce544472d8842a0576d830da5", - "sha256:efbc8a7f9cb5fe26122acba1852d8dcd1e125e723727c59dcd244da7bdaa54f2", - "sha256:fcb20d4cb355195c75000a49bb4a31d75e4295200df620f454bbc6bdf60ca890", - "sha256:fe734914977eed33033b70bfc097e1baaffb589517863955430bf2e0846ac30f" + "sha256:0399094464ae7f28482de22383e667625e38e1516d6b213176df1acdd0c477ea", + "sha256:076c49e24b73d346c45f9282d00dbfc16eef7ae27c970583d499f11110d9e5b0", + "sha256:07d00ca5ef0de65dd274005433ce2bb623730271d495a7d190a91c19c5679d34", + "sha256:0890fbd7fec9e151c7512941243d830b2d6076d5df159a2030952d480ab80a4e", + "sha256:0bfb5b378b78229119d66ced6adac2e933c67a0aa1d0a7adffbe432f3ec14ce4", + "sha256:0d32227ea9a3bf537a2273fd2fdb6d64ab4d9b83acd9e4e09310a777baaabb98", + "sha256:11965f421f7eb026439d4eb7464e9182fe6d69c3d4d416e464a4485d1ba61ab6", + "sha256:1fc8cc264afaf47ae6a9bcbd36c018d0c6b89293835d7fb0e5e1a95898062d59", + "sha256:2206a1752d9fac011e95ca83926a269fb0ef5536f7e053966d058316e24d929f", + "sha256:22a1794e01591884741be56c6fba157c4e99dcc9244beb5a87bd4aa54b84ea8b", + "sha256:4739c206bfb6bb2bdc78dcd40bfcebb2361add4ceac6d170e741bb914e9eff0f", + "sha256:4a5d5b877c7d3d9e17399571a8ab042081d22fe6904416a8b20f8af5909e6c8f", + "sha256:566bebdbe6bc0ac593fa0f67d62febbad9f8be5433f686dc56401ba4aab034e3", + "sha256:570ad0aeaf98b5e33ff41af75aba2ef6604ee25ce0431ecd734a28e74a208555", + "sha256:573254d844f3e64093f72fcd922561d9c5696821ff0900a0db989d8c06ab0c25", + "sha256:5d4320510682d5a6c88766b2a286d03b87bd3562bf8d78c73d63bab04b21e7b4", + "sha256:6d8a38a44bb6a15810084316ed69c854a7c06e0c99c5429f1d664ad52cec353c", + "sha256:6eb56074b11a696e0b66c7181da682e88c00e5cebe6570af8013fcae5e63e186", + "sha256:7e66aa0fa7f8aa9d0a620361834f6eb60d01d3e9cea23ca1a92cda99e6f61dac", + "sha256:7ea24e8614f541d69ea72759ff635df0e612b7dc9d264d43f51364df310081a3", + "sha256:7f31742c95e3f9443b8c6fa07c119623e61d76603be9c0d390bcf7e888acabcb", + "sha256:83ee8c9916689f8e6e7d90161e6663ac876be2efd32f61fdcfa3a15e87d4e413", + "sha256:8b2cf5e26da84f2d2dee3f60a3f1782adedcee785567a19b68d0af7e1534bd1f", + "sha256:945407f4d08cd12485757a281fca0e5b41408606228612f421aa4ea1b63a095d", + "sha256:9c46f58ef2df958ed2ea7437a8be0897d5efe9ee480818405338c7da88186fb3", + "sha256:9d7d48fbc5289efd23982a0d68e973a1f37d49064ccd36d86de4543aff21e086", + "sha256:9f28a81978e936136c44e6a70c65bde7548d87f3807260f73aeffbf76fb94c2f", + "sha256:a415b9e95fa602b10808113967f72b2da8722061265d6af69268c111c254832d", + "sha256:a82746c6d6e91ca17e75f7f333ed41d70fce93af520a8437821dec3ee52dfb10", + "sha256:ad57004e5d73aee36f1e25e4e73a4bc853b473a1c30f652dc8d86b0a987ffce3", + "sha256:c6444368b651a14c2ce2fb22145e1496f7ab23cbdb978590d47c8d34a7bc0289", + "sha256:d216f8d0484d88ab72ab45d699ac669fe031275e3fa6553e3804e69485449fa0", + "sha256:d3449633c207ec3d2d672eedb3edbe753e29bd4e22d2e42a37a2c1406564c20f", + "sha256:d5b5b7c6bafaef90cbb7dafcb225b763edd71d9e22489647ee7df49d6d341890", + "sha256:d7a8a1dd68bac29f08f0a3147de1885f4dccec35d4ea926e6e637fac03cdb4b3", + "sha256:d8d72553d2f3f57ce547de4fa7dc8e3859927784ab2c88343f1fc1360ff17a08", + "sha256:dce355fe7ae53e3090f7f5fa242423c3a7b53260747aa398b4b3aaf8b25f41c3", + "sha256:e351df83d1c9cffa53d4e779009a093be70f1d5c6bb7068584086f6a19042526", + "sha256:ec5c44e6e9eac5128a9bfd21610df3b8c6b17343285cc185105686888dc81206", + "sha256:f5bb81fcfc6d5bff62cd786cbd87480a11d23f16d5376ad2e057c02b3b44df96", + "sha256:fd34012691fbd4e67bdf4accb1f0682342101015b78327eaae3543583fcd451e", + "sha256:fea36c2065b7a1d28c6819cc2e93387b43dd5d3cf5a1e82d8132ee23f36d1f10", + "sha256:ff09600cebe957ecbb4a27496fe34c1d449e7957ed20a202d5029a71a8af2e35" ], "index": "pypi", - "version": "==1.10.18" + "markers": "python_version >= '3.7'", + "version": "==1.10.19" }, "requests": { "hashes": [ - "sha256:dd951ff5ecf3e3b3aa26b40703ba77495dab41da839ae72ef3c8e5d8e2433289", - "sha256:fc06670dd0ed212426dfeb94fc1b983d917c4f9847c863f313c9dfaaffb7c23c" + "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", + "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==2.32.2" + "version": "==2.32.3" }, "typing-extensions": { "hashes": [ @@ -209,11 +210,12 @@ }, "urllib3": { "hashes": [ - "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac", - "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9" + "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e", + "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32" ], - "markers": "python_version >= '3.8'", - "version": "==2.2.3" + "index": "pypi", + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", + "version": "==1.26.20" } }, "develop": { @@ -223,6 +225,7 @@ "sha256:b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7" ], "index": "pypi", + "markers": "python_version >= '3.8'", "version": "==1.2.2.post1" }, "bump2version": { @@ -231,6 +234,7 @@ "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6" ], "index": "pypi", + "markers": "python_version >= '3.5'", "version": "==1.0.1" }, "certifi": { @@ -241,6 +245,79 @@ "markers": "python_version >= '3.6'", "version": "==2024.8.30" }, + "cffi": { + "hashes": [ + "sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8", + "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2", + "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1", + "sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15", + "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36", + "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824", + "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8", + "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36", + "sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17", + "sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf", + "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc", + "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3", + "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed", + "sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702", + "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1", + "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8", + "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903", + "sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6", + "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d", + "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b", + "sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e", + "sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be", + "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c", + "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683", + "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9", + "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c", + "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8", + "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1", + "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4", + "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655", + "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67", + "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595", + "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0", + "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65", + "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41", + "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6", + "sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401", + "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6", + "sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3", + "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16", + "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93", + "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e", + "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4", + "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964", + "sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c", + "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576", + "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0", + "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3", + "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662", + "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3", + "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff", + "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5", + "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd", + "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f", + "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5", + "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14", + "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d", + "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9", + "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7", + "sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382", + "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a", + "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e", + "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a", + "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4", + "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99", + "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87", + "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b" + ], + "markers": "python_version >= '3.8'", + "version": "==1.17.1" + }, "charset-normalizer": { "hashes": [ "sha256:0099d79bdfcf5c1f0c2c72f91516702ebf8b0b8ddd8905f97a8aecf49712c621", @@ -357,71 +434,104 @@ "toml" ], "hashes": [ - "sha256:00a1d69c112ff5149cabe60d2e2ee948752c975d95f1e1096742e6077affd376", - "sha256:023bf8ee3ec6d35af9c1c6ccc1d18fa69afa1cb29eaac57cb064dbb262a517f9", - "sha256:0294ca37f1ba500667b1aef631e48d875ced93ad5e06fa665a3295bdd1d95111", - "sha256:06babbb8f4e74b063dbaeb74ad68dfce9186c595a15f11f5d5683f748fa1d172", - "sha256:0809082ee480bb8f7416507538243c8863ac74fd8a5d2485c46f0f7499f2b491", - "sha256:0b3fb02fe73bed561fa12d279a417b432e5b50fe03e8d663d61b3d5990f29546", - "sha256:0b58c672d14f16ed92a48db984612f5ce3836ae7d72cdd161001cc54512571f2", - "sha256:0bcd1069e710600e8e4cf27f65c90c7843fa8edfb4520fb0ccb88894cad08b11", - "sha256:1032e178b76a4e2b5b32e19d0fd0abbce4b58e77a1ca695820d10e491fa32b08", - "sha256:11a223a14e91a4693d2d0755c7a043db43d96a7450b4f356d506c2562c48642c", - "sha256:12394842a3a8affa3ba62b0d4ab7e9e210c5e366fbac3e8b2a68636fb19892c2", - "sha256:182e6cd5c040cec0a1c8d415a87b67ed01193ed9ad458ee427741c7d8513d963", - "sha256:1d5b8007f81b88696d06f7df0cb9af0d3b835fe0c8dbf489bad70b45f0e45613", - "sha256:1f76846299ba5c54d12c91d776d9605ae33f8ae2b9d1d3c3703cf2db1a67f2c0", - "sha256:27fb4a050aaf18772db513091c9c13f6cb94ed40eacdef8dad8411d92d9992db", - "sha256:29155cd511ee058e260db648b6182c419422a0d2e9a4fa44501898cf918866cf", - "sha256:29fc0f17b1d3fea332f8001d4558f8214af7f1d87a345f3a133c901d60347c73", - "sha256:2b6b4c83d8e8ea79f27ab80778c19bc037759aea298da4b56621f4474ffeb117", - "sha256:2fdef0d83a2d08d69b1f2210a93c416d54e14d9eb398f6ab2f0a209433db19e1", - "sha256:3c65d37f3a9ebb703e710befdc489a38683a5b152242664b973a7b7b22348a4e", - "sha256:4f704f0998911abf728a7783799444fcbbe8261c4a6c166f667937ae6a8aa522", - "sha256:51b44306032045b383a7a8a2c13878de375117946d68dcb54308111f39775a25", - "sha256:53d202fd109416ce011578f321460795abfe10bb901b883cafd9b3ef851bacfc", - "sha256:58809e238a8a12a625c70450b48e8767cff9eb67c62e6154a642b21ddf79baea", - "sha256:5915fcdec0e54ee229926868e9b08586376cae1f5faa9bbaf8faf3561b393d52", - "sha256:5beb1ee382ad32afe424097de57134175fea3faf847b9af002cc7895be4e2a5a", - "sha256:5f8ae553cba74085db385d489c7a792ad66f7f9ba2ee85bfa508aeb84cf0ba07", - "sha256:5fbd612f8a091954a0c8dd4c0b571b973487277d26476f8480bfa4b2a65b5d06", - "sha256:6bd818b7ea14bc6e1f06e241e8234508b21edf1b242d49831831a9450e2f35fa", - "sha256:6f01ba56b1c0e9d149f9ac85a2f999724895229eb36bd997b61e62999e9b0901", - "sha256:73d2b73584446e66ee633eaad1a56aad577c077f46c35ca3283cd687b7715b0b", - "sha256:7bb92c539a624cf86296dd0c68cd5cc286c9eef2d0c3b8b192b604ce9de20a17", - "sha256:8165b796df0bd42e10527a3f493c592ba494f16ef3c8b531288e3d0d72c1f6f0", - "sha256:862264b12ebb65ad8d863d51f17758b1684560b66ab02770d4f0baf2ff75da21", - "sha256:8902dd6a30173d4ef09954bfcb24b5d7b5190cf14a43170e386979651e09ba19", - "sha256:8cf717ee42012be8c0cb205dbbf18ffa9003c4cbf4ad078db47b95e10748eec5", - "sha256:8ed9281d1b52628e81393f5eaee24a45cbd64965f41857559c2b7ff19385df51", - "sha256:99b41d18e6b2a48ba949418db48159d7a2e81c5cc290fc934b7d2380515bd0e3", - "sha256:9cb7fa111d21a6b55cbf633039f7bc2749e74932e3aa7cb7333f675a58a58bf3", - "sha256:a181e99301a0ae128493a24cfe5cfb5b488c4e0bf2f8702091473d033494d04f", - "sha256:a413a096c4cbac202433c850ee43fa326d2e871b24554da8327b01632673a076", - "sha256:a6b1e54712ba3474f34b7ef7a41e65bd9037ad47916ccb1cc78769bae324c01a", - "sha256:ade3ca1e5f0ff46b678b66201f7ff477e8fa11fb537f3b55c3f0568fbfe6e718", - "sha256:b0ac3d42cb51c4b12df9c5f0dd2f13a4f24f01943627120ec4d293c9181219ba", - "sha256:b369ead6527d025a0fe7bd3864e46dbee3aa8f652d48df6174f8d0bac9e26e0e", - "sha256:b57b768feb866f44eeed9f46975f3d6406380275c5ddfe22f531a2bf187eda27", - "sha256:b8d3a03d9bfcaf5b0141d07a88456bb6a4c3ce55c080712fec8418ef3610230e", - "sha256:bc66f0bf1d7730a17430a50163bb264ba9ded56739112368ba985ddaa9c3bd09", - "sha256:bf20494da9653f6410213424f5f8ad0ed885e01f7e8e59811f572bdb20b8972e", - "sha256:c48167910a8f644671de9f2083a23630fbf7a1cb70ce939440cd3328e0919f70", - "sha256:c481b47f6b5845064c65a7bc78bc0860e635a9b055af0df46fdf1c58cebf8e8f", - "sha256:c7c8b95bf47db6d19096a5e052ffca0a05f335bc63cef281a6e8fe864d450a72", - "sha256:c9b8e184898ed014884ca84c70562b4a82cbc63b044d366fedc68bc2b2f3394a", - "sha256:cc8ff50b50ce532de2fa7a7daae9dd12f0a699bfcd47f20945364e5c31799fef", - "sha256:d541423cdd416b78626b55f123412fcf979d22a2c39fce251b350de38c15c15b", - "sha256:dab4d16dfef34b185032580e2f2f89253d302facba093d5fa9dbe04f569c4f4b", - "sha256:dacbc52de979f2823a819571f2e3a350a7e36b8cb7484cdb1e289bceaf35305f", - "sha256:df57bdbeffe694e7842092c5e2e0bc80fff7f43379d465f932ef36f027179806", - "sha256:ed8fe9189d2beb6edc14d3ad19800626e1d9f2d975e436f84e19efb7fa19469b", - "sha256:f3ddf056d3ebcf6ce47bdaf56142af51bb7fad09e4af310241e9db7a3a8022e1", - "sha256:f8fe4984b431f8621ca53d9380901f62bfb54ff759a1348cd140490ada7b693c", - "sha256:fe439416eb6380de434886b00c859304338f8b19f6f54811984f3420a2e03858" + "sha256:093896e530c38c8e9c996901858ac63f3d4171268db2c9c8b373a228f459bbc5", + "sha256:09b9f848b28081e7b975a3626e9081574a7b9196cde26604540582da60235fdf", + "sha256:0b0c69f4f724c64dfbfe79f5dfb503b42fe6127b8d479b2677f2b227478db2eb", + "sha256:13618bed0c38acc418896005732e565b317aa9e98d855a0e9f211a7ffc2d6638", + "sha256:13690e923a3932e4fad4c0ebfb9cb5988e03d9dcb4c5150b5fcbf58fd8bddfc4", + "sha256:177f01eeaa3aee4a5ffb0d1439c5952b53d5010f86e9d2667963e632e30082cc", + "sha256:193e3bffca48ad74b8c764fb4492dd875038a2f9925530cb094db92bb5e47bed", + "sha256:1defe91d41ce1bd44b40fabf071e6a01a5aa14de4a31b986aa9dfd1b3e3e414a", + "sha256:1f188a2402f8359cf0c4b1fe89eea40dc13b52e7b4fd4812450da9fcd210181d", + "sha256:202a2d645c5a46b84992f55b0a3affe4f0ba6b4c611abec32ee88358db4bb649", + "sha256:24eda3a24a38157eee639ca9afe45eefa8d2420d49468819ac5f88b10de84f4c", + "sha256:2e4e0f60cb4bd7396108823548e82fdab72d4d8a65e58e2c19bbbc2f1e2bfa4b", + "sha256:379c111d3558272a2cae3d8e57e6b6e6f4fe652905692d54bad5ea0ca37c5ad4", + "sha256:37cda8712145917105e07aab96388ae76e787270ec04bcb9d5cc786d7cbb8443", + "sha256:38c51297b35b3ed91670e1e4efb702b790002e3245a28c76e627478aa3c10d83", + "sha256:3985b9be361d8fb6b2d1adc9924d01dec575a1d7453a14cccd73225cb79243ee", + "sha256:3988665ee376abce49613701336544041f2117de7b7fbfe91b93d8ff8b151c8e", + "sha256:3ac47fa29d8d41059ea3df65bd3ade92f97ee4910ed638e87075b8e8ce69599e", + "sha256:3b4b4299dd0d2c67caaaf286d58aef5e75b125b95615dda4542561a5a566a1e3", + "sha256:3ea8bb1ab9558374c0ab591783808511d135a833c3ca64a18ec927f20c4030f0", + "sha256:3fe47da3e4fda5f1abb5709c156eca207eacf8007304ce3019eb001e7a7204cb", + "sha256:428ac484592f780e8cd7b6b14eb568f7c85460c92e2a37cb0c0e5186e1a0d076", + "sha256:44e6c85bbdc809383b509d732b06419fb4544dca29ebe18480379633623baafb", + "sha256:4674f0daa1823c295845b6a740d98a840d7a1c11df00d1fd62614545c1583787", + "sha256:4be32da0c3827ac9132bb488d331cb32e8d9638dd41a0557c5569d57cf22c9c1", + "sha256:4db3ed6a907b555e57cc2e6f14dc3a4c2458cdad8919e40b5357ab9b6db6c43e", + "sha256:5c52a036535d12590c32c49209e79cabaad9f9ad8aa4cbd875b68c4d67a9cbce", + "sha256:629a1ba2115dce8bf75a5cce9f2486ae483cb89c0145795603d6554bdc83e801", + "sha256:62a66ff235e4c2e37ed3b6104d8b478d767ff73838d1222132a7a026aa548764", + "sha256:63068a11171e4276f6ece913bde059e77c713b48c3a848814a6537f35afb8365", + "sha256:63c19702db10ad79151a059d2d6336fe0c470f2e18d0d4d1a57f7f9713875dcf", + "sha256:644ec81edec0f4ad17d51c838a7d01e42811054543b76d4ba2c5d6af741ce2a6", + "sha256:6535d996f6537ecb298b4e287a855f37deaf64ff007162ec0afb9ab8ba3b8b71", + "sha256:6f4548c5ead23ad13fb7a2c8ea541357474ec13c2b736feb02e19a3085fac002", + "sha256:716a78a342679cd1177bc8c2fe957e0ab91405bd43a17094324845200b2fddf4", + "sha256:74610105ebd6f33d7c10f8907afed696e79c59e3043c5f20eaa3a46fddf33b4c", + "sha256:768939f7c4353c0fac2f7c37897e10b1414b571fd85dd9fc49e6a87e37a2e0d8", + "sha256:86cffe9c6dfcfe22e28027069725c7f57f4b868a3f86e81d1c62462764dc46d4", + "sha256:8aae5aea53cbfe024919715eca696b1a3201886ce83790537d1c3668459c7146", + "sha256:8b2b8503edb06822c86d82fa64a4a5cb0760bb8f31f26e138ec743f422f37cfc", + "sha256:912e95017ff51dc3d7b6e2be158dedc889d9a5cc3382445589ce554f1a34c0ea", + "sha256:9a7b8ac36fd688c8361cbc7bf1cb5866977ece6e0b17c34aa0df58bda4fa18a4", + "sha256:9e89d5c8509fbd6c03d0dd1972925b22f50db0792ce06324ba069f10787429ad", + "sha256:ae270e79f7e169ccfe23284ff5ea2d52a6f401dc01b337efb54b3783e2ce3f28", + "sha256:b07c25d52b1c16ce5de088046cd2432b30f9ad5e224ff17c8f496d9cb7d1d451", + "sha256:b39e6011cd06822eb964d038d5dff5da5d98652b81f5ecd439277b32361a3a50", + "sha256:bd55f8fc8fa494958772a2a7302b0354ab16e0b9272b3c3d83cdb5bec5bd1779", + "sha256:c15b32a7aca8038ed7644f854bf17b663bc38e1671b5d6f43f9a2b2bd0c46f63", + "sha256:c1b4474beee02ede1eef86c25ad4600a424fe36cff01a6103cb4533c6bf0169e", + "sha256:c79c0685f142ca53256722a384540832420dff4ab15fec1863d7e5bc8691bdcc", + "sha256:c9ebfb2507751f7196995142f057d1324afdab56db1d9743aab7f50289abd022", + "sha256:d7ad66e8e50225ebf4236368cc43c37f59d5e6728f15f6e258c8639fa0dd8e6d", + "sha256:d82ab6816c3277dc962cfcdc85b1efa0e5f50fb2c449432deaf2398a2928ab94", + "sha256:d9fd2547e6decdbf985d579cf3fc78e4c1d662b9b0ff7cc7862baaab71c9cc5b", + "sha256:de38add67a0af869b0d79c525d3e4588ac1ffa92f39116dbe0ed9753f26eba7d", + "sha256:e19122296822deafce89a0c5e8685704c067ae65d45e79718c92df7b3ec3d331", + "sha256:e44961e36cb13c495806d4cac67640ac2866cb99044e210895b506c26ee63d3a", + "sha256:e4c81ed2820b9023a9a90717020315e63b17b18c274a332e3b6437d7ff70abe0", + "sha256:e683e6ecc587643f8cde8f5da6768e9d165cd31edf39ee90ed7034f9ca0eefee", + "sha256:f39e2f3530ed1626c66e7493be7a8423b023ca852aacdc91fb30162c350d2a92", + "sha256:f56f49b2553d7dd85fd86e029515a221e5c1f8cb3d9c38b470bc38bde7b8445a", + "sha256:fb9fc32399dca861584d96eccd6c980b69bbcd7c228d06fb74fe53e007aa8ef9" ], "markers": "python_version >= '3.9'", - "version": "==7.6.4" + "version": "==7.6.8" + }, + "cryptography": { + "hashes": [ + "sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362", + "sha256:0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4", + "sha256:1ec0bcf7e17c0c5669d881b1cd38c4972fade441b27bda1051665faaa89bdcaa", + "sha256:281c945d0e28c92ca5e5930664c1cefd85efe80e5c0d2bc58dd63383fda29f83", + "sha256:2ce6fae5bdad59577b44e4dfed356944fbf1d925269114c28be377692643b4ff", + "sha256:315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805", + "sha256:443c4a81bb10daed9a8f334365fe52542771f25aedaf889fd323a853ce7377d6", + "sha256:4a02ded6cd4f0a5562a8887df8b3bd14e822a90f97ac5e544c162899bc467664", + "sha256:53a583b6637ab4c4e3591a15bc9db855b8d9dee9a669b550f311480acab6eb08", + "sha256:63efa177ff54aec6e1c0aefaa1a241232dcd37413835a9b674b6e3f0ae2bfd3e", + "sha256:74f57f24754fe349223792466a709f8e0c093205ff0dca557af51072ff47ab18", + "sha256:7e1ce50266f4f70bf41a2c6dc4358afadae90e2a1e5342d3c08883df1675374f", + "sha256:81ef806b1fef6b06dcebad789f988d3b37ccaee225695cf3e07648eee0fc6b73", + "sha256:846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5", + "sha256:8ac43ae87929a5982f5948ceda07001ee5e83227fd69cf55b109144938d96984", + "sha256:9762ea51a8fc2a88b70cf2995e5675b38d93bf36bd67d91721c309df184f49bd", + "sha256:a2a431ee15799d6db9fe80c82b055bae5a752bef645bba795e8e52687c69efe3", + "sha256:bf7a1932ac4176486eab36a19ed4c0492da5d97123f1406cf15e41b05e787d2e", + "sha256:c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405", + "sha256:cbeb489927bd7af4aa98d4b261af9a5bc025bd87f0e3547e11584be9e9427be2", + "sha256:d03b5621a135bffecad2c73e9f4deb1a0f977b9a8ffe6f8e002bf6c9d07b918c", + "sha256:d56e96520b1020449bbace2b78b603442e7e378a9b3bd68de65c782db1507995", + "sha256:df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73", + "sha256:e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16", + "sha256:f18c716be16bc1fea8e95def49edf46b82fccaa88587a45f8dc0ff6ab5d8e0a7", + "sha256:f46304d6f0c6ab8e52770addfa2fc41e6629495548862279641972b6215451cd", + "sha256:f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7" + ], + "markers": "python_version >= '3.7'", + "version": "==43.0.3" }, "docutils": { "hashes": [ @@ -437,6 +547,7 @@ "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc" ], "index": "pypi", + "markers": "python_version >= '3.7'", "version": "==1.2.2" }, "idna": { @@ -487,6 +598,14 @@ "markers": "python_version >= '3.8'", "version": "==4.1.0" }, + "jeepney": { + "hashes": [ + "sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806", + "sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755" + ], + "markers": "python_version >= '3.7'", + "version": "==0.8.0" + }, "keyring": { "hashes": [ "sha256:4c753b3ec91717fe713c4edd522d625889d8973a349b0e582622f49766de58e6", @@ -640,11 +759,11 @@ }, "packaging": { "hashes": [ - "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002", - "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124" + "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759", + "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f" ], "markers": "python_version >= '3.8'", - "version": "==24.1" + "version": "==24.2" }, "pkginfo": { "hashes": [ @@ -766,6 +885,14 @@ "markers": "python_version >= '3.8'", "version": "==0.2.0" }, + "pycparser": { + "hashes": [ + "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6", + "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc" + ], + "markers": "python_version >= '3.8'", + "version": "==2.22" + }, "pygments": { "hashes": [ "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199", @@ -796,6 +923,7 @@ "sha256:fde0b595ca248bb8e2d76f020b465f3b107c9632e6a1d1705f17834c89dcadc0" ], "index": "pypi", + "markers": "python_version >= '3.9'", "version": "==6.0.0" }, "pyyaml": { @@ -867,11 +995,12 @@ }, "requests": { "hashes": [ - "sha256:e8f3c9be120d3333921d213eef078af392fba3933ab7ed2d1cba3b56f2568c3b", - "sha256:f2e34a75f4749019bb0e3effb66683630e4ffeaf75819fb51bebef1bf5aef059" + "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", + "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" ], "index": "pypi", - "version": "==2.29.0" + "markers": "python_version >= '3.8'", + "version": "==2.32.3" }, "requests-toolbelt": { "hashes": [ @@ -891,19 +1020,53 @@ }, "rich": { "hashes": [ - "sha256:9836f5096eb2172c9e77df411c1b009bace4193d6a481d534fea75ebba758283", - "sha256:bc1e01b899537598cf02579d2b9f4a415104d3fc439313a7a2c165d76557a08e" + "sha256:439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098", + "sha256:6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90" ], "markers": "python_full_version >= '3.8.0'", - "version": "==13.9.3" + "version": "==13.9.4" + }, + "ruff": { + "hashes": [ + "sha256:0e55cce9aa93c5d0d4e3937e47b169035c7e91c8655b0974e61bb79cf398d49c", + "sha256:295bb4c02d58ff2ef4378a1870c20af30723013f441c9d1637a008baaf928c8b", + "sha256:2dabfd05b96b7b8f2da00d53c514eea842bff83e41e1cceb08ae1966254a51df", + "sha256:3f4cd64916d8e732ce6b87f3f5296a8942d285bbbc161acee7fe561134af64f9", + "sha256:582891c57b96228d146725975fbb942e1f30a0c4ba19722e692ca3eb25cc9b4f", + "sha256:5fdb6efecc3eb60bba5819679466471fd7d13c53487df7248d6e27146e985468", + "sha256:780d5d8523c04202184405e60c98d7595bdb498c3c6abba3b6d4cdf2ca2af426", + "sha256:7b1f1c76b47c18fa92ee78b60d2d20d7e866c55ee603e7d19c1e991fad933a9a", + "sha256:812e2052121634cf13cd6fddf0c1871d0ead1aad40a1a258753c04c18bb71bbd", + "sha256:83a55679c4cb449fa527b8497cadf54f076603cc36779b2170b24f704171ce70", + "sha256:85e654f0ded7befe2d61eeaf3d3b1e4ef3894469cd664ffa85006c7720f1e4a2", + "sha256:87a8e86bae0dbd749c815211ca11e3a7bd559b9710746c559ed63106d382bd9c", + "sha256:a7ccfe6331bf8c8dad715753e157457faf7351c2b69f62f32c165c2dbcbacd44", + "sha256:ba93e6294e9a737cd726b74b09a6972e36bb511f9a102f1d9a7e1ce94dd206a6", + "sha256:c5c1466be2a2ebdf7c5450dd5d980cc87c8ba6976fb82582fea18823da6fa362", + "sha256:eb0d4f250a7711b67ad513fde67e8870109e5ce590a801c3722580fe98c33a99", + "sha256:facebdfe5a5af6b1588a1d26d170635ead6892d0e314477e80256ef4a8470cf3", + "sha256:fcb1bf2cc6706adae9d79c8d86478677e3bbd4ced796ccad106fd4776d395fea" + ], + "index": "pypi", + "markers": "python_version >= '3.7'", + "version": "==0.8.0" + }, + "secretstorage": { + "hashes": [ + "sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77", + "sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99" + ], + "markers": "python_version >= '3.6'", + "version": "==3.3.3" }, "tomli": { "hashes": [ - "sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38", - "sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed" + "sha256:3f646cae2aec94e17d04973e4249548320197cfabdf130015d023de4b74d8ab8", + "sha256:a5c57c3d1c56f5ccdf89f6523458f60ef716e210fc47c4cfb188c5ba473e0391" ], "index": "pypi", - "version": "==2.0.2" + "markers": "python_version >= '3.8'", + "version": "==2.1.0" }, "twine": { "hashes": [ @@ -911,6 +1074,7 @@ "sha256:9aa0825139c02b3434d913545c7b847a21c835e11597f5255842d457da2322db" ], "index": "pypi", + "markers": "python_version >= '3.8'", "version": "==5.1.1" }, "urllib3": { @@ -918,6 +1082,7 @@ "sha256:0ed14ccfbf1c30a9072c7ca157e4319b70d65f623e91e7b32fadb2853431016e", "sha256:40c2dc0c681e47eb8f90e7e27bf6ff7df2e677421fd46756da1161c39ca70d32" ], + "index": "pypi", "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", "version": "==1.26.20" }, @@ -927,179 +1092,175 @@ "sha256:88e13d9111846745898411dbc74a75ce85870af96dd320d75f1ee33158addc09" ], "index": "pypi", + "markers": "python_version >= '3.8'", "version": "==6.0.2" }, "wrapt": { "hashes": [ - "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc", - "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81", - "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09", - "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e", - "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca", - "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0", - "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb", - "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487", - "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40", - "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c", - "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060", - "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202", - "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41", - "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9", - "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b", - "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664", - "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d", - "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362", - "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00", - "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc", - "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1", - "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267", - "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956", - "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966", - "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1", - "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228", - "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72", - "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d", - "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292", - "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0", - "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0", - "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36", - "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c", - "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5", - "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f", - "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73", - "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b", - "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2", - "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593", - "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39", - "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389", - "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf", - "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf", - "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89", - "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c", - "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c", - "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f", - "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440", - "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465", - "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136", - "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b", - "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8", - "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3", - "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8", - "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6", - "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e", - "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f", - "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c", - "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e", - "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8", - "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2", - "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020", - "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35", - "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d", - "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3", - "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537", - "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809", - "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d", - "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a", - "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4" + "sha256:0229b247b0fc7dee0d36176cbb79dbaf2a9eb7ecc50ec3121f40ef443155fb1d", + "sha256:0698d3a86f68abc894d537887b9bbf84d29bcfbc759e23f4644be27acf6da301", + "sha256:0a0a1a1ec28b641f2a3a2c35cbe86c00051c04fffcfcc577ffcdd707df3f8635", + "sha256:0b48554952f0f387984da81ccfa73b62e52817a4386d070c75e4db7d43a28c4a", + "sha256:0f2a28eb35cf99d5f5bd12f5dd44a0f41d206db226535b37b0c60e9da162c3ed", + "sha256:140ea00c87fafc42739bd74a94a5a9003f8e72c27c47cd4f61d8e05e6dec8721", + "sha256:16187aa2317c731170a88ef35e8937ae0f533c402872c1ee5e6d079fcf320801", + "sha256:17fcf043d0b4724858f25b8826c36e08f9fb2e475410bece0ec44a22d533da9b", + "sha256:18b956061b8db634120b58f668592a772e87e2e78bc1f6a906cfcaa0cc7991c1", + "sha256:2399408ac33ffd5b200480ee858baa58d77dd30e0dd0cab6a8a9547135f30a88", + "sha256:2a0c23b8319848426f305f9cb0c98a6e32ee68a36264f45948ccf8e7d2b941f8", + "sha256:2dfb7cff84e72e7bf975b06b4989477873dcf160b2fd89959c629535df53d4e0", + "sha256:2f495b6754358979379f84534f8dd7a43ff8cff2558dcdea4a148a6e713a758f", + "sha256:33539c6f5b96cf0b1105a0ff4cf5db9332e773bb521cc804a90e58dc49b10578", + "sha256:3c34f6896a01b84bab196f7119770fd8466c8ae3dfa73c59c0bb281e7b588ce7", + "sha256:498fec8da10e3e62edd1e7368f4b24aa362ac0ad931e678332d1b209aec93045", + "sha256:4d63f4d446e10ad19ed01188d6c1e1bb134cde8c18b0aa2acfd973d41fcc5ada", + "sha256:4e4b4385363de9052dac1a67bfb535c376f3d19c238b5f36bddc95efae15e12d", + "sha256:4e547b447073fc0dbfcbff15154c1be8823d10dab4ad401bdb1575e3fdedff1b", + "sha256:4f643df3d4419ea3f856c5c3f40fec1d65ea2e89ec812c83f7767c8730f9827a", + "sha256:4f763a29ee6a20c529496a20a7bcb16a73de27f5da6a843249c7047daf135977", + "sha256:5ae271862b2142f4bc687bdbfcc942e2473a89999a54231aa1c2c676e28f29ea", + "sha256:5d8fd17635b262448ab8f99230fe4dac991af1dabdbb92f7a70a6afac8a7e346", + "sha256:69c40d4655e078ede067a7095544bcec5a963566e17503e75a3a3e0fe2803b13", + "sha256:69d093792dc34a9c4c8a70e4973a3361c7a7578e9cd86961b2bbf38ca71e4e22", + "sha256:6a9653131bda68a1f029c52157fd81e11f07d485df55410401f745007bd6d339", + "sha256:6ff02a91c4fc9b6a94e1c9c20f62ea06a7e375f42fe57587f004d1078ac86ca9", + "sha256:714c12485aa52efbc0fc0ade1e9ab3a70343db82627f90f2ecbc898fdf0bb181", + "sha256:7264cbb4a18dc4acfd73b63e4bcfec9c9802614572025bdd44d0721983fc1d9c", + "sha256:73a96fd11d2b2e77d623a7f26e004cc31f131a365add1ce1ce9a19e55a1eef90", + "sha256:74bf625b1b4caaa7bad51d9003f8b07a468a704e0644a700e936c357c17dd45a", + "sha256:81b1289e99cf4bad07c23393ab447e5e96db0ab50974a280f7954b071d41b489", + "sha256:8425cfce27b8b20c9b89d77fb50e368d8306a90bf2b6eef2cdf5cd5083adf83f", + "sha256:875d240fdbdbe9e11f9831901fb8719da0bd4e6131f83aa9f69b96d18fae7504", + "sha256:879591c2b5ab0a7184258274c42a126b74a2c3d5a329df16d69f9cee07bba6ea", + "sha256:89fc28495896097622c3fc238915c79365dd0ede02f9a82ce436b13bd0ab7569", + "sha256:8a5e7cc39a45fc430af1aefc4d77ee6bad72c5bcdb1322cfde852c15192b8bd4", + "sha256:8f8909cdb9f1b237786c09a810e24ee5e15ef17019f7cecb207ce205b9b5fcce", + "sha256:914f66f3b6fc7b915d46c1cc424bc2441841083de01b90f9e81109c9759e43ab", + "sha256:92a3d214d5e53cb1db8b015f30d544bc9d3f7179a05feb8f16df713cecc2620a", + "sha256:948a9bd0fb2c5120457b07e59c8d7210cbc8703243225dbd78f4dfc13c8d2d1f", + "sha256:9c900108df470060174108012de06d45f514aa4ec21a191e7ab42988ff42a86c", + "sha256:9f2939cd4a2a52ca32bc0b359015718472d7f6de870760342e7ba295be9ebaf9", + "sha256:a4192b45dff127c7d69b3bdfb4d3e47b64179a0b9900b6351859f3001397dabf", + "sha256:a8fc931382e56627ec4acb01e09ce66e5c03c384ca52606111cee50d931a342d", + "sha256:ad47b095f0bdc5585bced35bd088cbfe4177236c7df9984b3cc46b391cc60627", + "sha256:b1ca5f060e205f72bec57faae5bd817a1560fcfc4af03f414b08fa29106b7e2d", + "sha256:ba1739fb38441a27a676f4de4123d3e858e494fac05868b7a281c0a383c098f4", + "sha256:baa7ef4e0886a6f482e00d1d5bcd37c201b383f1d314643dfb0367169f94f04c", + "sha256:bb90765dd91aed05b53cd7a87bd7f5c188fcd95960914bae0d32c5e7f899719d", + "sha256:bc7f729a72b16ee21795a943f85c6244971724819819a41ddbaeb691b2dd85ad", + "sha256:bdf62d25234290db1837875d4dceb2151e4ea7f9fff2ed41c0fde23ed542eb5b", + "sha256:c30970bdee1cad6a8da2044febd824ef6dc4cc0b19e39af3085c763fdec7de33", + "sha256:d2c63b93548eda58abf5188e505ffed0229bf675f7c3090f8e36ad55b8cbc371", + "sha256:d751300b94e35b6016d4b1e7d0e7bbc3b5e1751e2405ef908316c2a9024008a1", + "sha256:da427d311782324a376cacb47c1a4adc43f99fd9d996ffc1b3e8529c4074d393", + "sha256:daba396199399ccabafbfc509037ac635a6bc18510ad1add8fd16d4739cdd106", + "sha256:e185ec6060e301a7e5f8461c86fb3640a7beb1a0f0208ffde7a65ec4074931df", + "sha256:e4a557d97f12813dc5e18dad9fa765ae44ddd56a672bb5de4825527c847d6379", + "sha256:e5ed16d95fd142e9c72b6c10b06514ad30e846a0d0917ab406186541fe68b451", + "sha256:e711fc1acc7468463bc084d1b68561e40d1eaa135d8c509a65dd534403d83d7b", + "sha256:f28b29dc158ca5d6ac396c8e0a2ef45c4e97bb7e65522bfc04c989e6fe814575", + "sha256:f335579a1b485c834849e9075191c9898e0731af45705c2ebf70e0cd5d58beed", + "sha256:fce6fee67c318fdfb7f285c29a82d84782ae2579c0e1b385b7f36c6e8074fffb", + "sha256:fd136bb85f4568fffca995bd3c8d52080b1e5b225dbf1c2b17b66b4c5fa02838" ], - "markers": "python_version >= '3.6'", - "version": "==1.16.0" + "markers": "python_version >= '3.8'", + "version": "==1.17.0" }, "yarl": { "hashes": [ - "sha256:06157fb3c58f2736a5e47c8fcbe1afc8b5de6fb28b14d25574af9e62150fcaac", - "sha256:067a63fcfda82da6b198fa73079b1ca40b7c9b7994995b6ee38acda728b64d47", - "sha256:0b1794853124e2f663f0ea54efb0340b457f08d40a1cef78edfa086576179c91", - "sha256:0bdff5e0995522706c53078f531fb586f56de9c4c81c243865dd5c66c132c3b5", - "sha256:117ed8b3732528a1e41af3aa6d4e08483c2f0f2e3d3d7dca7cf538b3516d93df", - "sha256:14bc88baa44e1f84164a392827b5defb4fa8e56b93fecac3d15315e7c8e5d8b3", - "sha256:1654ec814b18be1af2c857aa9000de7a601400bd4c9ca24629b18486c2e35463", - "sha256:16bca6678a83657dd48df84b51bd56a6c6bd401853aef6d09dc2506a78484c7b", - "sha256:1a3b91c44efa29e6c8ef8a9a2b583347998e2ba52c5d8280dbd5919c02dfc3b5", - "sha256:1a52a1ffdd824fb1835272e125385c32fd8b17fbdefeedcb4d543cc23b332d74", - "sha256:1ce36ded585f45b1e9bb36d0ae94765c6608b43bd2e7f5f88079f7a85c61a4d3", - "sha256:299f11b44d8d3a588234adbe01112126010bd96d9139c3ba7b3badd9829261c3", - "sha256:2b24ec55fad43e476905eceaf14f41f6478780b870eda5d08b4d6de9a60b65b4", - "sha256:2d374d70fdc36f5863b84e54775452f68639bc862918602d028f89310a034ab0", - "sha256:2d9f0606baaec5dd54cb99667fcf85183a7477f3766fbddbe3f385e7fc253299", - "sha256:2e7ba4c9377e48fb7b20dedbd473cbcbc13e72e1826917c185157a137dac9df2", - "sha256:2f0a6423295a0d282d00e8701fe763eeefba8037e984ad5de44aa349002562ac", - "sha256:327828786da2006085a4d1feb2594de6f6d26f8af48b81eb1ae950c788d97f61", - "sha256:380e6c38ef692b8fd5a0f6d1fa8774d81ebc08cfbd624b1bca62a4d4af2f9931", - "sha256:3b74ff4767d3ef47ffe0cd1d89379dc4d828d4873e5528976ced3b44fe5b0a21", - "sha256:3e844be8d536afa129366d9af76ed7cb8dfefec99f5f1c9e4f8ae542279a6dc3", - "sha256:459e81c2fb920b5f5df744262d1498ec2c8081acdcfe18181da44c50f51312f7", - "sha256:46ddf6e0b975cd680eb83318aa1d321cb2bf8d288d50f1754526230fcf59ba96", - "sha256:482c122b72e3c5ec98f11457aeb436ae4aecca75de19b3d1de7cf88bc40db82f", - "sha256:561c87fea99545ef7d692403c110b2f99dced6dff93056d6e04384ad3bc46243", - "sha256:578d00c9b7fccfa1745a44f4eddfdc99d723d157dad26764538fbdda37209857", - "sha256:58c8e9620eb82a189c6c40cb6b59b4e35b2ee68b1f2afa6597732a2b467d7e8f", - "sha256:5b29beab10211a746f9846baa39275e80034e065460d99eb51e45c9a9495bcca", - "sha256:5d1d42556b063d579cae59e37a38c61f4402b47d70c29f0ef15cee1acaa64488", - "sha256:5f236cb5999ccd23a0ab1bd219cfe0ee3e1c1b65aaf6dd3320e972f7ec3a39da", - "sha256:62a91aefff3d11bf60e5956d340eb507a983a7ec802b19072bb989ce120cd948", - "sha256:64cc6e97f14cf8a275d79c5002281f3040c12e2e4220623b5759ea7f9868d6a5", - "sha256:6f4c9156c4d1eb490fe374fb294deeb7bc7eaccda50e23775b2354b6a6739934", - "sha256:7294e38f9aa2e9f05f765b28ffdc5d81378508ce6dadbe93f6d464a8c9594473", - "sha256:7615058aabad54416ddac99ade09a5510cf77039a3b903e94e8922f25ed203d7", - "sha256:7e48cdb8226644e2fbd0bdb0a0f87906a3db07087f4de77a1b1b1ccfd9e93685", - "sha256:7f63d176a81555984e91f2c84c2a574a61cab7111cc907e176f0f01538e9ff6e", - "sha256:7f6595c852ca544aaeeb32d357e62c9c780eac69dcd34e40cae7b55bc4fb1147", - "sha256:7fac95714b09da9278a0b52e492466f773cfe37651cf467a83a1b659be24bf71", - "sha256:81713b70bea5c1386dc2f32a8f0dab4148a2928c7495c808c541ee0aae614d67", - "sha256:846dd2e1243407133d3195d2d7e4ceefcaa5f5bf7278f0a9bda00967e6326b04", - "sha256:84c063af19ef5130084db70ada40ce63a84f6c1ef4d3dbc34e5e8c4febb20822", - "sha256:881764d610e3269964fc4bb3c19bb6fce55422828e152b885609ec176b41cf11", - "sha256:8994b29c462de9a8fce2d591028b986dbbe1b32f3ad600b2d3e1c482c93abad6", - "sha256:8c79e9d7e3d8a32d4824250a9c6401194fb4c2ad9a0cec8f6a96e09a582c2cc0", - "sha256:8ee427208c675f1b6e344a1f89376a9613fc30b52646a04ac0c1f6587c7e46ec", - "sha256:949681f68e0e3c25377462be4b658500e85ca24323d9619fdc41f68d46a1ffda", - "sha256:9e275792097c9f7e80741c36de3b61917aebecc08a67ae62899b074566ff8556", - "sha256:9fb815155aac6bfa8d86184079652c9715c812d506b22cfa369196ef4e99d1b4", - "sha256:a2a64e62c7a0edd07c1c917b0586655f3362d2c2d37d474db1a509efb96fea1c", - "sha256:a7ac5b4984c468ce4f4a553df281450df0a34aefae02e58d77a0847be8d1e11f", - "sha256:aa46dce75078fceaf7cecac5817422febb4355fbdda440db55206e3bd288cfb8", - "sha256:ae3476e934b9d714aa8000d2e4c01eb2590eee10b9d8cd03e7983ad65dfbfcba", - "sha256:b0341e6d9a0c0e3cdc65857ef518bb05b410dbd70d749a0d33ac0f39e81a4258", - "sha256:b40d1bf6e6f74f7c0a567a9e5e778bbd4699d1d3d2c0fe46f4b717eef9e96b95", - "sha256:b5c4804e4039f487e942c13381e6c27b4b4e66066d94ef1fae3f6ba8b953f383", - "sha256:b5d6a6c9602fd4598fa07e0389e19fe199ae96449008d8304bf5d47cb745462e", - "sha256:b5f1ac7359e17efe0b6e5fec21de34145caef22b260e978336f325d5c84e6938", - "sha256:c0167540094838ee9093ef6cc2c69d0074bbf84a432b4995835e8e5a0d984374", - "sha256:c180ac742a083e109c1a18151f4dd8675f32679985a1c750d2ff806796165b55", - "sha256:c73df5b6e8fabe2ddb74876fb82d9dd44cbace0ca12e8861ce9155ad3c886139", - "sha256:c7e177c619342e407415d4f35dec63d2d134d951e24b5166afcdfd1362828e17", - "sha256:cbad927ea8ed814622305d842c93412cb47bd39a496ed0f96bfd42b922b4a217", - "sha256:cc353841428d56b683a123a813e6a686e07026d6b1c5757970a877195f880c2d", - "sha256:cc7c92c1baa629cb03ecb0c3d12564f172218fb1739f54bf5f3881844daadc6d", - "sha256:cc7d768260f4ba4ea01741c1b5fe3d3a6c70eb91c87f4c8761bbcce5181beafe", - "sha256:d0eea830b591dbc68e030c86a9569826145df485b2b4554874b07fea1275a199", - "sha256:d216e5d9b8749563c7f2c6f7a0831057ec844c68b4c11cb10fc62d4fd373c26d", - "sha256:d401f07261dc5aa36c2e4efc308548f6ae943bfff20fcadb0a07517a26b196d8", - "sha256:d6324274b4e0e2fa1b3eccb25997b1c9ed134ff61d296448ab8269f5ac068c4c", - "sha256:d8a8b74d843c2638f3864a17d97a4acda58e40d3e44b6303b8cc3d3c44ae2d29", - "sha256:d9b6b28a57feb51605d6ae5e61a9044a31742db557a3b851a74c13bc61de5172", - "sha256:de599af166970d6a61accde358ec9ded821234cbbc8c6413acfec06056b8e860", - "sha256:e594b22688d5747b06e957f1ef822060cb5cb35b493066e33ceac0cf882188b7", - "sha256:e5b078134f48552c4d9527db2f7da0b5359abd49393cdf9794017baec7506170", - "sha256:eb6dce402734575e1a8cc0bb1509afca508a400a57ce13d306ea2c663bad1138", - "sha256:f1790a4b1e8e8e028c391175433b9c8122c39b46e1663228158e61e6f915bf06", - "sha256:f5efe0661b9fcd6246f27957f6ae1c0eb29bc60552820f01e970b4996e016004", - "sha256:f9cbfbc5faca235fbdf531b93aa0f9f005ec7d267d9d738761a4d42b744ea159", - "sha256:fbea1751729afe607d84acfd01efd95e3b31db148a181a441984ce9b3d3469da", - "sha256:fca4b4307ebe9c3ec77a084da3a9d1999d164693d16492ca2b64594340999988", - "sha256:ff5c6771c7e3511a06555afa317879b7db8d640137ba55d6ab0d0c50425cab75" + "sha256:01be8688fc211dc237e628fcc209dda412d35de7642453059a0553747018d075", + "sha256:039c299a0864d1f43c3e31570045635034ea7021db41bf4842693a72aca8df3a", + "sha256:074fee89caab89a97e18ef5f29060ef61ba3cae6cd77673acc54bfdd3214b7b7", + "sha256:13aaf2bdbc8c86ddce48626b15f4987f22e80d898818d735b20bd58f17292ee8", + "sha256:14408cc4d34e202caba7b5ac9cc84700e3421a9e2d1b157d744d101b061a4a88", + "sha256:1db1537e9cb846eb0ff206eac667f627794be8b71368c1ab3207ec7b6f8c5afc", + "sha256:1ece25e2251c28bab737bdf0519c88189b3dd9492dc086a1d77336d940c28ced", + "sha256:1ff116f0285b5c8b3b9a2680aeca29a858b3b9e0402fc79fd850b32c2bcb9f8b", + "sha256:205de377bd23365cd85562c9c6c33844050a93661640fda38e0567d2826b50df", + "sha256:20d95535e7d833889982bfe7cc321b7f63bf8879788fee982c76ae2b24cfb715", + "sha256:20de4a8b04de70c49698dc2390b7fd2d18d424d3b876371f9b775e2b462d4b41", + "sha256:2d90f2e4d16a5b0915ee065218b435d2ef619dd228973b1b47d262a6f7cd8fa5", + "sha256:2e6b4466714a73f5251d84b471475850954f1fa6acce4d3f404da1d55d644c34", + "sha256:309f8d27d6f93ceeeb80aa6980e883aa57895270f7f41842b92247e65d7aeddf", + "sha256:32141e13a1d5a48525e519c9197d3f4d9744d818d5c7d6547524cc9eccc8971e", + "sha256:34176bfb082add67cb2a20abd85854165540891147f88b687a5ed0dc225750a0", + "sha256:38b39b7b3e692b6c92b986b00137a3891eddb66311b229d1940dcbd4f025083c", + "sha256:3a3709450a574d61be6ac53d582496014342ea34876af8dc17cc16da32826c9a", + "sha256:3adaaf9c6b1b4fc258584f4443f24d775a2086aee82d1387e48a8b4f3d6aecf6", + "sha256:3f576ed278860df2721a5d57da3381040176ef1d07def9688a385c8330db61a1", + "sha256:42ba84e2ac26a3f252715f8ec17e6fdc0cbf95b9617c5367579fafcd7fba50eb", + "sha256:454902dc1830d935c90b5b53c863ba2a98dcde0fbaa31ca2ed1ad33b2a7171c6", + "sha256:466d31fd043ef9af822ee3f1df8fdff4e8c199a7f4012c2642006af240eade17", + "sha256:49a98ecadc5a241c9ba06de08127ee4796e1009555efd791bac514207862b43d", + "sha256:4d26f1fa9fa2167bb238f6f4b20218eb4e88dd3ef21bb8f97439fa6b5313e30d", + "sha256:52c136f348605974c9b1c878addd6b7a60e3bf2245833e370862009b86fa4689", + "sha256:536a7a8a53b75b2e98ff96edb2dfb91a26b81c4fed82782035767db5a465be46", + "sha256:576d258b21c1db4c6449b1c572c75d03f16a482eb380be8003682bdbe7db2f28", + "sha256:609ffd44fed2ed88d9b4ef62ee860cf86446cf066333ad4ce4123505b819e581", + "sha256:67b336c15e564d76869c9a21316f90edf546809a5796a083b8f57c845056bc01", + "sha256:685cc37f3f307c6a8e879986c6d85328f4c637f002e219f50e2ef66f7e062c1d", + "sha256:6a49ad0102c0f0ba839628d0bf45973c86ce7b590cdedf7540d5b1833ddc6f00", + "sha256:6fb64dd45453225f57d82c4764818d7a205ee31ce193e9f0086e493916bd4f72", + "sha256:701bb4a8f4de191c8c0cc9a1e6d5142f4df880e9d1210e333b829ca9425570ed", + "sha256:73553bbeea7d6ec88c08ad8027f4e992798f0abc459361bf06641c71972794dc", + "sha256:7520e799b1f84e095cce919bd6c23c9d49472deeef25fe1ef960b04cca51c3fc", + "sha256:7609b8462351c4836b3edce4201acb6dd46187b207c589b30a87ffd1813b48dc", + "sha256:7db9584235895a1dffca17e1c634b13870852094f6389b68dcc6338086aa7b08", + "sha256:7fa7d37f2ada0f42e0723632993ed422f2a679af0e200874d9d861720a54f53e", + "sha256:80741ec5b471fbdfb997821b2842c59660a1c930ceb42f8a84ba8ca0f25a66aa", + "sha256:8254dbfce84ee5d1e81051ee7a0f1536c108ba294c0fdb5933476398df0654f3", + "sha256:8b8d3e4e014fb4274f1c5bf61511d2199e263909fb0b8bda2a7428b0894e8dc6", + "sha256:8e1c18890091aa3cc8a77967943476b729dc2016f4cfe11e45d89b12519d4a93", + "sha256:9106025c7f261f9f5144f9aa7681d43867eed06349a7cfb297a1bc804de2f0d1", + "sha256:91b8fb9427e33f83ca2ba9501221ffaac1ecf0407f758c4d2f283c523da185ee", + "sha256:96404e8d5e1bbe36bdaa84ef89dc36f0e75939e060ca5cd45451aba01db02902", + "sha256:9b4c90c5363c6b0a54188122b61edb919c2cd1119684999d08cd5e538813a28e", + "sha256:a0509475d714df8f6d498935b3f307cd122c4ca76f7d426c7e1bb791bcd87eda", + "sha256:a173401d7821a2a81c7b47d4e7d5c4021375a1441af0c58611c1957445055056", + "sha256:a45d94075ac0647621eaaf693c8751813a3eccac455d423f473ffed38c8ac5c9", + "sha256:a5f72421246c21af6a92fbc8c13b6d4c5427dfd949049b937c3b731f2f9076bd", + "sha256:a64619a9c47c25582190af38e9eb382279ad42e1f06034f14d794670796016c0", + "sha256:a7ee6884a8848792d58b854946b685521f41d8871afa65e0d4a774954e9c9e89", + "sha256:ae38bd86eae3ba3d2ce5636cc9e23c80c9db2e9cb557e40b98153ed102b5a736", + "sha256:b026cf2c32daf48d90c0c4e406815c3f8f4cfe0c6dfccb094a9add1ff6a0e41a", + "sha256:b0a2074a37285570d54b55820687de3d2f2b9ecf1b714e482e48c9e7c0402038", + "sha256:b1a3297b9cad594e1ff0c040d2881d7d3a74124a3c73e00c3c71526a1234a9f7", + "sha256:b212452b80cae26cb767aa045b051740e464c5129b7bd739c58fbb7deb339e7b", + "sha256:b234a4a9248a9f000b7a5dfe84b8cb6210ee5120ae70eb72a4dcbdb4c528f72f", + "sha256:b4095c5019bb889aa866bf12ed4c85c0daea5aafcb7c20d1519f02a1e738f07f", + "sha256:b8e8c516dc4e1a51d86ac975b0350735007e554c962281c432eaa5822aa9765c", + "sha256:bd80ed29761490c622edde5dd70537ca8c992c2952eb62ed46984f8eff66d6e8", + "sha256:c083f6dd6951b86e484ebfc9c3524b49bcaa9c420cb4b2a78ef9f7a512bfcc85", + "sha256:c0f4808644baf0a434a3442df5e0bedf8d05208f0719cedcd499e168b23bfdc4", + "sha256:c4cb992d8090d5ae5f7afa6754d7211c578be0c45f54d3d94f7781c495d56716", + "sha256:c60e547c0a375c4bfcdd60eef82e7e0e8698bf84c239d715f5c1278a73050393", + "sha256:c73a6bbc97ba1b5a0c3c992ae93d721c395bdbb120492759b94cc1ac71bc6350", + "sha256:c893f8c1a6d48b25961e00922724732d00b39de8bb0b451307482dc87bddcd74", + "sha256:cd6ab7d6776c186f544f893b45ee0c883542b35e8a493db74665d2e594d3ca75", + "sha256:d89ae7de94631b60d468412c18290d358a9d805182373d804ec839978b120422", + "sha256:d9d4f5e471e8dc49b593a80766c2328257e405f943c56a3dc985c125732bc4cf", + "sha256:da206d1ec78438a563c5429ab808a2b23ad7bc025c8adbf08540dde202be37d5", + "sha256:dbf53db46f7cf176ee01d8d98c39381440776fcda13779d269a8ba664f69bec0", + "sha256:dd21c0128e301851de51bc607b0a6da50e82dc34e9601f4b508d08cc89ee7929", + "sha256:e2580c1d7e66e6d29d6e11855e3b1c6381971e0edd9a5066e6c14d79bc8967af", + "sha256:e3818eabaefb90adeb5e0f62f047310079d426387991106d4fbf3519eec7d90a", + "sha256:ed69af4fe2a0949b1ea1d012bf065c77b4c7822bad4737f17807af2adb15a73c", + "sha256:f172b8b2c72a13a06ea49225a9c47079549036ad1b34afa12d5491b881f5b993", + "sha256:f275ede6199d0f1ed4ea5d55a7b7573ccd40d97aee7808559e1298fe6efc8dbd", + "sha256:f7edeb1dcc7f50a2c8e08b9dc13a413903b7817e72273f00878cb70e766bdb3b", + "sha256:fa2c9cb607e0f660d48c54a63de7a9b36fef62f6b8bd50ff592ce1137e73ac7d", + "sha256:fe94d1de77c4cd8caff1bd5480e22342dbd54c93929f5943495d9c1e8abe9f42" ], "markers": "python_version >= '3.9'", - "version": "==1.17.1" + "version": "==1.18.0" }, "zipp": { "hashes": [ - "sha256:a817ac80d6cf4b23bf7f2828b7cabf326f15a001bea8b1f9b49631780ba28350", - "sha256:bc9eb26f4506fda01b81bcde0ca78103b6e62f991b381fec825435c836edbc29" + "sha256:2c9958f6430a2040341a52eb608ed6dd93ef4392e02ffe219417c1b28b5dd1f4", + "sha256:ac1bbe05fd2991f160ebce24ffbac5f6d11d83dc90891255885223d42b3cd931" ], - "markers": "python_version >= '3.8'", - "version": "==3.20.2" + "markers": "python_version >= '3.9'", + "version": "==3.21.0" } } } diff --git a/docs/examples/device_lifecycle_management.py b/docs/examples/device_lifecycle_management.py index d392e51..fa26967 100644 --- a/docs/examples/device_lifecycle_management.py +++ b/docs/examples/device_lifecycle_management.py @@ -5,7 +5,7 @@ # To operate the emnify SDK, you need to generate an application token. # Step-by-step guide: https://www.emnify.com/developer-blog/how-to-use-an-application-token-for-api-authentication -emnify = EMnify(app_token='YOUR_TOKEN') +emnify = EMnify(app_token="YOUR_TOKEN") # [endblock] @@ -14,7 +14,7 @@ unassigned_sims = [i for i in emnify.sim.get_sim_list(without_device=True)] # If there aren't any unassigned SIMs, register a new one via batch code: if not unassigned_sims: - registered_sim = emnify.sim.register_sim(bic='EXAMPLE_BIC_CODE') # Returns a list + registered_sim = emnify.sim.register_sim(bic="EXAMPLE_BIC_CODE") # Returns a list sim = emnify.sim.retrieve_sim(registered_sim[0].id) else: sim = unassigned_sims[0] # Takes the first unassigned SIM @@ -25,13 +25,13 @@ service_profile = emnify.devices.service_profile_model(id=1) tariff_profile = emnify.devices.tariff_profile_model(id=1) device_status = emnify.devices.status_model(id=0) -name = 'new_device' +name = "new_device" device_model = emnify.devices.device_create_model( tariff_profile=tariff_profile, status=device_status, service_profile=service_profile, sim=sim, - name=name + name=name, ) # After creating a model, the SDK returns the device ID. @@ -53,11 +53,13 @@ # Get device details device = emnify.devices.retrieve_device(device_id=device_id) -tags = 'arduino, meter, temp' # Example tags -name = 'new name' # Example name +tags = "arduino, meter, temp" # Example tags +name = "new name" # Example name # Adjust the device configuration -update_device_fields = emnify.devices.device_update_model(name='new name', tags='arduino') +update_device_fields = emnify.devices.device_update_model( + name="new name", tags="arduino" +) emnify.devices.update_device(device_id=device.id, device=update_device_fields) # Get updated device details @@ -73,9 +75,15 @@ # Add three operators to the blacklist: device_id = 0 # Your device ID -emnify.devices.add_device_blacklist_operator(operator_id=all_operators[0].id, device_id=device_id) -emnify.devices.add_device_blacklist_operator(operator_id=all_operators[1].id, device_id=device_id) -emnify.devices.add_device_blacklist_operator(operator_id=all_operators[2].id, device_id=device_id) +emnify.devices.add_device_blacklist_operator( + operator_id=all_operators[0].id, device_id=device_id +) +emnify.devices.add_device_blacklist_operator( + operator_id=all_operators[1].id, device_id=device_id +) +emnify.devices.add_device_blacklist_operator( + operator_id=all_operators[2].id, device_id=device_id +) # Get all blacklist operators of the device by device ID: device_blacklist = emnify.devices.get_device_operator_blacklist(device_id=device_id) @@ -88,16 +96,22 @@ operator_id = operator.id # Removes the last operator from the blacklist -emnify.devices.delete_device_blacklist_operator(device_id=device_id, operator_id=operator_id) +emnify.devices.delete_device_blacklist_operator( + device_id=device_id, operator_id=operator_id +) # [endblock] # === Example: Disable a device === # Get a list of all devices with SIM cards and the "Enabled" device status -device_filter = emnify.devices.get_device_filter_model(status=emnify_constants.DeviceStatuses.ENABLED_ID.value) +device_filter = emnify.devices.get_device_filter_model( + status=emnify_constants.DeviceStatuses.ENABLED_ID.value +) all_devices_with_sim = [ - device for device in emnify.devices.get_devices_list(filter_model=device_filter) if device.sim + device + for device in emnify.devices.get_devices_list(filter_model=device_filter) + if device.sim ] device = all_devices_with_sim[0] @@ -107,7 +121,7 @@ disabled_device = emnify.devices.retrieve_device(device_id=device.id) device_status = disabled_device.status.description # Device status is "Disabled" -sim_status = disabled_device.sim.status.description # SIM status is "Suspended" +sim_status = disabled_device.sim.status.description # SIM status is "Suspended" # [endblock] @@ -117,10 +131,11 @@ old_devices_list = [device for device in emnify.devices.get_devices_list()] device_to_delete = list( - filter( - lambda device: device.sim and device.status.id == emnify_constants.DeviceStatuses.ENABLED_ID, - old_devices_list - ) + filter( + lambda device: device.sim + and device.status.id == emnify_constants.DeviceStatuses.ENABLED_ID, + old_devices_list, + ) )[0] # Choose a device to delete with an assigned SIM and the "Enabled" device status @@ -142,13 +157,13 @@ # === Example: Manage device connectivity === -# There are many reasons why connection issues arise. +# There are many reasons why connection issues arise. # For example: # - The device executes the wrong procedures due to a bad firmware update. # - The device executes network registration too frequently, so the network no longer allows it to register. # - You changed a policy due to a blocked device. -# To reset device connectivity, use the following methods: +# To reset device connectivity, use the following methods: # - Reset the device's connectivity device_id = 0 emnify.devices.reset_connectivity_data(device_id=device_id) @@ -157,6 +172,8 @@ # Use the following method to check the connectivity: connectivity = emnify.devices.get_device_connectivity_status(device_id=device_id) -print(connectivity.status.description) # Status is either "Attached", "Online", "Offline", or "Blocked" +print( + connectivity.status.description +) # Status is either "Attached", "Online", "Offline", or "Blocked" # [endblock] diff --git a/docs/examples/devices.py b/docs/examples/devices.py index 49ae9da..f6ed482 100644 --- a/docs/examples/devices.py +++ b/docs/examples/devices.py @@ -3,7 +3,7 @@ # Initiate instance -emnify_client = EMnify('YOUR APP TOKEN') +emnify_client = EMnify("YOUR APP TOKEN") """ === Get all devices === """ @@ -15,8 +15,8 @@ tariff_profile = emnify_client.devices.tariff_profile_model(id=1) device_status = emnify_client.devices.status_model(id=0) device_model = emnify_client.devices.device_create_model( - tariff_profile=tariff_profile, status=device_status, service_profile=service_profile - ) + tariff_profile=tariff_profile, status=device_status, service_profile=service_profile +) # All required models can be retrieved through manager`s properties device_id = emnify_client.devices.create_device(device_model) diff --git a/docs/examples/filtering_and_sorting.py b/docs/examples/filtering_and_sorting.py index a80efd2..e7ff7f0 100644 --- a/docs/examples/filtering_and_sorting.py +++ b/docs/examples/filtering_and_sorting.py @@ -1,10 +1,9 @@ - from emnify import EMnify from emnify import constants as emnify_constants # To operate the emnify SDK, you need to generate an application token. # Step-by-step guide: https://www.emnify.com/developer-blog/how-to-use-an-application-token-for-api-authentication -emnify_client = EMnify(app_token='YOUR_TOKEN') +emnify_client = EMnify(app_token="YOUR_TOKEN") # Some methods that return multiple objects allow sorting and filtering. # API reference: https://emnify.github.io/emnify-sdk-python/autoapi/index.html @@ -32,7 +31,7 @@ sim_filter = emnify_client.sim.get_sim_filter_model( customer_org=1, status=emnify_constants.SimStatusesID.ACTIVATED_ID.value, - production_date='2019-01-25' + production_date="2019-01-25", ) # The list SIM cards request also has a separate filter, passed as an argument. @@ -49,9 +48,7 @@ sort_parameter = emnify_client.devices.get_device_sort_enum.LAST_UPDATED.value # After choosing a filtering parameter, pass it as an argument to sort_enum: -sorted_devices = emnify_client.devices.get_devices_list( - sort_enum=sort_parameter -) +sorted_devices = emnify_client.devices.get_devices_list(sort_enum=sort_parameter) # Now, you have a list of devices with the most recently updated at the top. for latest_device in sorted_devices: diff --git a/docs/examples/first_operation.py b/docs/examples/first_operation.py index 45c773f..97dd08f 100644 --- a/docs/examples/first_operation.py +++ b/docs/examples/first_operation.py @@ -4,7 +4,7 @@ from emnify import EMnify # Get the token from environment variable -TOKEN = os.environ.get('EMNIFY_APPLICATION_TOKEN') +TOKEN = os.environ.get("EMNIFY_APPLICATION_TOKEN") # Initiate SDK instance using application token emnify = EMnify(TOKEN) diff --git a/docs/examples/mass_sim_activation.py b/docs/examples/mass_sim_activation.py index 43eecda..3e045bd 100644 --- a/docs/examples/mass_sim_activation.py +++ b/docs/examples/mass_sim_activation.py @@ -6,20 +6,22 @@ # To operate the emnify SDK, you need to generate an application token. # Step-by-step guide: https://www.emnify.com/developer-blog/how-to-use-an-application-token-for-api-authentication -token = input('token: ') +token = input("token: ") # Authorize the client to perform operations: emnify_client = EMnify(token) # Before going online, you need a device and a SIM card. # This example assumes you have a batch of SIM cards for your devices. -sim_batch_BIC2 = input('BIC2: ') +sim_batch_BIC2 = input("BIC2: ") # emnify allows you to control your service and coverage policies. -# You can find those IDs on the Portal: https://portal.emnify.com/device-policies -service_profile_id = input('Service Profile ID: ') -tariff_profile_id = input('Tariff Profile ID: ') +# You can find those IDs on the Portal: https://portal.emnify.com/device-policies +service_profile_id = input("Service Profile ID: ") +tariff_profile_id = input("Tariff Profile ID: ") # Then, you need service and coverage profiles to create devices later: -service_profile = emnify_client.devices.service_profile_model(id=int(service_profile_id)) +service_profile = emnify_client.devices.service_profile_model( + id=int(service_profile_id) +) tariff_profile = emnify_client.devices.tariff_profile_model(id=int(tariff_profile_id)) try: @@ -30,7 +32,7 @@ # All added SIMs are now registered with "Issued" status. except EMnifyBaseException as e: # If an error appears during SIM registration, - # use EMnifyBaseException for general exceptions + # use EMnifyBaseException for general exceptions # or inherited classes for specific ones. raise AssertionError(f"error during sim batch BIC2 activation{e}") @@ -52,7 +54,7 @@ status=device_status, service_profile=service_profile, sim=sim, - name=device_name + name=device_name, ) # See the API Reference to learn other device parameters: # https://emnify.github.io/emnify-sdk-python/autoapi/index.html @@ -82,8 +84,7 @@ SENDER = "city_scooters_admin" activation_sms = emnify_client.devices.sms_create_model( - payload=ACTIVATION_CODE, - source_adress=SENDER + payload=ACTIVATION_CODE, source_adress=SENDER ) # Finally, send the configuration SMS to your device: diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py index e6d600d..af90686 100644 --- a/docs/sphinx/conf.py +++ b/docs/sphinx/conf.py @@ -1,11 +1,11 @@ -extensions = ['autoapi.extension'] -html_title = 'emnify Python SDK' +extensions = ["autoapi.extension"] +html_title = "emnify Python SDK" html_theme = "furo" copyright = "2023 emnify GmbH. All rights reserved." project = "emnify Python SDK" -html_baseurl = '/autoapi/' -html_logo = '../logo.svg' -html_favicon = '../favicon.ico' -autoapi_type = 'python' -autoapi_dirs = ['../../emnify'] +html_baseurl = "/autoapi/" +html_logo = "../logo.svg" +html_favicon = "../favicon.ico" +autoapi_type = "python" +autoapi_dirs = ["../../emnify"] diff --git a/emnify/__init__.py b/emnify/__init__.py index a4d1811..8cec35a 100644 --- a/emnify/__init__.py +++ b/emnify/__init__.py @@ -1,3 +1,3 @@ from .emnify import EMnify -__all__ = ['EMnify'] +__all__ = ["EMnify"] diff --git a/emnify/api_manager.py b/emnify/api_manager.py index 0ae9890..e51394d 100644 --- a/emnify/api_manager.py +++ b/emnify/api_manager.py @@ -6,9 +6,11 @@ from emnify.modules.api.models import AuthenticationResponse from emnify import constants as emnify_constants -MAIN_URL = os.environ.get('EMNIFY_SDK_API_ENDPOINT_URL', 'https://cdn.emnify.net/api') +MAIN_URL = os.environ.get("EMNIFY_SDK_API_ENDPOINT_URL", "https://cdn.emnify.net/api") -MAX_PAGES_IN_PAGINATOR = 1000 # with regular page size 1000...2000 gives max 2_000_000 records +MAX_PAGES_IN_PAGINATOR = ( + 1000 # with regular page size 1000...2000 gives max 2_000_000 records +) class BaseApiManager: @@ -17,60 +19,64 @@ class BaseApiManager: """ response_handlers = { - 200: 'return_unwrapped', - 201: 'return_success', - 204: 'return_success', - 400: 'process_exception', - 401: 'unauthorised', - 404: 'process_exception', - 409: 'process_exception', - 422: 'process_exception' + 200: "return_unwrapped", + 201: "return_success", + 204: "return_success", + 400: "process_exception", + 401: "unauthorised", + 404: "process_exception", + 409: "process_exception", + 422: "process_exception", } - request_url_prefix = '' - request_method_name = '' + request_url_prefix = "" + request_method_name = "" @staticmethod - def _build_headers(token=''): + def _build_headers(token=""): return { - emnify_constants.RequestDefaultHeadersKeys.ACCEPT.value: - emnify_constants.RequestDefaultHeadersValues.APPLICATION_JSON.value, - - emnify_constants.RequestDefaultHeadersKeys.AUTHORIZATION.value: - emnify_constants.RequestDefaultHeadersValues.BEARER_TOKEN.value.format(token), - - emnify_constants.RequestDefaultHeadersKeys.XEmnOriginApp.value: - emnify_constants.RequestDefaultHeadersValues.PYTHONSDK.value, - - emnify_constants.RequestDefaultHeadersKeys.XEmnOriginAppVersion.value: - emnify_constants.RequestDefaultHeadersValues.PYTHONSDK_VERSION.value, - - emnify_constants.RequestDefaultHeadersKeys.USER_AGENT.value: - emnify_constants.RequestDefaultHeadersValues.USER_AGENT.value + emnify_constants.RequestDefaultHeadersKeys.ACCEPT.value: emnify_constants.RequestDefaultHeadersValues.APPLICATION_JSON.value, + emnify_constants.RequestDefaultHeadersKeys.AUTHORIZATION.value: emnify_constants.RequestDefaultHeadersValues.BEARER_TOKEN.value.format( + token + ), + emnify_constants.RequestDefaultHeadersKeys.XEmnOriginApp.value: emnify_constants.RequestDefaultHeadersValues.PYTHONSDK.value, + emnify_constants.RequestDefaultHeadersKeys.XEmnOriginAppVersion.value: emnify_constants.RequestDefaultHeadersValues.PYTHONSDK_VERSION.value, + emnify_constants.RequestDefaultHeadersKeys.USER_AGENT.value: emnify_constants.RequestDefaultHeadersValues.USER_AGENT.value, } - def process_exception(self, response: requests.Response, client, data: dict = None, *args, **kwargs): - raise emnify_errors.ValidationErrorException(f'{response.json()}') + def process_exception( + self, response: requests.Response, client, data: dict = None, *args, **kwargs + ): + raise emnify_errors.ValidationErrorException(f"{response.json()}") def return_paginator( - self, response: requests.Response, client, data: dict = None, files=None, path_params: dict = None, - query_params: dict = None + self, + response: requests.Response, + client, + data: dict = None, + files=None, + path_params: dict = None, + query_params: dict = None, ) -> typing.Generator: query_params = query_params or {} - page = query_params.get('page', 1) if query_params else 1 - total_pages = int(response.headers.get(emnify_constants.ResponseHeaders.TOTAL_PAGES.value)) + page = query_params.get("page", 1) if query_params else 1 + total_pages = int( + response.headers.get(emnify_constants.ResponseHeaders.TOTAL_PAGES.value) + ) try: response_data = response.json() except requests.exceptions.JSONDecodeError: - raise emnify_errors.JsonDecodeException('error while parsing json for') + raise emnify_errors.JsonDecodeException("error while parsing json for") for item in response_data: yield item if page < total_pages and page < MAX_PAGES_IN_PAGINATOR: - query_params['page'] = page + 1 + query_params["page"] = page + 1 - next_page_response = self.call_api(client, data, files, query_params=query_params, path_params=path_params) + next_page_response = self.call_api( + client, data, files, query_params=query_params, path_params=path_params + ) for item in next_page_response: yield item @@ -78,7 +84,15 @@ def return_paginator( def build_method_url(self, url_params): return self.request_url_prefix.format(**url_params) - def unauthorised(self, response: requests.Response, client, data: dict = None, path_params=None, *args, **kwargs): + def unauthorised( + self, + response: requests.Response, + client, + data: dict = None, + path_params=None, + *args, + **kwargs, + ): """ method for 1 cycle retry - re authentication """ @@ -89,39 +103,108 @@ def unauthorised(self, response: requests.Response, client, data: dict = None, p return self.call_api(client, data, path_params=path_params, *args, **kwargs) - def call_api(self, client, data: dict = None, files=None, path_params: dict = None, query_params: dict = None): + def call_api( + self, + client, + data: dict = None, + files=None, + path_params: dict = None, + query_params: dict = None, + ): url = self.request_url_prefix if path_params: url = self.build_method_url(path_params) - response = self.make_request(client, url, data, files, query_params=query_params) + response = self.make_request( + client, url, data, files, query_params=query_params + ) if response.status_code not in self.response_handlers.keys(): raise emnify_errors.UnknownStatusCodeException( - "Unknown status code {status_code}".format(status_code=response.status_code) + "Unknown status code {status_code}".format( + status_code=response.status_code + ) ) - return getattr(self, self.response_handlers[response.status_code]) \ - (response, client, data=data, files=files, query_params=query_params, path_params=path_params) - - def make_get_request(self, main_url: str, method_name: str, headers: dict, params: str = None): - return requests.get(self.resource_path(main_url, method_name), headers=headers, params=params) - - def make_post_request(self, main_url: str, method_name: str, headers: dict, params: dict = None, data: dict = None): - return requests.post(self.resource_path(main_url, method_name), headers=headers, json=data, params=params) - - def make_patch_request(self, main_url: str, method_name: str, headers: dict, params: dict = None, - data: dict = None): - return requests.patch(self.resource_path(main_url, method_name), headers=headers, json=data, params=params) - - def make_delete_request(self, main_url: str, method_name: str, headers: dict, params: dict = None, - data: dict = None): - return requests.delete(self.resource_path(main_url, method_name), headers=headers, json=data, params=params) - - def make_put_request(self, main_url: str, method_name: str, headers: dict, params: dict = None, data: dict = None): - return requests.put(self.resource_path(main_url, method_name), headers=headers, json=data, params=params) - - def make_request(self, client, method_url: str, data=None, files=None, query_params=None): + return getattr(self, self.response_handlers[response.status_code])( + response, + client, + data=data, + files=files, + query_params=query_params, + path_params=path_params, + ) + + def make_get_request( + self, main_url: str, method_name: str, headers: dict, params: str = None + ): + return requests.get( + self.resource_path(main_url, method_name), headers=headers, params=params + ) + + def make_post_request( + self, + main_url: str, + method_name: str, + headers: dict, + params: dict = None, + data: dict = None, + ): + return requests.post( + self.resource_path(main_url, method_name), + headers=headers, + json=data, + params=params, + ) + + def make_patch_request( + self, + main_url: str, + method_name: str, + headers: dict, + params: dict = None, + data: dict = None, + ): + return requests.patch( + self.resource_path(main_url, method_name), + headers=headers, + json=data, + params=params, + ) + + def make_delete_request( + self, + main_url: str, + method_name: str, + headers: dict, + params: dict = None, + data: dict = None, + ): + return requests.delete( + self.resource_path(main_url, method_name), + headers=headers, + json=data, + params=params, + ) + + def make_put_request( + self, + main_url: str, + method_name: str, + headers: dict, + params: dict = None, + data: dict = None, + ): + return requests.put( + self.resource_path(main_url, method_name), + headers=headers, + json=data, + params=params, + ) + + def make_request( + self, client, method_url: str, data=None, files=None, query_params=None + ): if self.request_method_name not in emnify_constants.RequestsType.list(): - raise ValueError(f'{self.request_method_name}: This method is not allowed') + raise ValueError(f"{self.request_method_name}: This method is not allowed") headers = self._build_headers(client.token) response = None if self.request_method_name == emnify_constants.RequestsType.GET.value: @@ -152,15 +235,17 @@ def return_success(*_, **__) -> True: return True @staticmethod - def return_unwrapped(response: requests.Response, *args, **kwargs) -> requests.Response.json: + def return_unwrapped( + response: requests.Response, *args, **kwargs + ) -> requests.Response.json: try: return response.json() except requests.exceptions.JSONDecodeError: - raise emnify_errors.JsonDecodeException('error while parsing json for') + raise emnify_errors.JsonDecodeException("error while parsing json for") @staticmethod def resource_path(main_url: str, method_name: str): - return f'{main_url}{method_name}' + return f"{main_url}{method_name}" class Authenticate(BaseApiManager): @@ -170,15 +255,28 @@ class Authenticate(BaseApiManager): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.response_handlers = self.response_handlers.copy() | { - 404: 'unexpected_error' + 404: "unexpected_error" } def unauthorised( - self, response: requests.Response, client, data: dict = None, files=None, path_params: list = None, **kwargs + self, + response: requests.Response, + client, + data: dict = None, + files=None, + path_params: list = None, + **kwargs, ): - raise emnify_errors.UnauthorisedException('Invalid Application Token') + raise emnify_errors.UnauthorisedException("Invalid Application Token") def unexpected_error( - self, response: requests.Response, client, data: dict = None, files=None, path_params: list = None + self, + response: requests.Response, + client, + data: dict = None, + files=None, + path_params: list = None, ): - raise emnify_errors.UnauthorisedException(f'Unexpected Auth Error {response.json()}') + raise emnify_errors.UnauthorisedException( + f"Unexpected Auth Error {response.json()}" + ) diff --git a/emnify/constants.py b/emnify/constants.py index 90f4802..0e0c180 100644 --- a/emnify/constants.py +++ b/emnify/constants.py @@ -3,6 +3,7 @@ from enum import Enum from emnify.version import EMNIFY_PACKAGE_VERSION + class ExtendedEnum(Enum): @classmethod def list(cls): @@ -10,45 +11,45 @@ def list(cls): class DeviceSort(ExtendedEnum): - ID = 'id' - STATUS = 'status' - LAST_UPDATED = 'last_updated' - CREATED = 'created' - NAME = 'name' - TAGS = 'tags' - IP_ADDRESS = 'ip_address' - IMEI = 'imei' + ID = "id" + STATUS = "status" + LAST_UPDATED = "last_updated" + CREATED = "created" + NAME = "name" + TAGS = "tags" + IP_ADDRESS = "ip_address" + IMEI = "imei" class IdValues(ExtendedEnum): - ID = 'id' + ID = "id" class RequestsType(ExtendedEnum): - GET = 'get' - POST = 'post' - PUT = 'put' - DELETE = 'delete' - PATCH = 'patch' + GET = "get" + POST = "post" + PUT = "put" + DELETE = "delete" + PATCH = "patch" class AuthenticateRequestsUrl(ExtendedEnum): - V1_AUTHENTICATE = '/v1/authenticate' + V1_AUTHENTICATE = "/v1/authenticate" class RequestDefaultHeadersKeys(ExtendedEnum): - ACCEPT = 'accept' - AUTHORIZATION = 'authorization' - XEmnOriginApp = 'x-emn-origin-app' - XEmnOriginAppVersion = 'x-emn-origin-app-version' - USER_AGENT = 'User-Agent' + ACCEPT = "accept" + AUTHORIZATION = "authorization" + XEmnOriginApp = "x-emn-origin-app" + XEmnOriginAppVersion = "x-emn-origin-app-version" + USER_AGENT = "User-Agent" class RequestDefaultHeadersValues(ExtendedEnum): - APPLICATION_JSON = 'application/json' - BEARER_TOKEN = 'Bearer {}' + APPLICATION_JSON = "application/json" + BEARER_TOKEN = "Bearer {}" PYTHONSDK_VERSION = EMNIFY_PACKAGE_VERSION - PYTHONSDK = 'emnifyPythonSDK' + PYTHONSDK = "emnifyPythonSDK" name_and_version = f"{PYTHONSDK}/{PYTHONSDK_VERSION}" requests_user_agent = f" {requests.utils.default_user_agent()}" @@ -63,18 +64,9 @@ class DeviceStatuses(ExtendedEnum): ENABLED_ID = 0 DISABLED_ID = 1 DELETED_ID = 2 - ENABLED_DICT = { - "id": 0, - "description": "Enabled" - } - DISABLED_DICT = { - "id": 1, - "description": "Disabled" - } - DELETED_DICT = { - "id": 2, - "description": "Deleted" - } + ENABLED_DICT = {"id": 0, "description": "Enabled"} + DISABLED_DICT = {"id": 1, "description": "Disabled"} + DELETED_DICT = {"id": 2, "description": "Deleted"} class SimStatusesID(ExtendedEnum): @@ -86,46 +78,31 @@ class SimStatusesID(ExtendedEnum): class SimStatusesDict(ExtendedEnum): - ISSUED_DICT = { - "id": 0, - "description": "Issued" - } - ACTIVATED_DICT = { - "id": 1, - "description": "Activated" - } - SUSPENDED_DICT = { - "id": 2, - "description": "Suspended" - } - DELETED_DICT = { - "id": 3, - "description": "Deleted" - } - FACTORY_TEST_DICT = { - "id": 4, - "description": "Factory Test" - } + ISSUED_DICT = {"id": 0, "description": "Issued"} + ACTIVATED_DICT = {"id": 1, "description": "Activated"} + SUSPENDED_DICT = {"id": 2, "description": "Suspended"} + DELETED_DICT = {"id": 3, "description": "Deleted"} + FACTORY_TEST_DICT = {"id": 4, "description": "Factory Test"} class ResponseHeaders(ExtendedEnum): - COUNT_PER_PAGE = 'X-Count-Per-Page' - CURRENT_PAGE = 'X-Current-Page' - TOTAL_PAGES = 'X-Total-Pages' - TOTAL_COUNT = 'X-Total-Count' + COUNT_PER_PAGE = "X-Count-Per-Page" + CURRENT_PAGE = "X-Current-Page" + TOTAL_PAGES = "X-Total-Pages" + TOTAL_COUNT = "X-Total-Count" class SimSort(ExtendedEnum): - id = 'ID' - issuer_org = 'ISSUER_ORG' - reseller_org = 'RESELLER_ORG' - customer_org = 'CUSTOMER_PRG' - iccid = 'ICCID' - status = 'STATUS' - production_date = 'PRODUCTION_DATE' - endpoint = 'ENDPOINT' - model = 'MODEL' + id = "ID" + issuer_org = "ISSUER_ORG" + reseller_org = "RESELLER_ORG" + customer_org = "CUSTOMER_PRG" + iccid = "ICCID" + status = "STATUS" + production_date = "PRODUCTION_DATE" + endpoint = "ENDPOINT" + model = "MODEL" class RequestUrls(ExtendedEnum): - ENDPOINT_IN_URL = '/v1/endpoint/{endpoint_id}' + ENDPOINT_IN_URL = "/v1/endpoint/{endpoint_id}" diff --git a/emnify/emnify.py b/emnify/emnify.py index d038415..7e3a06c 100644 --- a/emnify/emnify.py +++ b/emnify/emnify.py @@ -1,8 +1,11 @@ +import sys import logging +from emnify import errors as emnify_errors from .modules.device.manager import DeviceManager from .modules.sim.manager import SimManager from .modules.operator.manager import OperatorManager -logger = logging.getLogger('EmnifySDK') + +logger = logging.getLogger("EmnifySDK") class EMnify(object): @@ -10,7 +13,12 @@ class EMnify(object): base SDK class token: Emnify api token """ + def __init__(self, app_token=None): + if not sys.version_info >= (3, 9): + raise emnify_errors.MinimalPythonVersionException( + "Python version 3.9 or higher is required" + ) assert app_token self.app_token = app_token self.devices: DeviceManager = DeviceManager(self) diff --git a/emnify/errors.py b/emnify/errors.py index 4a12c93..e860e4e 100644 --- a/emnify/errors.py +++ b/emnify/errors.py @@ -1,11 +1,13 @@ # Custom Exceptions __all__ = [ - 'EMnifyBaseException', - 'UnauthorisedException', - 'JsonDecodeException', - 'UnexpectedArgumentException', - 'ValidationErrorException' + "EMnifyBaseException", + "UnauthorisedException", + "JsonDecodeException", + "UnexpectedArgumentException", + "ValidationErrorException", + "UnknownStatusCodeException", + "MinimalPythonVersionException", ] @@ -31,3 +33,7 @@ class ValidationErrorException(EMnifyBaseException): class UnknownStatusCodeException(EMnifyBaseException): """Custom error for unknown response errors""" + + +class MinimalPythonVersionException(EMnifyBaseException): + """Custom error for minimal python version required""" diff --git a/emnify/modules/__init__.py b/emnify/modules/__init__.py index 963de09..e69de29 100644 --- a/emnify/modules/__init__.py +++ b/emnify/modules/__init__.py @@ -1 +0,0 @@ -from .device import DeviceManager diff --git a/emnify/modules/api/models.py b/emnify/modules/api/models.py index fe9031d..5824dc2 100644 --- a/emnify/modules/api/models.py +++ b/emnify/modules/api/models.py @@ -186,7 +186,7 @@ class Data(BaseModel): currency_id: Optional[float] = None id: Optional[float] = None traffic_type: Optional[TrafficType] = None - currency: Optional[Currency] = Field(None, title='Currency') + currency: Optional[Currency] = Field(None, title="Currency") class TrafficType1(BaseModel): @@ -213,7 +213,7 @@ class Sms(BaseModel): currency_id: Optional[float] = None id: Optional[float] = None traffic_type: Optional[TrafficType1] = None - currency: Optional[Currency1] = Field(None, title='Currency') + currency: Optional[Currency1] = Field(None, title="Currency") class LastMonth(BaseModel): @@ -251,7 +251,7 @@ class Sms1(BaseModel): currency_id: Optional[float] = None id: Optional[float] = None traffic_type: Optional[TrafficType2] = None - currency: Optional[Currency2] = Field(None, title='Currency') + currency: Optional[Currency2] = Field(None, title="Currency") class StatsResponseObject(BaseModel): @@ -284,7 +284,7 @@ class Data1(BaseModel): currency_id: Optional[float] = None id: Optional[float] = None traffic_type: Optional[TrafficType3] = None - currency: Optional[Currency3] = Field(None, title='Currency') + currency: Optional[Currency3] = Field(None, title="Currency") class TrafficType4(BaseModel): @@ -311,7 +311,7 @@ class Sms2(BaseModel): currency_id: Optional[float] = None id: Optional[float] = None traffic_type: Optional[TrafficType4] = None - currency: Optional[Currency4] = Field(None, title='Currency') + currency: Optional[Currency4] = Field(None, title="Currency") class SIMStatsDataObject(BaseModel): @@ -343,7 +343,7 @@ class TrafficStatsObject(BaseModel): currency_id: Optional[float] = None id: Optional[float] = None traffic_type: Optional[TrafficType5] = None - currency: Optional[Currency5] = Field(None, title='Currency') + currency: Optional[Currency5] = Field(None, title="Currency") class TrafficTypeObject(BaseModel): @@ -396,7 +396,7 @@ class StatsObjectItem(BaseModel): class StatsObject(BaseModel): __root__: List[StatsObjectItem] = Field( - ..., title='Response schema for Endpoint and Organisation Statistics' + ..., title="Response schema for Endpoint and Organisation Statistics" ) @@ -487,36 +487,36 @@ class RatType(BaseModel): class ListofSMSresponse(BaseModel): - submit_date: Optional[str] = Field(None, example='10/5/2019 1:56:59 PM') - delivery_date: Optional[str] = Field(None, example='10/5/2019 1:56:59 PM') - expiry_date: Optional[str] = Field(None, example='10/6/2019 1:56:59 PM') - final_date: Optional[str] = Field(None, example='10/5/2019 1:57:03 PM') + submit_date: Optional[str] = Field(None, example="10/5/2019 1:56:59 PM") + delivery_date: Optional[str] = Field(None, example="10/5/2019 1:56:59 PM") + expiry_date: Optional[str] = Field(None, example="10/6/2019 1:56:59 PM") + final_date: Optional[str] = Field(None, example="10/5/2019 1:57:03 PM") retry_date: Optional[str] = None - last_delivery_attempt: Optional[str] = Field(None, example='10/5/2019 1:57:00 PM') + last_delivery_attempt: Optional[str] = Field(None, example="10/5/2019 1:57:00 PM") retry_count: Optional[str] = Field(None, example=0) gsm_map_error: Optional[str] = None dcs: Optional[int] = Field(None, example=0) pid: Optional[int] = Field(None, example=0) source_address: Optional[str] = Field(None, example=1234567890) endpoint: Optional[Dict[str, Any]] = Field( - None, example={'id': 166, 'name': 'Your Endpoint'} + None, example={"id": 166, "name": "Your Endpoint"} ) sim_id: Optional[str] = Field(None, example=625) iccid: Optional[str] = Field(None, example=8988303000000001000) - msisdn: Optional[str] = Field(None, example='883XXXXXXXXXXXX') - imsi: Optional[str] = Field(None, example='901XXXXXXXXXXXX') + msisdn: Optional[str] = Field(None, example="883XXXXXXXXXXXX") + imsi: Optional[str] = Field(None, example="901XXXXXXXXXXXX") msc: Optional[str] = Field(None, example=491600190000) udh: Optional[str] = None - payload: Optional[str] = Field(None, example='test') + payload: Optional[str] = Field(None, example="test") id: Optional[int] = Field(None, example=590) status: Optional[Dict[str, Any]] = Field( - None, example={'description': 'DELIVERED', 'id': 4} + None, example={"description": "DELIVERED", "id": 4} ) sms_type: Optional[Dict[str, Any]] = Field( - None, example={'description': 'MT', 'id': 1} + None, example={"description": "MT", "id": 1} ) source_address_type: Optional[Dict[str, Any]] = Field( - None, example={'description': 'National', 'id': 161} + None, example={"description": "National", "id": 161} ) @@ -561,34 +561,34 @@ class RetrieveConnectivityInformationresponse(BaseModel): class OperatorPatchRequest(BaseModel): __root__: Any = Field( ..., - example={'name': 'Zulu, New Operator Name'}, - title='Example request body to update Operator details', + example={"name": "Zulu, New Operator Name"}, + title="Example request body to update Operator details", ) class OperatorDataPostRequest(BaseModel): __root__: Any = Field( ..., - example={'mnc': '99'}, - title='Example request body to update Operator Related Data', + example={"mnc": "99"}, + title="Example request body to update Operator Related Data", ) class RetrieveOperatorBlacklistresponse(BaseModel): id: Optional[int] = Field(None, example=1) - name: Optional[str] = Field(None, example='Telekom') + name: Optional[str] = Field(None, example="Telekom") country: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 74, - 'name': 'Germany', - 'country_code': 49, - 'mcc': 262, - 'iso_code': 'de', + "id": 74, + "name": "Germany", + "country_code": 49, + "mcc": 262, + "iso_code": "de", }, ) - tapcode: Optional[List[Dict[str, Any]]] = Field(None, description='') - mnc: Optional[List[Dict[str, Any]]] = Field(None, description='') + tapcode: Optional[List[Dict[str, Any]]] = Field(None, description="") + mnc: Optional[List[Dict[str, Any]]] = Field(None, description="") class RetrievePrepaidBalanceresponse(BaseModel): @@ -605,9 +605,9 @@ class UpdatePrepaidBalanceresponse(BaseModel): class Description(Enum): - EXHAUSTED = 'EXHAUSTED' - ACTIVE = 'ACTIVE' - EXPIRED = 'EXPIRED' + EXHAUSTED = "EXHAUSTED" + ACTIVE = "ACTIVE" + EXPIRED = "EXPIRED" class Id(Enum): @@ -627,8 +627,8 @@ class Id1(Enum): class Description1(Enum): - Throttle = 'Throttle' - Block = 'Block' + Throttle = "Throttle" + Block = "Block" class ActionOnExhaustion(BaseModel): @@ -640,15 +640,15 @@ class ActionOnExhaustion(BaseModel): class EndpointQuota(BaseModel): last_volume_added: Optional[float] = None last_status_change_date: Optional[ - constr(regex=r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$') + constr(regex=r"^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$") ] = None auto_refill: Optional[int] = None threshold_volume: Optional[float] = None threshold_percentage: Optional[float] = None - status: Status2 = Field(..., title='QuotaStatus') + status: Status2 = Field(..., title="QuotaStatus") volume: float - expiry_date: constr(regex=r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$') - action_on_exhaustion: ActionOnExhaustion = Field(..., title='ActionOnExhaustion') + expiry_date: constr(regex=r"^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$") + action_on_exhaustion: ActionOnExhaustion = Field(..., title="ActionOnExhaustion") peak_throughput: Optional[int] = None @@ -663,8 +663,8 @@ class Id2(Enum): class Description2(Enum): - Throttle = 'Throttle' - Block = 'Block' + Throttle = "Throttle" + Block = "Block" class ActionOnExhaustion1(BaseModel): @@ -674,9 +674,9 @@ class ActionOnExhaustion1(BaseModel): class Description3(Enum): - EXHAUSTED = 'EXHAUSTED' - ACTIVE = 'ACTIVE' - EXPIRED = 'EXPIRED' + EXHAUSTED = "EXHAUSTED" + ACTIVE = "ACTIVE" + EXPIRED = "EXPIRED" class Id3(Enum): @@ -703,93 +703,91 @@ class SMSQuota(BaseModel): class RetrieveEventsresponse(BaseModel): - timestamp: Optional[str] = Field(None, example='2020-03-01T12:07:09.000Z') + timestamp: Optional[str] = Field(None, example="2020-03-01T12:07:09.000Z") alert: Optional[bool] = Field(None, example=True) - description: Optional[str] = Field(None, example='PDP Context deleted.') + description: Optional[str] = Field(None, example="PDP Context deleted.") id: Optional[int] = Field(None, example=69535) event_type: Optional[Dict[str, Any]] = Field( - None, example={'description': 'Delete PDP Context', 'id': 4} + None, example={"description": "Delete PDP Context", "id": 4} ) event_source: Optional[Dict[str, Any]] = Field( - None, example={'name': 'Network', 'id': 0} + None, example={"name": "Network", "id": 0} ) event_severity: Optional[Dict[str, Any]] = Field( - None, example={'description': 'INFO', 'id': 0} + None, example={"description": "INFO", "id": 0} ) organisation: Optional[Dict[str, Any]] = Field( - None, example={'name': 'Organisation_Name', 'id': 2} + None, example={"name": "Organisation_Name", "id": 2} ) endpoint: Optional[Dict[str, Any]] = Field( None, example={ - 'name': 'Monitoring201', - 'tags': 'Monitoring', - 'ip_address': '0.0.0.0', - 'imei': None, - 'id': 1, + "name": "Monitoring201", + "tags": "Monitoring", + "ip_address": "0.0.0.0", + "imei": None, + "id": 1, }, ) sim: Optional[Dict[str, Any]] = Field( None, example={ - 'iccid': 10000000000, - 'production_date': '2019-12-17T13:26:13.000Z', - 'id': 1, + "iccid": 10000000000, + "production_date": "2019-12-17T13:26:13.000Z", + "id": 1, }, ) imsi: Optional[Dict[str, Any]] = Field( None, example={ - 'imsi': 100000000000000, - 'import_date': '2019-12-17T13:26:08.000Z', - 'id': 110, + "imsi": 100000000000000, + "import_date": "2019-12-17T13:26:08.000Z", + "id": 110, }, ) class StartingaUSSDDialogrequest(BaseModel): - ussd_begin: Dict[str, Any] = Field(..., alias='ussd-begin') + ussd_begin: Dict[str, Any] = Field(..., alias="ussd-begin") class StartingaUSSDDialogresponse(BaseModel): - session_id: Optional[str] = Field(None, alias='session-id') + session_id: Optional[str] = Field(None, alias="session-id") class RetrieveOrganisationListresponse(BaseModel): id: int = Field(..., example=12) - name: str = Field(..., example='Tele17') + name: str = Field(..., example="Tele17") class_: Dict[str, Any] = Field( - ..., alias='class', example={'id': 0, 'description': 'Commercial'} + ..., alias="class", example={"id": 0, "description": "Commercial"} ) - type: Dict[str, Any] = Field(..., example={'id': 1, 'description': 'Provider'}) + type: Dict[str, Any] = Field(..., example={"id": 1, "description": "Provider"}) country: Dict[str, Any] = Field( ..., example={ - 'id': 74, - 'name': 'Germany', - 'mcc': 262, - 'country_code': 49, - 'isocode': 'de', + "id": 74, + "name": "Germany", + "mcc": 262, + "country_code": 49, + "isocode": "de", }, ) - status: Dict[str, Any] = Field(..., example={'id': 0, 'description': 'Enabled'}) + status: Dict[str, Any] = Field(..., example={"id": 0, "description": "Enabled"}) relation: Dict[str, Any] = Field( - ..., example={'id': 17, 'type': {'id': 2, 'description': 'Roaming Partner'}} + ..., example={"id": 17, "type": {"id": 2, "description": "Roaming Partner"}} ) monthly_cost_limit: int = Field(..., example=1000) - currency: Dict[str, Any] = Field( - ..., example={'id': 1, 'code': 'EUR'} - ) - created: str = Field(..., example='2/3/2019 12:00:00 AM') + currency: Dict[str, Any] = Field(..., example={"id": 1, "code": "EUR"}) + created: str = Field(..., example="2/3/2019 12:00:00 AM") verification_type: Dict[str, Any] = Field( - ..., example={'id': 1, 'description': 'Business registration number'} + ..., example={"id": 1, "description": "Business registration number"} ) verification: str = Field(..., example=123456789) class CreateanOrganisationrequest(BaseModel): name: str - class_: Dict[str, Any] = Field(..., alias='class') + class_: Dict[str, Any] = Field(..., alias="class") type: Dict[str, Any] country: Dict[str, Any] status: Dict[str, Any] @@ -804,7 +802,7 @@ class CreateanOrganisationrequest(BaseModel): class RetrieveaSingleOrganisationresponse(BaseModel): id: Optional[int] = None name: Optional[str] = None - class_: Optional[Dict[str, Any]] = Field(None, alias='class') + class_: Optional[Dict[str, Any]] = Field(None, alias="class") type: Optional[Dict[str, Any]] = None country: Optional[Dict[str, Any]] = None status: Optional[Dict[str, Any]] = None @@ -818,7 +816,7 @@ class RetrieveaSingleOrganisationresponse(BaseModel): class UpdateOrganisationrequest(BaseModel): name: str - class_: Dict[str, Any] = Field(..., alias='class') + class_: Dict[str, Any] = Field(..., alias="class") type: Dict[str, Any] country: Dict[str, Any] status: Dict[str, Any] @@ -831,44 +829,44 @@ class UpdateOrganisationrequest(BaseModel): class RetrieveOrganisationStatusesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Enabled') + description: Optional[str] = Field(None, example="Enabled") class RetrieveAvailableOrganisationTypesresponse(BaseModel): id: Optional[int] = Field(None, example=1) - description: Optional[str] = Field(None, example='Mobile Network Operator') + description: Optional[str] = Field(None, example="Mobile Network Operator") class RetrieveAvailableOrganisationRelationTypesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Customer of') + description: Optional[str] = Field(None, example="Customer of") class RetrieveAvailableOrganisationVerificationTypesresponse(BaseModel): id: Optional[int] = Field(None, example=1) - description: Optional[str] = Field(None, example='Business registration number') + description: Optional[str] = Field(None, example="Business registration number") class RetrieveContactsforanOrganisationresponse(BaseModel): id: Optional[int] = Field(None, example=1) organisation: Optional[Dict[str, Any]] = Field( - None, example={'id': 124, 'name': 'Tele17 Austria'} + None, example={"id": 124, "name": "Tele17 Austria"} ) type: Optional[Dict[str, Any]] = Field( - None, example={'id': 1, 'description': 'Commercial'} + None, example={"id": 1, "description": "Commercial"} ) - name: Optional[str] = Field(None, example='Marc Muller') - title: Optional[str] = Field(None, example='Ing') - department: Optional[str] = Field(None, example='Sales') - street: Optional[str] = Field(None, example='1st street') + name: Optional[str] = Field(None, example="Marc Muller") + title: Optional[str] = Field(None, example="Ing") + department: Optional[str] = Field(None, example="Sales") + street: Optional[str] = Field(None, example="1st street") zipcode: Optional[str] = Field(None, example=10224) - city: Optional[str] = Field(None, example='Berlin') + city: Optional[str] = Field(None, example="Berlin") country: Optional[Dict[str, Any]] = Field( - None, example={'id': 1, 'name': 'Germany'} + None, example={"id": 1, "name": "Germany"} ) - email: Optional[str] = Field(None, example='user@domain.com') - phone: Optional[str] = Field(None, example='+497 554 776 653') - mobile: Optional[str] = Field(None, example='+497 554 776 653') + email: Optional[str] = Field(None, example="user@domain.com") + phone: Optional[str] = Field(None, example="+497 554 776 653") + mobile: Optional[str] = Field(None, example="+497 554 776 653") state: Optional[str] = None secondary_address: Optional[str] = None @@ -923,9 +921,9 @@ class UpdateaSingleContactresponse(BaseModel): class Retrievelistofassignedtariffsforanorganisationresponse(BaseModel): id: Optional[int] = Field(None, example=3) - name: Optional[str] = Field(None, example='Tariff for M2M Europe') - description: Optional[str] = Field(None, example='M2M Europe: Data+SMS') - created: Optional[str] = Field(None, example='2019-01-10T09:36:58.000Z') + name: Optional[str] = Field(None, example="Tariff for M2M Europe") + description: Optional[str] = Field(None, example="M2M Europe: Data+SMS") + created: Optional[str] = Field(None, example="2019-01-10T09:36:58.000Z") default_sms_mt_rate: Optional[float] = Field(None, example=0.5) default_sms_mo_rate: Optional[float] = Field(None, example=0.4) sim_issued_rate: Optional[float] = Field(None, example=0.1) @@ -936,268 +934,268 @@ class Retrievelistofassignedtariffsforanorganisationresponse(BaseModel): sim_suspension_rate: Optional[float] = Field(None, example=0.7) sim_termination_rate: Optional[float] = Field(None, example=0.5) status: Optional[Dict[str, Any]] = Field( - None, example={'description': 'Active', 'id': 1} + None, example={"description": "Active", "id": 1} ) currency: Optional[Dict[str, Any]] = Field( - None, example={'id': 1, 'code': 'EUR', 'symbol': '�'} + None, example={"id": 1, "code": "EUR", "symbol": "�"} ) data_blocksize: Optional[Dict[str, Any]] = Field( - None, example={'id': 10, 'octets': 1, 'description': 'exact'} + None, example={"id": 10, "octets": 1, "description": "exact"} ) data_throttle: Optional[Dict[str, Any]] = Field( - None, example={'id': 9, 'octets': 256000, 'description': '256 kbit/s'} + None, example={"id": 9, "octets": 256000, "description": "256 kbit/s"} ) - pdp_context_definition: Optional[List[Dict[str, Any]]] = Field(None, description='') + pdp_context_definition: Optional[List[Dict[str, Any]]] = Field(None, description="") class RetrieveBillingPeriodsresponse(BaseModel): id: Optional[int] = Field(None, example=201810) - description: Optional[str] = Field(None, example='October 2018') + description: Optional[str] = Field(None, example="October 2018") class RetrieveBillingDataByPeriodResponse(BaseModel): __root__: Any = Field( ..., example={ - 'mrc': { - 'data_packages': { - 'data': [ + "mrc": { + "data_packages": { + "data": [ { - 'tariff': {'id': 64, 'name': 'Global Pro I'}, - 'ratezone': {'id': 84, 'name': 'Europe_II'}, - 'currency': {'id': 1, 'code': 'EUR', 'symbol': '�'}, - 'id': 83, - 'volume': 500, - 'rate': 112.81, - 'description': 'Monthly Payment', + "tariff": {"id": 64, "name": "Global Pro I"}, + "ratezone": {"id": 84, "name": "Europe_II"}, + "currency": {"id": 1, "code": "EUR", "symbol": "�"}, + "id": 83, + "volume": 500, + "rate": 112.81, + "description": "Monthly Payment", }, { - 'tariff': {'id': 64, 'name': 'Global Pro I'}, - 'ratezone': {'id': 83, 'name': 'Europe_I'}, - 'currency': {'id': 1, 'code': 'EUR', 'symbol': '�'}, - 'id': 115, - 'volume': 700, - 'rate': 146.25, - 'description': 'Monthly Payment', + "tariff": {"id": 64, "name": "Global Pro I"}, + "ratezone": {"id": 83, "name": "Europe_I"}, + "currency": {"id": 1, "code": "EUR", "symbol": "�"}, + "id": 115, + "volume": 700, + "rate": 146.25, + "description": "Monthly Payment", }, ], - 'total': { - 'cost': 259.06, - 'volume': 1200, - 'currency': {'id': 1, 'code': 'EUR', 'symbol': '�'}, + "total": { + "cost": 259.06, + "volume": 1200, + "currency": {"id": 1, "code": "EUR", "symbol": "�"}, }, } }, - 'sim_items': { - 'total': { - 'number_of_active_sims_chargeable': 48, - 'sim_hosting_fees': 0, - 'cost': 0, + "sim_items": { + "total": { + "number_of_active_sims_chargeable": 48, + "sim_hosting_fees": 0, + "cost": 0, }, - 'data': [], + "data": [], }, - 'traffic': { - 'data': { - 'tariff': [ + "traffic": { + "data": { + "tariff": [ { - 'volume': '30.209802', - 'cost': 0, - 'currency': {'code': 'EUR'}, - 'id': 64, - 'name': 'Global Pro I', - 'ratezone': [ + "volume": "30.209802", + "cost": 0, + "currency": {"code": "EUR"}, + "id": 64, + "name": "Global Pro I", + "ratezone": [ { - 'countries': [ + "countries": [ { - 'volume': '30.209802', - 'cost': '7.5524505000', - 'ratezone': 'Europe_I', - 'ratezone_id': '83', - 'rate': '0.250000', - 'currency': {'code': 'EUR'}, - 'country': {'name': 'Germany'}, + "volume": "30.209802", + "cost": "7.5524505000", + "ratezone": "Europe_I", + "ratezone_id": "83", + "rate": "0.250000", + "currency": {"code": "EUR"}, + "country": {"name": "Germany"}, } ], - 'volume': '30.209802', - 'data_package_volume': 700, - 'cost': 0, - 'name': 'Europe_I', - 'id': 83, - 'tariff': 'Global Pro I', - 'rate': '0.250000', - 'currency': {'code': 'EUR'}, - 'inclusive_volume': 0, + "volume": "30.209802", + "data_package_volume": 700, + "cost": 0, + "name": "Europe_I", + "id": 83, + "tariff": "Global Pro I", + "rate": "0.250000", + "currency": {"code": "EUR"}, + "inclusive_volume": 0, } ], }, { - 'volume': 171.843168, - 'cost': 343.686336, - 'currency': {'code': 'EUR'}, - 'id': 48, - 'name': 'Test Tariff multi APN', - 'ratezone': [ + "volume": 171.843168, + "cost": 343.686336, + "currency": {"code": "EUR"}, + "id": 48, + "name": "Test Tariff multi APN", + "ratezone": [ { - 'countries': [ + "countries": [ { - 'volume': '171.843168', - 'cost': '343.6863360000', - 'ratezone': 'Telekom Germany Zone', - 'ratezone_id': '61', - 'rate': '2.000000', - 'currency': {'code': 'EUR'}, - 'country': {'name': 'Germany'}, + "volume": "171.843168", + "cost": "343.6863360000", + "ratezone": "Telekom Germany Zone", + "ratezone_id": "61", + "rate": "2.000000", + "currency": {"code": "EUR"}, + "country": {"name": "Germany"}, } ], - 'volume': 171.843168, - 'cost': 343.686336, - 'name': 'Telekom Germany Zone', - 'id': 61, - 'tariff': 'Test Tariff multi APN', - 'rate': '2.000000', - 'currency': {'code': 'EUR'}, - 'data_package_volume': 0, - 'inclusive_volume': 0, + "volume": 171.843168, + "cost": 343.686336, + "name": "Telekom Germany Zone", + "id": 61, + "tariff": "Test Tariff multi APN", + "rate": "2.000000", + "currency": {"code": "EUR"}, + "data_package_volume": 0, + "inclusive_volume": 0, } ], }, ], - 'total': { - 'volume': 202.05297, - 'cost': 343.686336, - 'currency': {'code': 'EUR'}, + "total": { + "volume": 202.05297, + "cost": 343.686336, + "currency": {"code": "EUR"}, }, }, - 'sms': { - 'tariff': [ + "sms": { + "tariff": [ { - 'volume': 338, - 'cost': 22.06, - 'currency': {'code': 'EUR'}, - 'id': 1, - 'name': 'Tariff 1', - 'ratezone': [ + "volume": 338, + "cost": 22.06, + "currency": {"code": "EUR"}, + "id": 1, + "name": "Tariff 1", + "ratezone": [ { - 'countries': [ + "countries": [ { - 'volume': '338.000000', - 'cost': '22.0600000000', - 'ratezone': 'Zone 1', - 'ratezone_id': '1', - 'tariff': 'Tariff 1', - 'tariff_id': '1', - 'country': {'name': 'Germany'}, - 'currency': {'code': 'EUR'}, + "volume": "338.000000", + "cost": "22.0600000000", + "ratezone": "Zone 1", + "ratezone_id": "1", + "tariff": "Tariff 1", + "tariff_id": "1", + "country": {"name": "Germany"}, + "currency": {"code": "EUR"}, } ], - 'volume': 338, - 'cost': 22.06, - 'name': 'Zone 1', - 'id': 1, - 'tariff': 'Tariff 1', - 'currency': {'code': 'EUR'}, + "volume": 338, + "cost": 22.06, + "name": "Zone 1", + "id": 1, + "tariff": "Tariff 1", + "currency": {"code": "EUR"}, } ], } ], - 'total': { - 'volume': 338, - 'cost': 22.06, - 'currency': {'code': 'EUR'}, + "total": { + "volume": 338, + "cost": 22.06, + "currency": {"code": "EUR"}, }, }, }, - 'customer_org': { - 'name': 'Max Muster Self-Signup', - 'organisation_type_id': '4', - 'ext_reference': 'MG ', - 'id': 112, - 'invoice_address': { - 'name': 'Max Musterman', - 'title': None, - 'department': None, - 'street': 'Alexanderst 15', - 'zipcode': '1337', - 'city': 'Berlin', - 'country_id': '14', - 'email': None, - 'phone': '+491757280819', - 'mobile': None, - 'country': { - 'name': 'Australia', - 'country_code': '61', - 'mcc': '505', - 'iso_code': 'au', - 'latitude': '-27.000000', - 'longitude': '133.000000', - 'id': 14, + "customer_org": { + "name": "Max Muster Self-Signup", + "organisation_type_id": "4", + "ext_reference": "MG ", + "id": 112, + "invoice_address": { + "name": "Max Musterman", + "title": None, + "department": None, + "street": "Alexanderst 15", + "zipcode": "1337", + "city": "Berlin", + "country_id": "14", + "email": None, + "phone": "+491757280819", + "mobile": None, + "country": { + "name": "Australia", + "country_code": "61", + "mcc": "505", + "iso_code": "au", + "latitude": "-27.000000", + "longitude": "133.000000", + "id": 14, }, }, }, - 'issuer_org': { - 'name': '{{site.brand.api_name}} GmbH', - 'organisation_type_id': '0', - 'ext_reference': '', - 'monthly_cost_limit': None, - 'id': 2, - 'company_address': { - 'contact_id': '2', - 'organisation_id': '2', - 'contact_type_id': '5', - 'name': '{{site.brand.api_name}} GmbH', - 'title': None, - 'department': None, - 'street': 'Alexanderst. 15', - 'zipcode': '1337', - 'city': 'Berlin', - 'country_id': '74', - 'email': 'support@demo-org.com', - 'phone': '+4993149739270', - 'mobile': None, - 'country': { - 'name': 'Germany', - 'country_code': '49', - 'mcc': '262', - 'iso_code': 'de', - 'latitude': '51.000000', - 'longitude': '9.000000', - 'id': 74, + "issuer_org": { + "name": "{{site.brand.api_name}} GmbH", + "organisation_type_id": "0", + "ext_reference": "", + "monthly_cost_limit": None, + "id": 2, + "company_address": { + "contact_id": "2", + "organisation_id": "2", + "contact_type_id": "5", + "name": "{{site.brand.api_name}} GmbH", + "title": None, + "department": None, + "street": "Alexanderst. 15", + "zipcode": "1337", + "city": "Berlin", + "country_id": "74", + "email": "support@demo-org.com", + "phone": "+4993149739270", + "mobile": None, + "country": { + "name": "Germany", + "country_code": "49", + "mcc": "262", + "iso_code": "de", + "latitude": "51.000000", + "longitude": "9.000000", + "id": 74, }, }, - 'bank_account': { - 'bank_account_id': '1', - 'organisation_id': '2', - 'name': "Fuerstlich Castell'sche Bank", - 'iban': 'DE78790300011001678800', - 'bic': 'FUCEDE77', - 'country_id': '74', - 'country': { - 'name': 'Germany', - 'country_code': '49', - 'mcc': '262', - 'iso_code': 'de', - 'latitude': '51.000000', - 'longitude': '9.000000', - 'id': 74, + "bank_account": { + "bank_account_id": "1", + "organisation_id": "2", + "name": "Fuerstlich Castell'sche Bank", + "iban": "DE78790300011001678800", + "bic": "FUCEDE77", + "country_id": "74", + "country": { + "name": "Germany", + "country_code": "49", + "mcc": "262", + "iso_code": "de", + "latitude": "51.000000", + "longitude": "9.000000", + "id": 74, }, }, - 'billing_config': { - 'billing_config_id': '8', - 'organisation_id': '2', - 'charging_model_id': '0', - 'payment_term_id': '1', - 'vatin': 'DE294242646', - 'invoice_issuer_info': 'Director\nMax Muster\nCompany Registration\nRegister Court Berlin\nHRB 1337', + "billing_config": { + "billing_config_id": "8", + "organisation_id": "2", + "charging_model_id": "0", + "payment_term_id": "1", + "vatin": "DE294242646", + "invoice_issuer_info": "Director\nMax Muster\nCompany Registration\nRegister Court Berlin\nHRB 1337", }, }, - 'vat': { - 'rate': '19.000000', - 'cost': 118.71320384, - 'currency': {'code': 'EUR'}, + "vat": { + "rate": "19.000000", + "cost": 118.71320384, + "currency": {"code": "EUR"}, }, - 'sub_total': {'cost': 624.806336, 'currency': {'code': 'EUR'}}, - 'total': {'cost': 743.51953984, 'currency': {'code': 'EUR'}}, - 'period': 'October 1 - October 31, 2017', + "sub_total": {"cost": 624.806336, "currency": {"code": "EUR"}}, + "total": {"cost": 743.51953984, "currency": {"code": "EUR"}}, + "period": "October 1 - October 31, 2017", }, ) @@ -1205,41 +1203,41 @@ class RetrieveBillingDataByPeriodResponse(BaseModel): class RetrieveSIMlistresponse(BaseModel): id: Optional[int] = Field(None, example=788) iccid: Optional[str] = Field(None, example=736826736473829800000) - production_date: Optional[str] = Field(None, example='8/1/2019 8:47:00 AM') - activation_date: Optional[str] = Field(None, example='8/21/2019 6:17:00 PM') + production_date: Optional[str] = Field(None, example="8/1/2019 8:47:00 AM") + activation_date: Optional[str] = Field(None, example="8/21/2019 6:17:00 PM") status: Optional[Dict[str, Any]] = Field( - None, example={'id': 1, 'description': 'Active'} + None, example={"id": 1, "description": "Active"} ) customer_org: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 13, - 'name': 'Enterprise', - 'country': {'id': 205, 'name': 'United Kingdom'}, + "id": 13, + "name": "Enterprise", + "country": {"id": 205, "name": "United Kingdom"}, }, ) issuer_org: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 11, - 'name': 'MNO', - 'country': {'id': 205, 'name': 'United Kingdom'}, + "id": 11, + "name": "MNO", + "country": {"id": 205, "name": "United Kingdom"}, }, ) endpoint: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 1, - 'name': 'arduino01', - 'imei': None, - 'imei_lock': False, - 'created': '2019-03-19T08:45:41.000Z', - 'last_updated': '2020-03-01T08:45:41.000Z', - 'organisation_id': 13, - 'service_profile_id': 1, - 'tariff_profile_id': 1, - 'tags': None, - 'ip_address': '10.1.1.9', + "id": 1, + "name": "arduino01", + "imei": None, + "imei_lock": False, + "created": "2019-03-19T08:45:41.000Z", + "last_updated": "2020-03-01T08:45:41.000Z", + "organisation_id": 13, + "service_profile_id": 1, + "tariff_profile_id": 1, + "tags": None, + "ip_address": "10.1.1.9", }, ) imsi: Optional[str] = Field(None, example=123451234567890) @@ -1247,19 +1245,19 @@ class RetrieveSIMlistresponse(BaseModel): model: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 1, - 'description': 'Java smartcard', - 'memory_size': 64, - 'formfactor': {'id': 1, 'name': '2FF', 'image': '2ff.jpg'}, - 'manufacturer': {'id': 1, 'name': 'Motorola'}, + "id": 1, + "description": "Java smartcard", + "memory_size": 64, + "formfactor": {"id": 1, "name": "2FF", "image": "2ff.jpg"}, + "manufacturer": {"id": 1, "name": "Motorola"}, }, ) reseller_org: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 22, - 'name': 'Reseller', - 'country': {'id': 205, 'name': 'United Kingdom'}, + "id": 22, + "name": "Reseller", + "country": {"id": 205, "name": "United Kingdom"}, }, ) @@ -1267,25 +1265,25 @@ class RetrieveSIMlistresponse(BaseModel): class SIMResource(BaseModel): id: Optional[int] = Field(None, example=788) iccid: Optional[str] = Field(None, example=736826736473829800000) - production_date: Optional[str] = Field(None, example='8/1/2019 8:47:00 AM') - activation_date: Optional[str] = Field(None, example='8/21/2019 6:17:00 PM') + production_date: Optional[str] = Field(None, example="8/1/2019 8:47:00 AM") + activation_date: Optional[str] = Field(None, example="8/21/2019 6:17:00 PM") status: Optional[Dict[str, Any]] = Field( - None, example={'id': 1, 'description': 'Active'} + None, example={"id": 1, "description": "Active"} ) customer_org: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 13, - 'name': 'Enterprise', - 'country': {'id': 205, 'name': 'United Kingdom'}, + "id": 13, + "name": "Enterprise", + "country": {"id": 205, "name": "United Kingdom"}, }, ) issuer_org: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 11, - 'name': 'MNO', - 'country': {'id': 205, 'name': 'United Kingdom'}, + "id": 11, + "name": "MNO", + "country": {"id": 205, "name": "United Kingdom"}, }, ) endpoint: Optional[Dict[str, Any]] = None @@ -1304,56 +1302,56 @@ class UpdateSIMrequest(BaseModel): class ListofAllAvailableSIMStatusesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Issued') + description: Optional[str] = Field(None, example="Issued") class ListofIMSIsresponse(BaseModel): id: Optional[int] = Field(None, example=17) imsi: Optional[str] = Field(None, example=112201234567008) - import_date: Optional[str] = Field(None, example='3/25/2019 1:12:39 PM') + import_date: Optional[str] = Field(None, example="3/25/2019 1:12:39 PM") status: Optional[Dict[str, Any]] = Field( - None, example={'id': 0, 'description': 'Enabled'} + None, example={"id": 0, "description": "Enabled"} ) imsi_pool: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 7, - 'description': 'MNO 1 Pool', - 'network_coverage_id': 2, - 'resource_provider': { - 'id': 3, - 'status_id': 0, - 'organisation_id': 4, - 'organisation_name': 'MNO 1', + "id": 7, + "description": "MNO 1 Pool", + "network_coverage_id": 2, + "resource_provider": { + "id": 3, + "status_id": 0, + "organisation_id": 4, + "organisation_name": "MNO 1", }, }, ) type: Optional[Dict[str, Any]] = Field( - None, example={'id': 0, 'description': 'Root IMSI'} + None, example={"id": 0, "description": "Root IMSI"} ) sim: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 20, - 'iccid': 6660000000000000000, - 'production_date': None, - 'status_id': 0, - 'sim_model_id': 3, - 'customer_org': { - 'id': 11, - 'name': 'Reseller 3 C5', - 'type_id': 3, - 'country_id': 14, - 'status_id': 0, - 'ext_reference': None, + "id": 20, + "iccid": 6660000000000000000, + "production_date": None, + "status_id": 0, + "sim_model_id": 3, + "customer_org": { + "id": 11, + "name": "Reseller 3 C5", + "type_id": 3, + "country_id": 14, + "status_id": 0, + "ext_reference": None, }, - 'issuer_org': { - 'id': 5, - 'name': 'Service Provider 1', - 'type_id': 2, - 'country_id': 205, - 'status_id': 0, - 'ext_reference': None, + "issuer_org": { + "id": 5, + "name": "Service Provider 1", + "type_id": 2, + "country_id": 205, + "status_id": 0, + "ext_reference": None, }, }, ) @@ -1375,14 +1373,14 @@ class UpdateIMSIrequest(BaseModel): class ListofallavailableIMSIstatusesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Enabled') + description: Optional[str] = Field(None, example="Enabled") class ListofTariffsresponse(BaseModel): id: Optional[int] = Field(None, example=3) - name: Optional[str] = Field(None, example='Tariff for M2M Europe') - description: Optional[str] = Field(None, example='M2M Europe: Data+SMS') - created: Optional[str] = Field(None, example='2019-01-10T09:36:58.000Z') + name: Optional[str] = Field(None, example="Tariff for M2M Europe") + description: Optional[str] = Field(None, example="M2M Europe: Data+SMS") + created: Optional[str] = Field(None, example="2019-01-10T09:36:58.000Z") default_sms_mt_rate: Optional[float] = Field(None, example=0.5) default_sms_mo_rate: Optional[float] = Field(None, example=0.4) sim_issued_rate: Optional[float] = Field(None, example=0.1) @@ -1395,18 +1393,18 @@ class ListofTariffsresponse(BaseModel): used_count: Optional[int] = Field(None, example=2) assigned_count: Optional[int] = Field(None, example=1) status: Optional[Dict[str, Any]] = Field( - None, example={'description': 'Active', 'id': 1} + None, example={"description": "Active", "id": 1} ) currency: Optional[Dict[str, Any]] = Field( - None, example={'code': 'EUR', 'symbol': '�', 'id': 1} + None, example={"code": "EUR", "symbol": "�", "id": 1} ) data_blocksize: Optional[Dict[str, Any]] = Field( - None, example={'id': 10, 'octets': 1, 'description': 'exact'} + None, example={"id": 10, "octets": 1, "description": "exact"} ) data_throttle: Optional[Dict[str, Any]] = Field( - None, example={'id': 9, 'octets': 256000, 'description': '256 kbit/s'} + None, example={"id": 9, "octets": 256000, "description": "256 kbit/s"} ) - pdp_context_definition: Optional[List[Dict[str, Any]]] = Field(None, description='') + pdp_context_definition: Optional[List[Dict[str, Any]]] = Field(None, description="") class CreateTariffrequest(BaseModel): @@ -1452,9 +1450,9 @@ class RetrieveTariffresponse(BaseModel): currency: Optional[Dict[str, Any]] = None data_blocksize: Optional[Dict[str, Any]] = None data_throttle: Optional[Dict[str, Any]] = None - pdp_context_definition: Optional[List[Dict[str, Any]]] = Field(None, description='') + pdp_context_definition: Optional[List[Dict[str, Any]]] = Field(None, description="") public: Optional[bool] = None - tariff_category: Optional[TariffCategory] = Field(None, title='TariffCategory') + tariff_category: Optional[TariffCategory] = Field(None, title="TariffCategory") class PatchTariffrequest(BaseModel): @@ -1477,19 +1475,19 @@ class PatchTariffrequest(BaseModel): class ListofavailableTariffstatusesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Staging') + description: Optional[str] = Field(None, example="Staging") class ListofRatezonesresponse(BaseModel): id: Optional[int] = Field(None, example=4) - name: Optional[str] = Field(None, example='Zone 1') + name: Optional[str] = Field(None, example="Zone 1") status: Optional[Dict[str, Any]] = Field( - None, example={'id': 0, 'description': 'Staging'} + None, example={"id": 0, "description": "Staging"} ) - valid_from: Optional[str] = Field(None, example='2020-01-01T00:00:00.000Z') + valid_from: Optional[str] = Field(None, example="2020-01-01T00:00:00.000Z") valid_until: Optional[str] = None - coverage: Optional[List[Dict[str, Any]]] = Field(None, description='') - rate: Optional[List[Dict[str, Any]]] = Field(None, description='') + coverage: Optional[List[Dict[str, Any]]] = Field(None, description="") + rate: Optional[List[Dict[str, Any]]] = Field(None, description="") class AddRatezonetoTariffrequest(BaseModel): @@ -1507,7 +1505,7 @@ class PatchRatezonerequest(BaseModel): class Listofavailableratezonestatusesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Staging') + description: Optional[str] = Field(None, example="Staging") class AddRatetoaRatezonerequest(BaseModel): @@ -1526,32 +1524,32 @@ class UpdateRateofaRatezonerequest(BaseModel): class ListofTariffProfilesresponse(BaseModel): id: Optional[int] = Field(None, example=1) - name: Optional[str] = Field(None, example='Tariff Profile 1') + name: Optional[str] = Field(None, example="Tariff Profile 1") description: Optional[str] = Field( - None, example='This Tariff Profile is for testing.' + None, example="This Tariff Profile is for testing." ) used_count: Optional[int] = Field(None, example=56) tariff: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 1, - 'name': 'Tariff 1', - 'description': 'Tariff only for testing.', - 'created': '2019-10-20T00:00:00.000Z', - 'default_sms_mt_rate': 0.06, - 'default_sms_mo_rate': 0.06, - 'sim_issued_rate': 0, - 'sim_activated_rate': 1, - 'sim_suspended_rate': 0, - 'sim_activation_rate': 0, - 'sim_reactivation_rate': 0.5, - 'sim_suspension_rate': 0.5, - 'sim_termination_rate': 0, - 'currency': {'id': 1, 'code': 'EUR', 'symbol': '�'}, - 'data_blocksize': {'id': 1, 'description': 'exact', 'octets': 1}, - 'data_throttle': {'id': 1, 'description': '256 kbit/s', 'octets': 256000}, - 'pdp_context_definition': [ - {'id': 12, 'apn': 'internet.test.com', 'default': True} + "id": 1, + "name": "Tariff 1", + "description": "Tariff only for testing.", + "created": "2019-10-20T00:00:00.000Z", + "default_sms_mt_rate": 0.06, + "default_sms_mo_rate": 0.06, + "sim_issued_rate": 0, + "sim_activated_rate": 1, + "sim_suspended_rate": 0, + "sim_activation_rate": 0, + "sim_reactivation_rate": 0.5, + "sim_suspension_rate": 0.5, + "sim_termination_rate": 0, + "currency": {"id": 1, "code": "EUR", "symbol": "�"}, + "data_blocksize": {"id": 1, "description": "exact", "octets": 1}, + "data_throttle": {"id": 1, "description": "256 kbit/s", "octets": 256000}, + "pdp_context_definition": [ + {"id": 12, "apn": "internet.test.com", "default": True} ], }, ) @@ -1569,7 +1567,7 @@ class RetrieveTariffProfileresponse(BaseModel): description: Optional[str] = None used_count: Optional[int] = None tariff: Optional[Dict[str, Any]] = None - ratezone: Optional[List[Dict[str, Any]]] = Field(None, description='') + ratezone: Optional[List[Dict[str, Any]]] = Field(None, description="") class PatchTariffProfilerequest(BaseModel): @@ -1580,7 +1578,7 @@ class PatchTariffProfilerequest(BaseModel): class RetrieveCoverageresponse(BaseModel): country: Optional[Dict[str, Any]] = Field( - None, example={'id': 1, 'name': 'Germany'} + None, example={"id": 1, "name": "Germany"} ) redundancy_count: Optional[int] = Field(None, example=2) @@ -1592,13 +1590,13 @@ class Retrievesingleselectionsresponse(BaseModel): start_date: Optional[str] = None expiry_date: Optional[str] = None selection_date: Optional[str] = None - payment: Optional[List[Dict[str, Any]]] = Field(None, description='') + payment: Optional[List[Dict[str, Any]]] = Field(None, description="") class RetrieveServiceProfileListresponse(BaseModel): id: Optional[int] = Field(None, example=232) - name: Optional[str] = Field(None, example='Smart meter') - description: Optional[str] = Field(None, example='Data + SMS - 1G limit') + name: Optional[str] = Field(None, example="Smart meter") + description: Optional[str] = Field(None, example="Data + SMS - 1G limit") used_count: Optional[str] = Field(None, example=2) allowed_3g: Optional[bool] = Field(None, example=True) allowed_4g: Optional[bool] = Field(None, example=False) @@ -1648,7 +1646,7 @@ class RetrieveaSingleServiceProfileresponse(BaseModel): moc_callback: Optional[Dict[str, Any]] = None esme_interface_type: Optional[Dict[str, Any]] = None breakout_region: Optional[Dict[str, Any]] = None - service: Optional[List[Dict[str, Any]]] = Field(None, description='') + service: Optional[List[Dict[str, Any]]] = Field(None, description="") class UpdateServiceProfilerequest(BaseModel): @@ -1674,28 +1672,28 @@ class UpdateServiceProfilerequest(BaseModel): class RetrieveAvailableServicesresponse(BaseModel): id: Optional[int] = Field(None, example=232) - description: Optional[str] = Field(None, example='Data') + description: Optional[str] = Field(None, example="Data") teleservice_code: Optional[int] = Field(None, example=767) used_with_vlr: Optional[bool] = Field(None, example=True) used_with_sgsn: Optional[bool] = Field(None, example=True) traffic_type: Optional[Dict[str, Any]] = Field( - None, example={'id': 1, 'description': 'Data', 'unit': 'MB'} + None, example={"id": 1, "description": "Data", "unit": "MB"} ) class RetrieveavailableTrafficLimitsresponse(BaseModel): id: Optional[int] = Field(None, example=111) service: Optional[Dict[str, Any]] = Field( - None, example={'id': 123, 'description': 'data'} + None, example={"id": 123, "description": "data"} ) volume: Optional[int] = Field(None, example=64) period: Optional[Dict[str, Any]] = Field( - None, example={'id': 33, 'time_units': 5, 'unit': 'Days'} + None, example={"id": 33, "time_units": 5, "unit": "Days"} ) class CreateTrafficLimitrequest(BaseModel): - service: List[Dict[str, Any]] = Field(..., description='') + service: List[Dict[str, Any]] = Field(..., description="") volume: int period: Dict[str, Any] @@ -1703,7 +1701,7 @@ class CreateTrafficLimitrequest(BaseModel): class Period(BaseModel): id: Optional[int] = None time_units: Optional[int] = None - unit: Optional[str] = Field(None, example='Days') + unit: Optional[str] = Field(None, example="Days") class ServiceTrafficLimitsResponseItem(BaseModel): @@ -1717,17 +1715,17 @@ class ServiceTrafficLimitsResponse(BaseModel): ..., example=[ { - 'id': 111, - 'volume': 64, - 'period': {'id': 33, 'time_units': 5, 'unit': 'Days'}, + "id": 111, + "volume": 64, + "period": {"id": 33, "time_units": 5, "unit": "Days"}, }, { - 'id': 234, - 'volume': 128, - 'period': {'id': 35, 'time_units': 1, 'unit': 'Months'}, + "id": 234, + "volume": 128, + "period": {"id": 35, "time_units": 1, "unit": "Months"}, }, ], - title='Service Traffic Limit', + title="Service Traffic Limit", ) @@ -1740,7 +1738,7 @@ class RetrieveDNSlistresponseItem(BaseModel): class RetrieveDNSlistresponse(BaseModel): __root__: List[RetrieveDNSlistresponseItem] = Field( - ..., title='RetrieveDNSlistresponse' + ..., title="RetrieveDNSlistresponse" ) @@ -1752,19 +1750,19 @@ class CreateaDNSentryrequest(BaseModel): class Status3(BaseModel): id: Optional[float] = Field(None, example=2) - description: Optional[str] = Field(None, example='Suspended') + description: Optional[str] = Field(None, example="Suspended") class Organisation(BaseModel): id: Optional[float] = Field(None, example=42) - name: Optional[str] = Field(None, example='Example Org') + name: Optional[str] = Field(None, example="Example Org") class User(BaseModel): id: Optional[int] = Field(None, example=42) - username: Optional[str] = Field(None, example='user@example.com') - name: Optional[str] = Field(None, example='Douglas Adams') - created: Optional[str] = Field(None, example='10/12/2019 8:00:00 AM') + username: Optional[str] = Field(None, example="user@example.com") + name: Optional[str] = Field(None, example="Douglas Adams") + created: Optional[str] = Field(None, example="10/12/2019 8:00:00 AM") status: Optional[Status3] = None organisation: Optional[Organisation] = None @@ -1773,7 +1771,7 @@ class CreateUserrequest(BaseModel): username: str name: str organisation: Dict[str, Any] - roles: List[Dict[str, Any]] = Field(..., description='') + roles: List[Dict[str, Any]] = Field(..., description="") class RetrievetheUserresponse(BaseModel): @@ -1783,8 +1781,8 @@ class RetrievetheUserresponse(BaseModel): created: Optional[str] = None status: Optional[Dict[str, Any]] = None organisation: Optional[Dict[str, Any]] = None - roles: Optional[List[Dict[str, Any]]] = Field(None, description='') - mfa: Optional[List[Dict[str, Any]]] = Field(None, description='') + roles: Optional[List[Dict[str, Any]]] = Field(None, description="") + mfa: Optional[List[Dict[str, Any]]] = Field(None, description="") class UpdateUserrequest(BaseModel): @@ -1804,33 +1802,33 @@ class RetrieveUserByUsernameresponse(BaseModel): class RetrieveAvailableUserStatusesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Activation Pending') + description: Optional[str] = Field(None, example="Activation Pending") class EventType(BaseModel): id: Optional[float] = Field(None, example=10) - description: Optional[str] = Field(None, example='User authentication failed') + description: Optional[str] = Field(None, example="User authentication failed") class EventSource(BaseModel): id: Optional[float] = Field(None, example=2) - description: Optional[str] = Field(None, example='API') + description: Optional[str] = Field(None, example="API") class EventSeverity(BaseModel): id: Optional[float] = Field(None, example=1) - description: Optional[str] = Field(None, example='Warning') + description: Optional[str] = Field(None, example="Warning") class Organisation1(BaseModel): id: Optional[float] = Field(None, example=42) - name: Optional[str] = Field(None, example='Example Org') + name: Optional[str] = Field(None, example="Example Org") class User1(BaseModel): id: Optional[float] = Field(None, example=10) - username: Optional[str] = Field(None, example='admin@example.com') - name: Optional[str] = Field(None, example='Ford Prefect') + username: Optional[str] = Field(None, example="admin@example.com") + name: Optional[str] = Field(None, example="Ford Prefect") class Event(BaseModel): @@ -1840,7 +1838,7 @@ class Event(BaseModel): None, example="Failed authentication request from 'admin@example.com', Reason: invalid password from IP 1.2.3.4", ) - timestamp: Optional[str] = Field(None, example='5/8/2017 10:56:25 AM') + timestamp: Optional[str] = Field(None, example="5/8/2017 10:56:25 AM") event_type: Optional[EventType] = None event_source: Optional[EventSource] = None event_severity: Optional[EventSeverity] = None @@ -1855,23 +1853,23 @@ class RetrieveEventsresponse4(BaseModel): ..., example=" Failed authentication request from 'ford.prefect@hitchhikerguide.net', Reason: invalid passwort from IP 1.2.3.4", ) - timestamp: str = Field(..., example='5/8/2017 10:56:25 AM') + timestamp: str = Field(..., example="5/8/2017 10:56:25 AM") event_type: Dict[str, Any] = Field( - ..., example={'id': 6, 'description': 'User authentication failed'} + ..., example={"id": 6, "description": "User authentication failed"} ) - event_source: Dict[str, Any] = Field(..., example={'id': 2, 'description': 'API'}) + event_source: Dict[str, Any] = Field(..., example={"id": 2, "description": "API"}) event_severity: Dict[str, Any] = Field( - ..., example={'id': 1, 'description': 'Warn'} + ..., example={"id": 1, "description": "Warn"} ) organisation: Dict[str, Any] = Field( - ..., example={'id': 123, 'name': 'Seeley & Co.'} + ..., example={"id": 123, "name": "Seeley & Co."} ) user: Dict[str, Any] = Field( ..., example={ - 'id': 42, - 'username': 'ford.prefect@hitchhikerguide.net', - 'name': 'Ford Prefect', + "id": 42, + "username": "ford.prefect@hitchhikerguide.net", + "name": "Ford Prefect", }, ) @@ -1883,7 +1881,7 @@ class AccountActivationrequest(BaseModel): class ReSendActivationMailrequest(BaseModel): username: str - g_recaptcha_response: str = Field(..., alias='g-recaptcha-response') + g_recaptcha_response: str = Field(..., alias="g-recaptcha-response") class Id4(Enum): @@ -1892,7 +1890,7 @@ class Id4(Enum): class Status4(BaseModel): - id: Optional[Id4] = Field(None, description='`0` - disabled\n`1` - enabled\n') + id: Optional[Id4] = Field(None, description="`0` - disabled\n`1` - enabled\n") class CoverageUpdateVPLMNStatusPatch(BaseModel): @@ -1908,12 +1906,12 @@ class ChangePassword422response(BaseModel): error_code: Optional[int] = None error_token: Optional[str] = None message: Optional[str] = None - errors: Optional[List[Dict[str, Any]]] = Field(None, description='') + errors: Optional[List[Dict[str, Any]]] = Field(None, description="") class RetrieveownIPAddressSpacesresponse(BaseModel): id: Optional[int] = Field(None, example=1) - ip_address_space: Optional[str] = Field(None, example='10.199.128.0/18') + ip_address_space: Optional[str] = Field(None, example="10.199.128.0/18") ip_address_version: Optional[int] = Field(None, example=4) used_count: Optional[int] = Field(None, example=2) available_count: Optional[int] = Field(None, example=16380) @@ -1921,15 +1919,15 @@ class RetrieveownIPAddressSpacesresponse(BaseModel): class RetrieveAvailableAddressSpacesresponse(BaseModel): id: Optional[int] = Field(None, example=1) - ip_address_space: Optional[str] = Field(None, example='10.199.128.0/18') + ip_address_space: Optional[str] = Field(None, example="10.199.128.0/18") ip_address_version: Optional[int] = Field(None, example=4) class Field204Response(BaseModel): __root__: Any = Field( ..., - description='The server has successfully fulfilled the request and that there is no additional content to send in the response payload body.', - title='204 Response', + description="The server has successfully fulfilled the request and that there is no additional content to send in the response payload body.", + title="204 Response", ) @@ -1940,115 +1938,115 @@ class RetrieveEventsresponse5(BaseModel): ..., example="MFA key with Id '1' of Type 'Time-Based One-Time Password' deleted for user 'root@localhost'", ) - timestamp: str = Field(..., example='5/5/2017 12:00:30 PM') + timestamp: str = Field(..., example="5/5/2017 12:00:30 PM") event_type: Dict[str, Any] = Field( - ..., example={'id': 14, 'description': 'Multi-factor Authentication'} + ..., example={"id": 14, "description": "Multi-factor Authentication"} ) - event_source: Dict[str, Any] = Field(..., example={'id': 2, 'description': 'API'}) + event_source: Dict[str, Any] = Field(..., example={"id": 2, "description": "API"}) event_severity: Dict[str, Any] = Field( - ..., example={'id': 0, 'description': 'Info'} + ..., example={"id": 0, "description": "Info"} ) - organisation: Dict[str, Any] = Field(..., example={'id': 4, 'name': 'MNO 1'}) + organisation: Dict[str, Any] = Field(..., example={"id": 4, "name": "MNO 1"}) user: Optional[Dict[str, Any]] = Field( None, - example={'id': 2, 'username': 'eabbot@flatland.org', 'name': 'Edwin Abbot'}, + example={"id": 2, "username": "eabbot@flatland.org", "name": "Edwin Abbot"}, ) endpoint: Optional[Dict[str, Any]] = Field( None, example={ - 'name': 'Monitoring201', - 'tags': 'Monitoring', - 'ip_address': '10.199.6.39', - 'imei': None, - 'id': 69, + "name": "Monitoring201", + "tags": "Monitoring", + "ip_address": "10.199.6.39", + "imei": None, + "id": 69, }, ) sim: Optional[Dict[str, Any]] = Field( None, example={ - 'iccid': 8988317000000000000, - 'production_date': '2019-12-17T13:26:13.000Z', - 'id': 110, + "iccid": 8988317000000000000, + "production_date": "2019-12-17T13:26:13.000Z", + "id": 110, }, ) imsi: Optional[Dict[str, Any]] = Field( None, example={ - 'imsi': 901430000000114, - 'import_date': '2019-12-17T13:26:08.000Z', - 'id': 110, + "imsi": 901430000000114, + "import_date": "2019-12-17T13:26:08.000Z", + "id": 110, }, ) detail: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 2, - 'name': 'Telekom', - 'country': { - 'id': 74, - 'name': 'Germany', - 'country_code': 49, - 'mcc': 262, - 'iso_code': 'de', + "id": 2, + "name": "Telekom", + "country": { + "id": 74, + "name": "Germany", + "country_code": 49, + "mcc": 262, + "iso_code": "de", }, - 'tapcode': [{'id': 1, 'tapcode': 'DEUD1'}], - 'mnc': [{'id': 2, 'mnc': 1}], + "tapcode": [{"id": 1, "tapcode": "DEUD1"}], + "mnc": [{"id": 2, "mnc": 1}], }, ) class RetrieveEventTypesresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Generic') + description: Optional[str] = Field(None, example="Generic") class RetrieveAvailableCountriesresponse(BaseModel): id: Optional[int] = Field(None, example=1) - name: Optional[str] = Field(None, example='Germany') + name: Optional[str] = Field(None, example="Germany") country_code: Optional[str] = Field(None, example=49) mcc: Optional[str] = Field(None, example=262) - iso_code: Optional[str] = Field(None, example='de') + iso_code: Optional[str] = Field(None, example="de") class RetrieveAvailableCurrenciesresponse(BaseModel): id: Optional[int] = Field(None, example=1) - code: Optional[str] = Field(None, example='EUR') - symbol: Optional[str] = Field(None, example='�') + code: Optional[str] = Field(None, example="EUR") + symbol: Optional[str] = Field(None, example="�") class RetrieveAvailableDataBlocksizesresponse(BaseModel): id: Optional[int] = Field(None, example=1) octets: Optional[str] = Field(None, example=1) - description: Optional[str] = Field(None, example='exact') + description: Optional[str] = Field(None, example="exact") class RetrieveAvailableDataThrottlesresponse(BaseModel): id: Optional[int] = Field(None, example=1) octets: Optional[str] = Field(None, example=128000) - description: Optional[str] = Field(None, example='128 kbit/s') + description: Optional[str] = Field(None, example="128 kbit/s") class RetrieveAvailableOperatorsresponse(BaseModel): id: Optional[int] = Field(None, example=2) - name: Optional[str] = Field(None, example='Telekom') + name: Optional[str] = Field(None, example="Telekom") country: Optional[Dict[str, Any]] = Field( None, example={ - 'id': 74, - 'name': 'Germany', - 'country_code': 49, - 'mcc': 262, - 'iso_code': 'de', + "id": 74, + "name": "Germany", + "country_code": 49, + "mcc": 262, + "iso_code": "de", }, ) - tapcode: Optional[List[Dict[str, Any]]] = Field(None, description='') - mnc: Optional[List[Dict[str, Any]]] = Field(None, description='') + tapcode: Optional[List[Dict[str, Any]]] = Field(None, description="") + mnc: Optional[List[Dict[str, Any]]] = Field(None, description="") class RetrieveAvailableBreakoutRegionsresponse(BaseModel): id: Optional[int] = Field(None, example=2) - name: Optional[str] = Field(None, example='eu-west') - ip_address: Optional[str] = Field(None, example='1.2.3.4') + name: Optional[str] = Field(None, example="eu-west") + ip_address: Optional[str] = Field(None, example="1.2.3.4") class TariffPlanStatusesGetResponse(BaseModel): @@ -2056,24 +2054,24 @@ class TariffPlanStatusesGetResponse(BaseModel): ..., example=[ { - 'id': 0, - 'name': 'Staging', - 'description': 'under construction and therefore not ready to be used; any changes of the configuration are allowed', + "id": 0, + "name": "Staging", + "description": "under construction and therefore not ready to be used; any changes of the configuration are allowed", }, { - 'id': 1, - 'name': 'Active', - 'description': 'deployed and may be in use; changes to the configuration are limited', + "id": 1, + "name": "Active", + "description": "deployed and may be in use; changes to the configuration are limited", }, { - 'id': 2, - 'name': 'Deprecated', - 'description': 'not assignable anymore but remains valid for current assignments and therefore may be still in use; changes to the configuration are limited', + "id": 2, + "name": "Deprecated", + "description": "not assignable anymore but remains valid for current assignments and therefore may be still in use; changes to the configuration are limited", }, { - 'id': 3, - 'name': 'Deleted', - 'description': 'not visible to maintainers and users, but is displayed in history view, no changes to the configuration are allowed', + "id": 3, + "name": "Deleted", + "description": "not visible to maintainers and users, but is displayed in history view, no changes to the configuration are allowed", }, ], ) @@ -2084,91 +2082,91 @@ class TariffPlanConfigGetResponse(BaseModel): ..., example=[ { - 'id': 24, - 'name': 'Data Flat', - 'description': 'Unlimited Data Usage, ...', - 'status': {'id': 1, 'name': 'Active'}, - 'public_for_child_organisations': False, - 'owner_organisation': {'id': 1, 'name': 'Own Organisation'}, - 'min_runtime': { - 'id': 18, - 'number_of_units': 18, - 'unit': {'id': 1, 'name': 'month'}, + "id": 24, + "name": "Data Flat", + "description": "Unlimited Data Usage, ...", + "status": {"id": 1, "name": "Active"}, + "public_for_child_organisations": False, + "owner_organisation": {"id": 1, "name": "Own Organisation"}, + "min_runtime": { + "id": 18, + "number_of_units": 18, + "unit": {"id": 1, "name": "month"}, }, - 'deprecation_date': '2018-05-20T00:00:00.000Z', - 'payment': [ + "deprecation_date": "2018-05-20T00:00:00.000Z", + "payment": [ { - 'id': 2, - 'interval': {'id': 1, 'name': 'month'}, - 'amount': 29.99, - 'currency': {'id': 1, 'symbol': '�'}, + "id": 2, + "interval": {"id": 1, "name": "month"}, + "amount": 29.99, + "currency": {"id": 1, "symbol": "�"}, }, { - 'id': 5, - 'interval': {'id': 2, 'name': 'contract term'}, - 'amount': 450, - 'currency': {'id': 1, 'symbol': '�'}, + "id": 5, + "interval": {"id": 2, "name": "contract term"}, + "amount": 450, + "currency": {"id": 1, "symbol": "�"}, }, ], - 'elements': [ + "elements": [ { - 'id': 3, - 'name': 'max. active SIMs per month', - 'status': { - 'id': 1, - 'name': 'Active', - 'description': 'deployed and may be in use; changes to the configuration are limited', + "id": 3, + "name": "max. active SIMs per month", + "status": { + "id": 1, + "name": "Active", + "description": "deployed and may be in use; changes to the configuration are limited", }, - 'optional': False, + "optional": False, }, { - 'id': 13, - 'name': 'additional SIM package', - 'status': { - 'id': 1, - 'name': 'Active', - 'description': 'deployed and may be in use; changes to the configuration are limited', + "id": 13, + "name": "additional SIM package", + "status": { + "id": 1, + "name": "Active", + "description": "deployed and may be in use; changes to the configuration are limited", }, - 'optional': True, + "optional": True, }, ], }, { - 'id': 28, - 'name': 'Data Flat & SMS Flat', - 'description': 'Unlimited Data Usage and SMS Flat ...', - 'status': {'id': 1, 'name': 'Active'}, - 'public_for_child_organisations': True, - 'owner_organisation': {'id': 2, 'name': 'Child Organisation'}, - 'min_runtime': { - 'id': 24, - 'number_of_units': 24, - 'unit': {'id': 1, 'name': 'month'}, + "id": 28, + "name": "Data Flat & SMS Flat", + "description": "Unlimited Data Usage and SMS Flat ...", + "status": {"id": 1, "name": "Active"}, + "public_for_child_organisations": True, + "owner_organisation": {"id": 2, "name": "Child Organisation"}, + "min_runtime": { + "id": 24, + "number_of_units": 24, + "unit": {"id": 1, "name": "month"}, }, - 'payment': [ + "payment": [ { - 'id': 2, - 'interval': {'id': 1, 'name': 'month'}, - 'amount': 39.99, - 'currency': {'id': 1, 'symbol': '�'}, + "id": 2, + "interval": {"id": 1, "name": "month"}, + "amount": 39.99, + "currency": {"id": 1, "symbol": "�"}, }, { - 'id': 5, - 'interval': {'id': 2, 'name': 'contract term'}, - 'amount': 800, - 'currency': {'id': 1, 'symbol': '�'}, + "id": 5, + "interval": {"id": 2, "name": "contract term"}, + "amount": 800, + "currency": {"id": 1, "symbol": "�"}, }, ], - 'elements': [ + "elements": [ { - 'id': 8, - 'name': '100 additional active sims', - 'status': { - 'id': 1, - 'name': 'Active', - 'description': 'deployed and may be in use; changes to the configuration are limited', + "id": 8, + "name": "100 additional active sims", + "status": { + "id": 1, + "name": "Active", + "description": "deployed and may be in use; changes to the configuration are limited", }, - 'optional': True, + "optional": True, } ], }, @@ -2178,7 +2176,7 @@ class TariffPlanConfigGetResponse(BaseModel): class RetrieveAvailableESMEInterfaceTypesresponse(BaseModel): id: int = Field(..., example=1) - description: str = Field(..., example='SMPP') + description: str = Field(..., example="SMPP") class PDPContextDefinitionsGetResponse(BaseModel): @@ -2222,7 +2220,7 @@ class RatType1(BaseModel): class QoSDefinitionCreateRequest(BaseModel): - rat_type: Optional[RatType1] = Field(None, example={'id': 23211}, title='HasId') + rat_type: Optional[RatType1] = Field(None, example={"id": 23211}, title="HasId") max_bandwidth_dl: Optional[conint(ge=0, le=4294967295)] = None max_bandwidth_ul: Optional[conint(ge=0, le=4294967295)] = None @@ -2233,7 +2231,7 @@ class RatType2(BaseModel): class QoSDefinitionGetResponse(BaseModel): - rat_type: Optional[RatType2] = Field(None, title='RAT Type') + rat_type: Optional[RatType2] = Field(None, title="RAT Type") max_bandwidth_dl: Optional[int] = None max_bandwidth_ul: Optional[int] = None @@ -2259,12 +2257,12 @@ class IOTCreate(BaseModel): mnc: Optional[int] = None mcc: Optional[int] = None network_coverage: Optional[NetworkCoverage] = Field( - None, example={'id': 23211}, title='HasId' + None, example={"id": 23211}, title="HasId" ) traffic_type: Optional[TrafficType9] = Field( - None, example={'id': 23211}, title='HasId' + None, example={"id": 23211}, title="HasId" ) - currency: Optional[Currency6] = Field(None, example={'id': 23211}, title='HasId') + currency: Optional[Currency6] = Field(None, example={"id": 23211}, title="HasId") rate: Optional[float] = None volume: Optional[int] = None blocksize: Optional[int] = None @@ -2276,20 +2274,20 @@ class HasId(BaseModel): class LocalDate(BaseModel): - __root__: constr(regex=r'^\d{4}-\d{2}-\d{2}$') = Field( + __root__: constr(regex=r"^\d{4}-\d{2}-\d{2}$") = Field( ..., - description='Local date in format YYYY-MM-DD without a time', - example='2049-01-01T00:00:00.000Z', - title='Local Date without Time', + description="Local date in format YYYY-MM-DD without a time", + example="2049-01-01T00:00:00.000Z", + title="Local Date without Time", ) class LocalDateTime(BaseModel): - __root__: constr(regex=r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\{2}$') = Field( + __root__: constr(regex=r"^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\{2}$") = Field( ..., - description='Local date in format YYYY-MM-DD HH:mm:ss with a time.\nUsually interpreted in UTC Timezone, but generally unbound.\n', - example='2049-01-01T12:11:33.000Z', - title='Local Date with Time', + description="Local date in format YYYY-MM-DD HH:mm:ss with a time.\nUsually interpreted in UTC Timezone, but generally unbound.\n", + example="2049-01-01T12:11:33.000Z", + title="Local Date with Time", ) @@ -2393,23 +2391,23 @@ class SmsRoutingList1(BaseModel): id: Optional[int] = Field( None, example={ - 'description': 'Test Routing Entry', - 'id': 39, - 'organisation': { - 'name': 'org2', - 'organisation_type_id': '0', - 'country_id': '219', - 'organisation_status_id': '0', - 'ext_reference': '--', - 'monthly_cost_limit': None, - 'currency_id': '1', - 'organisation_class_id': '0', - 'created': '2020-02-01T00:00:00.000Z', - 'verification_type_id': None, - 'verification': '', - 'brand_id': '1', - 'default_sms_routing_id': None, - 'id': 2, + "description": "Test Routing Entry", + "id": 39, + "organisation": { + "name": "org2", + "organisation_type_id": "0", + "country_id": "219", + "organisation_status_id": "0", + "ext_reference": "--", + "monthly_cost_limit": None, + "currency_id": "1", + "organisation_class_id": "0", + "created": "2020-02-01T00:00:00.000Z", + "verification_type_id": None, + "verification": "", + "brand_id": "1", + "default_sms_routing_id": None, + "id": 2, }, }, ) @@ -2515,9 +2513,9 @@ class SmsRoutingDataCreateUpdateRequest(BaseModel): class GetEntryPoints(BaseModel): - method: str = Field(..., example='GET') - uri: str = Field(..., example='/api/v1/endpoint/:id') - description: str = Field(..., example='Retrieve single Endpoint details by id') + method: str = Field(..., example="GET") + uri: str = Field(..., example="/api/v1/endpoint/:id") + description: str = Field(..., example="Retrieve single Endpoint details by id") class OperatorPostRequest(BaseModel): @@ -2542,32 +2540,32 @@ class ActivateMFAKeyrequest(BaseModel): class MFAKeyStatusLookupresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Activation Pending') + description: Optional[str] = Field(None, example="Activation Pending") class MFAKeyTypeLookupresponse(BaseModel): id: Optional[int] = Field(None, example=0) - description: Optional[str] = Field(None, example='Time-Based One-Time Password') + description: Optional[str] = Field(None, example="Time-Based One-Time Password") class Listoftrusteddevicesresponse(BaseModel): id: Optional[int] = Field(None, example=16) - operating_system: Optional[str] = Field(None, example='Ubuntu 16.04.2 LTS (Xenial)') - browser: Optional[str] = Field(None, example='Mozilla Firefox') - activation_date: Optional[str] = Field(None, example='2020-02-20T10:00:00.000Z') + operating_system: Optional[str] = Field(None, example="Ubuntu 16.04.2 LTS (Xenial)") + browser: Optional[str] = Field(None, example="Mozilla Firefox") + activation_date: Optional[str] = Field(None, example="2020-02-20T10:00:00.000Z") class ListofApplicationTokensresponse(BaseModel): id: Optional[int] = Field(None, example=1) - description: Optional[str] = Field(None, example='App Test Token') - created: Optional[str] = Field(None, example='2020-02-20T10:00:00.000Z') + description: Optional[str] = Field(None, example="App Test Token") + created: Optional[str] = Field(None, example="2020-02-20T10:00:00.000Z") status: Optional[Dict[str, Any]] = Field( - None, example={'id': 0, 'description': 'Activated'} + None, example={"id": 0, "description": "Activated"} ) - expiry_date: Optional[str] = Field(None, example='2020-02-20T10:00:00.000Z') - ip: Optional[str] = Field(None, example='10.88.0.139/32') + expiry_date: Optional[str] = Field(None, example="2020-02-20T10:00:00.000Z") + ip: Optional[str] = Field(None, example="10.88.0.139/32") creator: Optional[Dict[str, Any]] = Field( - None, example={'id': 6, 'name': 'Master User', 'username': 'org-owner@org.com'} + None, example={"id": 6, "name": "Master User", "username": "org-owner@org.com"} ) @@ -2642,16 +2640,16 @@ class Endpoint(BaseModel): id: Optional[int] = None name: str tags: Optional[str] = None - service_profile: ServiceProfile1 = Field(..., title='ServiceProfile') - tariff_profile: TariffProfile1 = Field(..., title='TariffProfile') + service_profile: ServiceProfile1 = Field(..., title="ServiceProfile") + tariff_profile: TariffProfile1 = Field(..., title="TariffProfile") ip_address: Optional[str] = None - ip_address_space: Optional[IpAddressSpace1] = Field(None, title='IpAddressSpace') - sim: Optional[Sim1] = Field(None, title='Sim') + ip_address_space: Optional[IpAddressSpace1] = Field(None, title="IpAddressSpace") + sim: Optional[Sim1] = Field(None, title="Sim") imei: Optional[str] = None imei_lock: Optional[bool] = None created: Optional[datetime] = None last_updated: Optional[datetime] = None - status: Status5 = Field(..., title='EndpointStatus') + status: Status5 = Field(..., title="EndpointStatus") class RetrieveSingleEndpointresponse(BaseModel): @@ -2687,7 +2685,7 @@ class RetrieveEndpointConnectivityStatusresponse(BaseModel): status: Optional[Dict[str, Any]] = None location: Optional[Dict[str, Any]] = None pdp_context: Optional[Dict[str, Any]] = None - services: Optional[List[str]] = Field(None, description='') + services: Optional[List[str]] = Field(None, description="") class GetEndpointLocationByIdResponse(BaseModel): @@ -2721,21 +2719,21 @@ class CloudConnectAttachment(BaseModel): description: Optional[str] = None user_id: Optional[int] = None creation_date: Optional[str] = Field( - None, description='The date this attachment was created in UTC' + None, description="The date this attachment was created in UTC" ) accept_attachment_expiry_date: Optional[str] = Field( None, - description='The expiry date of the accept attachment state in UTC.\nThis will only be returned if the breakout is of type `Transit Gateway (type_id: 1)` and in Status `Pending AWS Actvation (status_id: 2)`\n', + description="The expiry date of the accept attachment state in UTC.\nThis will only be returned if the breakout is of type `Transit Gateway (type_id: 1)` and in Status `Pending AWS Actvation (status_id: 2)`\n", ) termination_date: Optional[str] = None aws_transit_gateway_attachment_id: Optional[str] = None aws_vpn_connection_id: Optional[str] = Field( - None, description='This is only set when the breakout is a VPN attachment' + None, description="This is only set when the breakout is a VPN attachment" ) status: Optional[Status6] = None type: Optional[Type2] = None region: Optional[str] = Field( - None, description='The customer region that this attachment belongs to' + None, description="The customer region that this attachment belongs to" ) @@ -2755,27 +2753,27 @@ class GetCloudConnectAttachmentsResponseItem(BaseModel): description: Optional[str] = None user_id: Optional[int] = None creation_date: Optional[str] = Field( - None, description='The date this attachment was created in UTC' + None, description="The date this attachment was created in UTC" ) accept_attachment_expiry_date: Optional[str] = Field( None, - description='The expiry date of the accept attachment state in UTC.\nThis will only be returned if the breakout is of type `Transit Gateway (type_id: 1)` and in Status `Pending AWS Actvation (status_id: 2)`\n', + description="The expiry date of the accept attachment state in UTC.\nThis will only be returned if the breakout is of type `Transit Gateway (type_id: 1)` and in Status `Pending AWS Actvation (status_id: 2)`\n", ) termination_date: Optional[str] = None aws_transit_gateway_attachment_id: Optional[str] = None aws_vpn_connection_id: Optional[str] = Field( - None, description='This is only set when the breakout is a VPN attachment' + None, description="This is only set when the breakout is a VPN attachment" ) status: Optional[Status7] = None type: Optional[Type3] = None region: Optional[str] = Field( - None, description='The customer region that this attachment belongs to' + None, description="The customer region that this attachment belongs to" ) class GetCloudConnectAttachmentsResponse(BaseModel): __root__: List[GetCloudConnectAttachmentsResponseItem] = Field( - ..., title='GetCloudConnectAttachmentsResponse' + ..., title="GetCloudConnectAttachmentsResponse" ) @@ -2791,7 +2789,7 @@ class GetCloudConnectBreakoutTypesResponseItem(BaseModel): class GetCloudConnectBreakoutTypesResponse(BaseModel): __root__: List[GetCloudConnectBreakoutTypesResponseItem] = Field( - ..., title='GetCloudConnectBreakoutTypesResponse' + ..., title="GetCloudConnectBreakoutTypesResponse" ) @@ -2820,16 +2818,16 @@ class GetCloudConnectAttachmentByIdResponseItem(BaseModel): description: Optional[str] = None user_id: Optional[int] = None creation_date: Optional[str] = Field( - None, description='The date this attachment was created in UTC' + None, description="The date this attachment was created in UTC" ) accept_attachment_expiry_date: Optional[str] = Field( None, - description='The expiry date of the accept attachment state in UTC.\nThis will only be returned if the breakout is of type `Transit Gateway (type_id: 1)` and in Status `Pending AWS Actvation (status_id: 2)`\n', + description="The expiry date of the accept attachment state in UTC.\nThis will only be returned if the breakout is of type `Transit Gateway (type_id: 1)` and in Status `Pending AWS Actvation (status_id: 2)`\n", ) termination_date: Optional[str] = None aws_transit_gateway_attachment_id: Optional[str] = None aws_vpn_connection_id: Optional[str] = Field( - None, description='This is only set when the breakout is a VPN attachment' + None, description="This is only set when the breakout is a VPN attachment" ) status: Optional[Status8] = None id: Optional[float] = None @@ -2839,7 +2837,7 @@ class GetCloudConnectAttachmentByIdResponseItem(BaseModel): class GetCloudConnectAttachmentByIdResponse(BaseModel): __root__: List[GetCloudConnectAttachmentByIdResponseItem] = Field( - ..., title='GetCloudConnectAttachmentByIdResponse' + ..., title="GetCloudConnectAttachmentByIdResponse" ) @@ -2853,10 +2851,10 @@ class CreateCloudConnectTGWRequest(BaseModel): description: Optional[str] = None vpc_cidr: List[str] region: str = Field( - ..., description='the region that this attachment should be established to' + ..., description="the region that this attachment should be established to" ) - aws_account_id: constr(regex=r'^\d{12}$') = Field( - ..., description='12-digit identifier of the own AWS Account' + aws_account_id: constr(regex=r"^\d{12}$") = Field( + ..., description="12-digit identifier of the own AWS Account" ) @@ -2871,20 +2869,20 @@ class CreateCloudConnectVPNRequest(BaseModel): description: Optional[str] = None region: Optional[str] = None public_ip: str = Field( - ..., description='the public ip of the VPN server to attach to' + ..., description="the public ip of the VPN server to attach to" ) psk: Optional[str] = Field( None, - description='the PSK for the connection, if left empty it is generated by aws', + description="the PSK for the connection, if left empty it is generated by aws", ) asn: Optional[int] = Field( None, - description='if type = `3` is selected, this parameter must be specified and denotes the autonomous system number', + description="if type = `3` is selected, this parameter must be specified and denotes the autonomous system number", ) premise_cidr: List[str] inside_cidr: Optional[List[str]] = Field( None, - description='up to 3 private ip address ranges denoting the BGP routers CIDR. if left empty, these are generated', + description="up to 3 private ip address ranges denoting the BGP routers CIDR. if left empty, these are generated", ) @@ -2912,7 +2910,7 @@ class ListCloudConnectPricesResponseItem(BaseModel): class ListCloudConnectPricesResponse(BaseModel): __root__: List[ListCloudConnectPricesResponseItem] = Field( - ..., title='ListCloudConnectCustomResponse' + ..., title="ListCloudConnectCustomResponse" ) @@ -2952,7 +2950,7 @@ class GetCloudConnectTransitGatewaysResponseItem(BaseModel): class GetCloudConnectTransitGatewaysResponse(BaseModel): __root__: List[GetCloudConnectTransitGatewaysResponseItem] = Field( - ..., title='GetCloudConnectTransitGatewaysResponse' + ..., title="GetCloudConnectTransitGatewaysResponse" ) @@ -2976,7 +2974,7 @@ class GetCloudConnectBreakoutTypeWhitelistResponseItem(BaseModel): class GetCloudConnectBreakoutTypeWhitelistResponse(BaseModel): __root__: List[GetCloudConnectBreakoutTypeWhitelistResponseItem] = Field( - ..., title='GetCloudConnectBreakoutTypeWhitelistResponse' + ..., title="GetCloudConnectBreakoutTypeWhitelistResponse" ) diff --git a/emnify/modules/device/__init__.py b/emnify/modules/device/__init__.py index bcf655e..e69de29 100644 --- a/emnify/modules/device/__init__.py +++ b/emnify/modules/device/__init__.py @@ -1 +0,0 @@ -from .manager import DeviceManager diff --git a/emnify/modules/device/api_call_manager.py b/emnify/modules/device/api_call_manager.py index ffc1493..2612624 100644 --- a/emnify/modules/device/api_call_manager.py +++ b/emnify/modules/device/api_call_manager.py @@ -5,42 +5,44 @@ class GetAllDevicesApiCall(BaseApiManager): - request_url_prefix = '/v1/endpoint' + request_url_prefix = "/v1/endpoint" request_method_name = RequestsType.GET.value def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.response_handlers = self.response_handlers.copy() | { - 200: 'return_paginator' + 200: "return_paginator" } class GetEventsByDevice(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/event' + request_url_prefix = "/v1/endpoint/{endpoint_id}/event" request_method_name = RequestsType.GET.value def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.response_handlers = self.response_handlers.copy() | { - 200: 'return_paginator' + 200: "return_paginator" } class CreateDevice(BaseApiManager): - request_url_prefix = '/v1/endpoint' + request_url_prefix = "/v1/endpoint" request_method_name = RequestsType.POST.value - def return_success(self, response: requests.Response, client, data: dict = None, *args, **kwargs) -> True: - return int(response.headers.get('Location').split('/')[-1]) + def return_success( + self, response: requests.Response, client, data: dict = None, *args, **kwargs + ) -> True: + return int(response.headers.get("Location").split("/")[-1]) class GetAllSmsFromDevice(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/sms' + request_url_prefix = "/v1/endpoint/{endpoint_id}/sms" request_method_name = RequestsType.GET.value class SendSmsToDevice(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/sms' + request_url_prefix = "/v1/endpoint/{endpoint_id}/sms" request_method_name = RequestsType.POST.value @@ -60,40 +62,44 @@ class DeleteDevice(BaseApiManager): class GetOperatorBlacklist(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/operator_blacklist' + request_url_prefix = "/v1/endpoint/{endpoint_id}/operator_blacklist" request_method_name = RequestsType.GET.value class AddOperatorBlacklist(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/operator_blacklist/{operator_id}' + request_url_prefix = "/v1/endpoint/{endpoint_id}/operator_blacklist/{operator_id}" request_method_name = RequestsType.PUT.value - def process_exception(self, response: requests.Response, client, data: dict = None, *args, **kwargs): + def process_exception( + self, response: requests.Response, client, data: dict = None, *args, **kwargs + ): raise ValidationErrorException( - response.json().get('message', 'This operator is already in blacklist') + response.json().get("message", "This operator is already in blacklist") ) class DeleteOperatorBlacklist(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/operator_blacklist/{operator_id}' + request_url_prefix = "/v1/endpoint/{endpoint_id}/operator_blacklist/{operator_id}" request_method_name = RequestsType.DELETE.value - def process_exception(self, response: requests.Response, client, data: dict = None, *args, **kwargs): + def process_exception( + self, response: requests.Response, client, data: dict = None, *args, **kwargs + ): raise ValidationErrorException( - response.json().get('message', 'This operator is not in blacklist') + response.json().get("message", "This operator is not in blacklist") ) class ResetConnectivityPatch(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/connectivity' + request_url_prefix = "/v1/endpoint/{endpoint_id}/connectivity" request_method_name = RequestsType.PATCH.value class GetDeviceConnectivity(BaseApiManager): - request_url_prefix = '/v1/endpoint/{endpoint_id}/connectivity' + request_url_prefix = "/v1/endpoint/{endpoint_id}/connectivity" request_method_name = RequestsType.GET.value - def process_exception(self, response: requests.Response, client, data: dict = None, *args, **kwargs): - raise ValidationErrorException( - 'device_id is not valid' - ) + def process_exception( + self, response: requests.Response, client, data: dict = None, *args, **kwargs + ): + raise ValidationErrorException("device_id is not valid") diff --git a/emnify/modules/device/manager.py b/emnify/modules/device/manager.py index 3ec2c7b..8dfeffa 100644 --- a/emnify/modules/device/manager.py +++ b/emnify/modules/device/manager.py @@ -14,6 +14,7 @@ class DeviceManager: Args: client: An instance of the EMnify class used for making API requests. """ + def __init__(self, client): self.client = client @@ -65,7 +66,9 @@ def get_device_sort_enum(self): def get_device_filter_model(self) -> typing.Type[device_models.FilterDeviceModel]: return device_models.FilterDeviceModel - def get_device_sms_list(self, *, device: typing.Union[device_models.Device, int]) -> device_models.ListSms: + def get_device_sms_list( + self, *, device: typing.Union[device_models.Device, int] + ) -> device_models.ListSms: """ Returns a list of SMS from the device. @@ -74,15 +77,16 @@ def get_device_sms_list(self, *, device: typing.Union[device_models.Device, int] """ device_id = self.validate_device(device) sms_response = device_call_managers.GetAllSmsFromDevice().call_api( - client=self.client, path_params={'endpoint_id': device_id} + client=self.client, path_params={"endpoint_id": device_id} ) for sms in sms_response: yield device_models.ListSms(**sms) def send_sms( - self, *, - device: typing.Union[device_models.Device, int, device_models.RetrieveDevice], - sms: device_models.SmsCreateModel + self, + *, + device: typing.Union[device_models.Device, int, device_models.RetrieveDevice], + sms: device_models.SmsCreateModel, ) -> bool: """ Sends an SMS to the device. @@ -93,12 +97,18 @@ def send_sms( """ device_id = self.validate_device(device) if not isinstance(sms, device_models.SmsCreateModel): - raise UnexpectedArgumentException('sms argument must be SmsCreateModel instance') + raise UnexpectedArgumentException( + "sms argument must be SmsCreateModel instance" + ) return device_call_managers.SendSmsToDevice().call_api( - client=self.client, path_params={'endpoint_id': device_id}, data=sms.dict(exclude_none=True) + client=self.client, + path_params={"endpoint_id": device_id}, + data=sms.dict(exclude_none=True), ) - def update_device(self, *, device_id: int, device: device_models.UpdateDevice) -> device_models.Device: + def update_device( + self, *, device_id: int, device: device_models.UpdateDevice + ) -> device_models.Device: """ Updates the device. @@ -107,7 +117,9 @@ def update_device(self, *, device_id: int, device: device_models.UpdateDevice) - :return: True if device was updated """ return device_call_managers.UpdateDevice().call_api( - client=self.client, data=device.dict(exclude_none=True), path_params={'endpoint_id': device_id} + client=self.client, + data=device.dict(exclude_none=True), + path_params={"endpoint_id": device_id}, ) def reset_connectivity_network(self, device_id: int) -> True: @@ -118,7 +130,9 @@ def reset_connectivity_network(self, device_id: int) -> True: :return: True if reset of network was successful """ return device_call_managers.ResetConnectivityPatch().call_api( - client=self.client, path_params={'endpoint_id': device_id}, data={"location": None} + client=self.client, + path_params={"endpoint_id": device_id}, + data={"location": None}, ) def reset_connectivity_data(self, device_id: int) -> True: @@ -129,26 +143,32 @@ def reset_connectivity_data(self, device_id: int) -> True: :return: True if reset of data was successful """ return device_call_managers.ResetConnectivityPatch().call_api( - client=self.client, path_params={'endpoint_id': device_id}, data={"pdp_context": None} + client=self.client, + path_params={"endpoint_id": device_id}, + data={"pdp_context": None}, ) - def get_device_connectivity_status(self, device_id: int) -> device_models.DeviceConnectivityStatus: + def get_device_connectivity_status( + self, device_id: int + ) -> device_models.DeviceConnectivityStatus: """ Returns the device's connectivity status. :param device_id: id of device :return: DeviceConnectivityStatus model """ - return device_models.DeviceConnectivityStatus(**device_call_managers.GetDeviceConnectivity().call_api( - client=self.client, path_params={'endpoint_id': device_id} - )) + return device_models.DeviceConnectivityStatus( + **device_call_managers.GetDeviceConnectivity().call_api( + client=self.client, path_params={"endpoint_id": device_id} + ) + ) def get_devices_list( - self, - *args, - filter_model: device_models.FilterDeviceModel = None, - sort_enum: device_models.DeviceSortModel = None, - **kwargs + self, + *args, + filter_model: device_models.FilterDeviceModel = None, + sort_enum: device_models.DeviceSortModel = None, + **kwargs, ) -> typing.Generator[device_models.Device, None, None]: """ Returns a list of devices. @@ -159,9 +179,12 @@ def get_devices_list( """ query_params = None if filter_model or sort_enum: - query_params = self.__transform_all_devices_filter_params(filter_model, sort_enum) - devices_response = device_call_managers.GetAllDevicesApiCall()\ - .call_api(client=self.client, query_params=query_params, *args, **kwargs) + query_params = self.__transform_all_devices_filter_params( + filter_model, sort_enum + ) + devices_response = device_call_managers.GetAllDevicesApiCall().call_api( + client=self.client, query_params=query_params, *args, **kwargs + ) return (device_models.Device(**i) for i in devices_response) def delete_device(self, device_id: int) -> True: @@ -174,7 +197,9 @@ def delete_device(self, device_id: int) -> True: device = self.retrieve_device(device_id) if device.sim: self.release_sim(device_id) - return device_call_managers.DeleteDevice().call_api(client=self.client, path_params={'endpoint_id': device_id}) + return device_call_managers.DeleteDevice().call_api( + client=self.client, path_params={"endpoint_id": device_id} + ) def add_device_blacklist_operator(self, device_id: int, operator_id: int) -> True: """ @@ -185,7 +210,8 @@ def add_device_blacklist_operator(self, device_id: int, operator_id: int) -> Tru :return: True if operator was added to blacklist """ return device_call_managers.AddOperatorBlacklist().call_api( - client=self.client, path_params={'endpoint_id': device_id, 'operator_id': operator_id} + client=self.client, + path_params={"endpoint_id": device_id, "operator_id": operator_id}, ) def delete_device_blacklist_operator(self, device_id: int, operator_id: int): @@ -197,7 +223,8 @@ def delete_device_blacklist_operator(self, device_id: int, operator_id: int): :return: True if operator was deleted from blacklist """ return device_call_managers.DeleteOperatorBlacklist().call_api( - client=self.client, path_params={'endpoint_id': device_id, 'operator_id': operator_id} + client=self.client, + path_params={"endpoint_id": device_id, "operator_id": operator_id}, ) def get_device_operator_blacklist(self, device_id: int): @@ -208,7 +235,7 @@ def get_device_operator_blacklist(self, device_id: int): :return: list of operators """ operators_json = device_call_managers.GetOperatorBlacklist().call_api( - client=self.client, path_params={'endpoint_id': device_id} + client=self.client, path_params={"endpoint_id": device_id} ) for operator in operators_json: yield operator_models.Operator(**operator) @@ -222,16 +249,21 @@ def get_device_events_list(self, device: typing.Union[device_models.Device, int] """ device_id = self.validate_device(device) events_response = device_call_managers.GetEventsByDevice().call_api( - client=self.client, path_params={'endpoint_id': device_id} + client=self.client, path_params={"endpoint_id": device_id} ) return (device_models.DeviceEvent(**i) for i in events_response) def change_status( - self, device: typing.Union[ - device_models.UpdateDevice, device_models.Device, device_models.RetrieveDevice, int - ], - enable: bool = None, disable: bool = None + self, + device: typing.Union[ + device_models.UpdateDevice, + device_models.Device, + device_models.RetrieveDevice, + int, + ], + enable: bool = None, + disable: bool = None, ) -> bool: """ Changes the status of a device and its assigned SIM to enabled or disabled. @@ -242,13 +274,18 @@ def change_status( :raises ValidationErrorException: If neither `enable` nor `disable` is provided, or if both are provided. """ if not (enable or disable) or (enable and disable): - raise emnify_errors.ValidationErrorException('"enable" or "disable" arguments must be provided ') - new_status = emnify_constants.DeviceStatuses.ENABLED_DICT.value \ - if enable else emnify_constants.DeviceStatuses.DISABLED_DICT.value + raise emnify_errors.ValidationErrorException( + '"enable" or "disable" arguments must be provided ' + ) + new_status = ( + emnify_constants.DeviceStatuses.ENABLED_DICT.value + if enable + else emnify_constants.DeviceStatuses.DISABLED_DICT.value + ) if isinstance(device, int): device = self.retrieve_device(device) self.__check_device_status(device, new_status) - action = 'enable' if enable else 'disable' + action = "enable" if enable else "disable" return self.__change_device_status(action, device) def disable_device(self, device_id: int): @@ -258,7 +295,9 @@ def disable_device(self, device_id: int): :param device_id: id of device :return: True if device was disabled """ - device_update = self.device_update_model(status=emnify_constants.DeviceStatuses.DISABLED_DICT.value) + device_update = self.device_update_model( + status=emnify_constants.DeviceStatuses.DISABLED_DICT.value + ) self.update_device(device=device_update, device_id=device_id) def release_sim(self, device_id: int): @@ -270,11 +309,15 @@ def release_sim(self, device_id: int): """ device = self.retrieve_device(device_id=device_id) if not device.sim: - raise emnify_errors.ValidationErrorException('Device must have sim to release') + raise emnify_errors.ValidationErrorException( + "Device must have sim to release" + ) self.client.sim.suspend_sim(sim_id=device.sim.id) self.disable_device(device_id=device.id) return device_call_managers.UpdateDevice().call_api( - client=self.client, data={"sim": {"id": None}}, path_params={'endpoint_id': device_id} + client=self.client, + data={"sim": {"id": None}}, + path_params={"endpoint_id": device_id}, ) def assign_sim(self, device_id: int, sim_id: int, enable: bool = False) -> None: @@ -296,7 +339,9 @@ def assign_sim(self, device_id: int, sim_id: int, enable: bool = False) -> None: elif sim.status.id == emnify_constants.SimStatusesID.ACTIVATED_ID.value: self.change_status(device.id, enable=True) - self.update_device(device=self.device_update_model(sim={"id": sim.id}), device_id=device.id) + self.update_device( + device=self.device_update_model(sim={"id": sim.id}), device_id=device.id + ) def create_device(self, device: device_models.Device) -> bool: """ @@ -306,8 +351,12 @@ def create_device(self, device: device_models.Device) -> bool: :return: True if device was created """ if not isinstance(device, self.device_model): - raise UnexpectedArgumentException('Argument must contain filled Device model') - return device_call_managers.CreateDevice().call_api(client=self.client, data=device.dict(exclude_none=True)) + raise UnexpectedArgumentException( + "Argument must contain filled Device model" + ) + return device_call_managers.CreateDevice().call_api( + client=self.client, data=device.dict(exclude_none=True) + ) def retrieve_device(self, device_id: int) -> device_models.RetrieveDevice: """ @@ -317,58 +366,70 @@ def retrieve_device(self, device_id: int) -> device_models.RetrieveDevice: :return: Endpoint details associated with the given ID. """ if not isinstance(device_id, int) or device_id <= 0: - raise UnexpectedArgumentException('Device id must be positive integer') + raise UnexpectedArgumentException("Device id must be positive integer") response = device_call_managers.RetrieveDevice().call_api( - client=self.client, path_params={'endpoint_id': device_id} + client=self.client, path_params={"endpoint_id": device_id} ) return device_models.RetrieveDevice(**response) @staticmethod def validate_device(device: device_models.Device) -> int: - if isinstance(device, device_models.Device) or isinstance(device, device_models.RetrieveDevice): + if isinstance(device, device_models.Device) or isinstance( + device, device_models.RetrieveDevice + ): return device.id elif isinstance(device, int): return device else: - raise UnexpectedArgumentException('device must be Device instance or int') + raise UnexpectedArgumentException("device must be Device instance or int") @staticmethod def __check_device_status(device, status: dict): if status == emnify_constants.SimStatusesDict.ACTIVATED_DICT: if not device.sim: - raise emnify_errors.ValidationErrorException('Devices for activation must have sim`s') + raise emnify_errors.ValidationErrorException( + "Devices for activation must have sim`s" + ) def __change_device_status(self, action: str, device): status_dict = { - 'enable': { - 'sim_status': emnify_constants.SimStatusesDict.ACTIVATED_DICT.value, - 'device_status': emnify_constants.DeviceStatuses.ENABLED_DICT.value + "enable": { + "sim_status": emnify_constants.SimStatusesDict.ACTIVATED_DICT.value, + "device_status": emnify_constants.DeviceStatuses.ENABLED_DICT.value, + }, + "disable": { + "sim_status": emnify_constants.SimStatusesDict.SUSPENDED_DICT.value, + "device_status": emnify_constants.DeviceStatuses.DISABLED_DICT.value, }, - 'disable': { - 'sim_status': emnify_constants.SimStatusesDict.SUSPENDED_DICT.value, - 'device_status': emnify_constants.DeviceStatuses.DISABLED_DICT.value - } } - device_for_update = self.device_update_model(status=status_dict[action]['device_status']) + device_for_update = self.device_update_model( + status=status_dict[action]["device_status"] + ) self.update_device(device_id=device.id, device=device_for_update) if device.sim: - sim_update_model = self.client.sim.get_sim_update_model(status=status_dict[action]['sim_status']) + sim_update_model = self.client.sim.get_sim_update_model( + status=status_dict[action]["sim_status"] + ) self.client.sim.update_sim(sim_id=device.sim.id, sim=sim_update_model) else: - raise emnify_errors.ValidationErrorException('Can`t enable device without sim card') + raise emnify_errors.ValidationErrorException( + "Can`t enable device without sim card" + ) return True @staticmethod def __transform_all_devices_filter_params( - filter_model: device_models.FilterDeviceModel = None, - sort_enum: device_models.DeviceSortModel = None + filter_model: device_models.FilterDeviceModel = None, + sort_enum: device_models.DeviceSortModel = None, ) -> dict: query_filter = {} if filter_model: filter_dict = filter_model.dict(exclude_none=True) - query_filter['q'] = ','.join([f'{key}:{filter_dict[key]}' for key in filter_dict]) + query_filter["q"] = ",".join( + [f"{key}:{filter_dict[key]}" for key in filter_dict] + ) if sort_enum: - query_filter['sort'] = sort_enum + query_filter["sort"] = sort_enum return query_filter diff --git a/emnify/modules/device/models.py b/emnify/modules/device/models.py index 30c214b..8f83faa 100644 --- a/emnify/modules/device/models.py +++ b/emnify/modules/device/models.py @@ -16,6 +16,7 @@ class Device(generated_models.Endpoint): """ Renamed generated model """ + status: generated_models.Status sim: Optional[SimDevice] = None @@ -28,7 +29,11 @@ class CreateDevice(Device): @validator("status") @classmethod def validate_status(cls, field_value, values, field, config): - if values.get("sim") and getattr(values["sim"], "status") and values["sim"].status.id == 1: + if ( + values.get("sim") + and getattr(values["sim"], "status") + and values["sim"].status.id == 1 + ): return field_value if field_value.id == 0: # If user will try activate device without sim card @@ -41,6 +46,7 @@ class SmsCreateModel(generated_models.SubmitMTSMSrequest): """ Inherited generated model of SubmitMTSMSrequest for extra fields """ + source_address: Optional[str] = None source_address_type: Optional[Dict[str, Any]] = None expiry_date: Optional[str] = None @@ -76,6 +82,7 @@ class DeviceIdRequired(Device): """ Changed renamed model of Device for id validation """ + id: int @@ -83,6 +90,7 @@ class FilterDeviceModel(BaseModel): """ Model for validation of filter query params """ + status: Optional[int] = None last_updated: Optional[datetime.datetime] = None created: Optional[datetime.datetime] = None @@ -101,6 +109,7 @@ class GetDeviceFilterSet(BaseModel): """ Model for device list query params """ + sort: Optional[DeviceSortModel] = None q: Optional[ListQFilterDeviceListModel] = None @@ -118,6 +127,7 @@ class RetrieveDevice(Device): """ class inherited from generated model for retrieve device response """ + runtime_data: Optional[Dict[str, Any]] = None sim: SimList = None @@ -126,6 +136,7 @@ class UpdateDevice(generated_models.UpdateEndpointrequest): """ Model for update Device request with field-type validation """ + name: str = None tags: str = None status: generated_models.Status = None @@ -142,6 +153,7 @@ class DeviceConnectivityStatus(BaseModel): """ Device connectivity status can be 'ATTACHED'/'ONLINE'/'OFFLINE'/'BLOCKED' """ + status: generated_models.Status = None location: Dict[str, Any] = None services: Any = None diff --git a/emnify/modules/operator/api_call_manager.py b/emnify/modules/operator/api_call_manager.py index 136dab0..b0eaff2 100644 --- a/emnify/modules/operator/api_call_manager.py +++ b/emnify/modules/operator/api_call_manager.py @@ -1,9 +1,7 @@ -import requests from emnify.api_manager import BaseApiManager from emnify.constants import RequestsType -from emnify.errors import ValidationErrorException class GetOperatorList(BaseApiManager): - request_url_prefix = '/v1/operator' + request_url_prefix = "/v1/operator" request_method_name = RequestsType.GET.value diff --git a/emnify/modules/operator/manager.py b/emnify/modules/operator/manager.py index 4f09349..db5246c 100644 --- a/emnify/modules/operator/manager.py +++ b/emnify/modules/operator/manager.py @@ -6,9 +6,12 @@ class OperatorManager: """ Manager that allows to get a list of operators """ + def __init__(self, client): self.client = client def get_operators(self): - for operator in operator_api_manager.GetOperatorList().call_api(client=self.client): + for operator in operator_api_manager.GetOperatorList().call_api( + client=self.client + ): yield operator_models.Operator(**operator) diff --git a/emnify/modules/sim/api_call_manager.py b/emnify/modules/sim/api_call_manager.py index be080aa..d8fa690 100644 --- a/emnify/modules/sim/api_call_manager.py +++ b/emnify/modules/sim/api_call_manager.py @@ -5,29 +5,31 @@ class SimListApi(BaseApiManager): - request_url_prefix = '/v1/sim' + request_url_prefix = "/v1/sim" request_method_name = RequestsType.GET.value def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.response_handlers = self.response_handlers.copy() | { - 200: 'return_paginator' + 200: "return_paginator" } class SimActivateApi(BaseApiManager): - request_url_prefix = '/v1/sim_batch/bic/{bic}' + request_url_prefix = "/v1/sim_batch/bic/{bic}" request_method_name = RequestsType.PATCH.value - def process_exception(self, response: requests.Response, client, data: dict = None, *args, **kwargs): - raise ValidationErrorException('Invalid bic number') + def process_exception( + self, response: requests.Response, client, data: dict = None, *args, **kwargs + ): + raise ValidationErrorException("Invalid bic number") class SimUpdateApi(BaseApiManager): - request_url_prefix = '/v1/sim/{sim}' + request_url_prefix = "/v1/sim/{sim}" request_method_name = RequestsType.PATCH.value class SimRetrieveApi(BaseApiManager): - request_url_prefix = '/v1/sim/{sim}' + request_url_prefix = "/v1/sim/{sim}" request_method_name = RequestsType.GET.value diff --git a/emnify/modules/sim/manager.py b/emnify/modules/sim/manager.py index 1233b55..0218246 100644 --- a/emnify/modules/sim/manager.py +++ b/emnify/modules/sim/manager.py @@ -1,7 +1,12 @@ import typing from emnify.modules.sim import models as sim_models -from emnify.modules.sim.api_call_manager import SimListApi, SimActivateApi, SimUpdateApi, SimRetrieveApi +from emnify.modules.sim.api_call_manager import ( + SimListApi, + SimActivateApi, + SimUpdateApi, + SimRetrieveApi, +) from emnify import constants as emnify_const @@ -33,10 +38,10 @@ def get_sim_sort_enum(self): return emnify_const.SimSort def get_sim_list( - self, - without_device: bool = None, - filter_model: sim_models.SimFilter = None, - sort_enum: emnify_const.SimSort = None + self, + without_device: bool = None, + filter_model: sim_models.SimFilter = None, + sort_enum: emnify_const.SimSort = None, ) -> typing.Generator[sim_models.SimList, None, None]: """ Retrieves an iterable list of SIM`s. @@ -46,10 +51,14 @@ def get_sim_list( :param sort_enum: Model for request`s sorting """ query_params = self.__transform_sim_filter_params( - without_device=without_device, filter_model=filter_model, sort_enum=sort_enum + without_device=without_device, + filter_model=filter_model, + sort_enum=sort_enum, ) - sim_response = SimListApi().call_api(client=self.client, query_params=query_params) + sim_response = SimListApi().call_api( + client=self.client, query_params=query_params + ) return (self.get_sim_list_model(**i) for i in sim_response) @@ -59,19 +68,25 @@ def retrieve_sim(self, sim_id: int): :param sim_id: id of sim to retrieve """ - return sim_models.SimList(**SimRetrieveApi().call_api(client=self.client, path_params={'sim': sim_id})) + return sim_models.SimList( + **SimRetrieveApi().call_api(client=self.client, path_params={"sim": sim_id}) + ) - def register_sim(self, bic: str) -> typing.Union[typing.List[sim_models.SimList], sim_models.SimList]: + def register_sim( + self, bic: str + ) -> typing.Union[typing.List[sim_models.SimList], sim_models.SimList]: """ Registers SIM/batch SIMs. :param bic: BIC number of SIM/batch SIMs for registration. """ data = emnify_const.SimStatusesDict.ACTIVATED_DICT.value - sim_response = SimActivateApi().call_api(client=self.client, data=data, path_params={'bic': bic}) + sim_response = SimActivateApi().call_api( + client=self.client, data=data, path_params={"bic": bic} + ) if isinstance(sim_response, dict): - if sim_response.get('sim'): - return [self.get_sim_list_model(**data) for data in sim_response['sim']] + if sim_response.get("sim"): + return [self.get_sim_list_model(**data) for data in sim_response["sim"]] return self.get_sim_list_model(**sim_response) return [self.get_sim_list_model(**sim) for sim in sim_response] @@ -82,8 +97,11 @@ def update_sim(self, sim_id: int, sim: sim_models.SimUpdate) -> bool: :param sim_id: int of sim to update :param sim: filled sim update model """ - return SimUpdateApi() \ - .call_api(client=self.client, data=sim.dict(exclude_none=True), path_params={'sim': sim_id}) + return SimUpdateApi().call_api( + client=self.client, + data=sim.dict(exclude_none=True), + path_params={"sim": sim_id}, + ) def activate_sim(self, sim_id: int): """ @@ -93,10 +111,10 @@ def activate_sim(self, sim_id: int): :param sim_id: int of sim to update """ - return SimUpdateApi() \ - .call_api( - client=self.client, data={'status': emnify_const.SimStatusesDict.ACTIVATED_DICT.value}, - path_params={'sim': sim_id} + return SimUpdateApi().call_api( + client=self.client, + data={"status": emnify_const.SimStatusesDict.ACTIVATED_DICT.value}, + path_params={"sim": sim_id}, ) def suspend_sim(self, sim_id: int): @@ -107,28 +125,29 @@ def suspend_sim(self, sim_id: int): :param sim_id: id of sim to update """ - return SimUpdateApi() \ - .call_api( - client=self.client, data={'status': emnify_const.SimStatusesDict.SUSPENDED_DICT.value}, - path_params={'sim': sim_id} + return SimUpdateApi().call_api( + client=self.client, + data={"status": emnify_const.SimStatusesDict.SUSPENDED_DICT.value}, + path_params={"sim": sim_id}, ) @staticmethod def __transform_sim_filter_params( - filter_model: sim_models.SimFilter = None, - sort_enum: emnify_const.SimSort = None, - without_device: bool = None - + filter_model: sim_models.SimFilter = None, + sort_enum: emnify_const.SimSort = None, + without_device: bool = None, ) -> dict: query_filter = {} if filter_model: filter_dict = filter_model.dict(exclude_none=True) - query_filter['q'] = ','.join([f'{key}:{filter_dict[key]}' for key in filter_dict]) + query_filter["q"] = ",".join( + [f"{key}:{filter_dict[key]}" for key in filter_dict] + ) if sort_enum: - query_filter['sort'] = sort_enum + query_filter["sort"] = sort_enum if without_device is not None and without_device: - if query_filter.get('q'): - query_filter['q'] = query_filter['q'] + 'endpoint:null' + if query_filter.get("q"): + query_filter["q"] = query_filter["q"] + "endpoint:null" else: - query_filter['q'] = 'endpoint:null' + query_filter["q"] = "endpoint:null" return query_filter diff --git a/emnify/modules/sim/models.py b/emnify/modules/sim/models.py index af987a0..8c8da1a 100644 --- a/emnify/modules/sim/models.py +++ b/emnify/modules/sim/models.py @@ -1,13 +1,14 @@ import typing import datetime from pydantic import BaseModel, Field, types -from emnify.modules.api.models import RetrieveSIMlistresponse, Endpoint, Sim1, Status +from emnify.modules.api.models import RetrieveSIMlistresponse class SimDevice(BaseModel): """ Sim list response Device model """ + id: int = None name: str = None ip_address: str = None @@ -19,6 +20,7 @@ class IdModel(BaseModel): """ BaseModel for objects with single id field """ + id: int @@ -31,14 +33,16 @@ class SimList(RetrieveSIMlistresponse): """ Inherited generated model for sim list """ + status: SimStatus = None - device: typing.Optional[SimDevice] = Field(alias='endpoint') + device: typing.Optional[SimDevice] = Field(alias="endpoint") class SimUpdate(BaseModel): """ Model for sim partial update """ + status: SimStatus = None issuer_organisation: IdModel = None reseller_organisation: IdModel = None diff --git a/emnify/version.py b/emnify/version.py index 09ecf0c..dfe8e8c 100644 --- a/emnify/version.py +++ b/emnify/version.py @@ -1,2 +1,2 @@ # THIS FILE IS GENERATED AUTOMATICALLY, DON'T CHANGE ITS CONTENT!! -EMNIFY_PACKAGE_VERSION='0.4.2' +EMNIFY_PACKAGE_VERSION = "0.4.2" diff --git a/settings.py b/settings.py index 3cf711e..728c6f4 100644 --- a/settings.py +++ b/settings.py @@ -1,4 +1,4 @@ import os -MAIN_URL = os.environ.get('EMNIFY_SDK_API_ENDPOINT_URL', 'https://cdn.emnify.net/api') -TOKEN = os.environ.get('EMNIFY_SDK_APPLICATION_TOKEN', os.environ.get('APP_TOKEN')) +MAIN_URL = os.environ.get("EMNIFY_SDK_API_ENDPOINT_URL", "https://cdn.emnify.net/api") +TOKEN = os.environ.get("EMNIFY_SDK_APPLICATION_TOKEN", os.environ.get("APP_TOKEN")) diff --git a/setup.py b/setup.py index 699e248..20bdf15 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages import os -NAME = os.getenv('PYPI_PACKAGE_NAME') or "emnify-sdk" +NAME = os.getenv("PYPI_PACKAGE_NAME") or "emnify-sdk" VERSION = "0.4.2" # To install the library, run the following # @@ -11,9 +11,13 @@ # prerequisite: build # https://pypi.org/project/build/ -REQUIRES = ['requests>=2.27.0,<2.30.0', 'pydantic>=1.9.0,<2.0.0'] -if __name__ == '__main__': - with open('README.md', "r", encoding="utf-8") as fh: +REQUIRES = [ + "requests>=2.27.0,<2.33.0", + "urllib3>=1.21.1,<1.27", + "pydantic>=1.9.0,<2.0.0", +] +if __name__ == "__main__": + with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( @@ -29,8 +33,8 @@ }, install_requires=REQUIRES, python_requires=">=3.9", - packages=find_packages(exclude=['tests']), + packages=find_packages(exclude=["tests"]), include_package_data=True, long_description=long_description, - long_description_content_type='text/markdown' + long_description_content_type="text/markdown", ) diff --git a/tests/__init__.py b/tests/__init__.py index 3d3447a..e69de29 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +0,0 @@ -from .test_emnify import * \ No newline at end of file diff --git a/tests/test_emnify.py b/tests/test_emnify.py index 0a04d23..fd489f8 100644 --- a/tests/test_emnify.py +++ b/tests/test_emnify.py @@ -11,43 +11,46 @@ from emnify import errors as emnify_errors -@pytest.fixture(scope='module') +@pytest.fixture(scope="module") def vcr_cassette_dir(request): - return os.path.join('tests/fixtures', 'cassettes') + return os.path.join("tests/fixtures", "cassettes") def scrub_response_string(): def before_record_response(response): try: - decoded_response = json.loads(response['body']['string']) - if 'auth_token' in decoded_response: + decoded_response = json.loads(response["body"]["string"]).decode("utf-8") + if "auth_token" in decoded_response: anonymized_response = decoded_response | {"auth_token": "test"} - response['body']['string'] = json.dumps(anonymized_response).encode('UTF-8') + response["body"]["string"] = json.dumps(anonymized_response).encode( + "UTF-8" + ) except Exception as err: print(f"Can't modify response {err=}, {type(err)=}") return response return before_record_response + vcr_instance = vcr.VCR( before_record_response=scrub_response_string(), - filter_headers=['authorization'], - filter_post_data_parameters=['application_token', 'username', 'password'], + filter_headers=["authorization"], + filter_post_data_parameters=["application_token", "username", "password"], ) -class EMnifyTest(TestCase): +class EMnifyTest(TestCase): def setUp(self) -> None: - self.token = os.environ.get('EMNIFY_SDK_APPLICATION_TOKEN', 'test_token') + self.token = os.environ.get("EMNIFY_SDK_APPLICATION_TOKEN", "test_token") - @vcr_instance.use_cassette('tests/fixtures/cassettes/get_all_devices.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/get_all_devices.yaml") def test_get_devices_list(self): emnify = emnify_client(app_token=self.token) devices = [i for i in emnify.devices.get_devices_list()] self.assertGreater(len(devices), 0) self.assertIsInstance(devices[0], emnify.devices.device_model) - @vcr_instance.use_cassette('tests/fixtures/cassettes/device_events.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/device_events.yaml") def test_get_device_events_list(self): emnify = emnify_client(app_token=self.token) devices = [i for i in emnify.devices.get_devices_list()] @@ -55,22 +58,30 @@ def test_get_device_events_list(self): self.assertGreater(len(device_events), 0) self.assertIsInstance(device_events[0], emnify.devices.event_model) - @vcr_instance.use_cassette('tests/fixtures/cassettes/create_device.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/create_device.yaml") def test_create_device(self): emnify = emnify_client(app_token=self.token) for _ in range(0, 2): devices = [i for i in emnify.devices.get_devices_list()] - name = ''.join( # send any name current example are random - random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(20) + name = "".join( # send any name current example are random + random.SystemRandom().choice(string.ascii_lowercase + string.digits) + for _ in range(20) ) status = emnify.devices.status_model(id=devices[0].status.id) - tariff_profile = emnify.devices.tariff_profile_model(id=devices[0].tariff_profile.id) - service_profile = emnify.devices.service_profile_model(id=devices[0].service_profile.id) + tariff_profile = emnify.devices.tariff_profile_model( + id=devices[0].tariff_profile.id + ) + service_profile = emnify.devices.service_profile_model( + id=devices[0].service_profile.id + ) device = emnify.devices.device_create_model( - name=name, tariff_profile=tariff_profile, status=status, service_profile=service_profile + name=name, + tariff_profile=tariff_profile, + status=status, + service_profile=service_profile, ) prev_devices_count = len([i for i in emnify.devices.get_devices_list()]) @@ -80,32 +91,32 @@ def test_create_device(self): self.assertNotEqual(prev_devices_count, current_devices_count) self.assertGreater(current_devices_count, prev_devices_count) - @vcr_instance.use_cassette('tests/fixtures/cassettes/send_sms_to_device.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/send_sms_to_device.yaml") def test_send_sms(self): emnify = emnify_client(app_token=self.token) devices = [i for i in emnify.devices.get_devices_list()] - sms = emnify.devices.sms_create_model(payload='sample_test_payload') + sms = emnify.devices.sms_create_model(payload="sample_test_payload") emnify.devices.send_sms(device=devices[0], sms=sms) - @vcr_instance.use_cassette('tests/fixtures/cassettes/get_all_device_sms.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/get_all_device_sms.yaml") def test_get_device_sms_list(self): emnify = emnify_client(app_token=self.token) sms_instances = [i for i in emnify.devices.get_device_sms_list(device=11379224)] self.assertGreater(len(sms_instances), 0) self.assertIsInstance(sms_instances[0], emnify.devices.list_sms_model) - @vcr_instance.use_cassette('tests/fixtures/cassettes/get_sim_list.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/get_sim_list.yaml") def test_get_sim_list(self): emnify = emnify_client(app_token=self.token) sims = [i for i in emnify.sim.get_sim_list()] if sims: self.assertIsInstance(sims[0], emnify.sim.get_sim_list_model) - @vcr_instance.use_cassette('tests/fixtures/cassettes/activate_sim_by_bic_200.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/activate_sim_by_bic_200.yaml") def test_activate_sim_by_one_size_batch_bic_200(self): bics = [ # BIC CODES - 'valid_bic_code', - 'invalid_bic_code' + "valid_bic_code", + "invalid_bic_code", ] emnify = emnify_client(app_token=self.token) bic = bics[0] @@ -113,20 +124,20 @@ def test_activate_sim_by_one_size_batch_bic_200(self): self.assertIsInstance(response, list) self.assertIsInstance(response[0], emnify.sim.get_sim_list_model) - @vcr_instance.use_cassette('tests/fixtures/cassettes/activate_sim_by_bic_422.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/activate_sim_by_bic_422.yaml") def test_activate_sim_by_one_size_batch_bic_422(self): bics = [ # BIC CODES - 'valid_bic_code', - 'invalid_bic_code' + "valid_bic_code", + "invalid_bic_code", ] emnify = emnify_client(app_token=self.token) bic = bics[1] try: emnify.sim.register_sim(bic=bic) except emnify_errors.ValidationErrorException as e: - self.assertEqual(str(e), 'Invalid bic number') + self.assertEqual(str(e), "Invalid bic number") - @vcr_instance.use_cassette('tests/fixtures/cassettes/create_device_with_sim.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/create_device_with_sim.yaml") def test_create_device_with_sim(self): emnify = emnify_client(app_token=self.token) sims = [i for i in emnify.sim.get_sim_list()] @@ -134,69 +145,108 @@ def test_create_device_with_sim(self): self.assertIsInstance(sims[0], emnify.sim.get_sim_list_model) devices = [i for i in emnify.devices.get_devices_list()] - name = ''.join( # send any name current example are random - random.SystemRandom().choice(string.ascii_lowercase + string.digits) for _ in range(20) + name = "".join( # send any name current example are random + random.SystemRandom().choice(string.ascii_lowercase + string.digits) + for _ in range(20) ) status = emnify.devices.status_model(id=devices[0].status.id) - tariff_profile = emnify.devices.tariff_profile_model(id=devices[0].tariff_profile.id) - service_profile = emnify.devices.service_profile_model(id=devices[0].service_profile.id) + tariff_profile = emnify.devices.tariff_profile_model( + id=devices[0].tariff_profile.id + ) + service_profile = emnify.devices.service_profile_model( + id=devices[0].service_profile.id + ) sim_status = emnify.devices.status_model(id=1, description="Activated") sim = emnify.sim.get_sim_list_model(id=sims[0].id, status=sim_status) device = emnify.devices.device_create_model( - name=name, tariff_profile=tariff_profile, status=status, service_profile=service_profile, sim=sim + name=name, + tariff_profile=tariff_profile, + status=status, + service_profile=service_profile, + sim=sim, ) response = emnify.devices.create_device(device=device) self.assertEqual(response, 11380016) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_activate_disactivate_device.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_activate_disactivate_device.yaml" + ) def test_activate_disactivate_device(self): emnify = emnify_client(app_token=self.token) devices = [i for i in emnify.devices.get_devices_list()] active_device_with_sim = [ - i for i in devices if i.sim and i.status.id == emnify_const.DeviceStatuses.ENABLED_ID.value + i + for i in devices + if i.sim and i.status.id == emnify_const.DeviceStatuses.ENABLED_ID.value ][0] emnify.devices.change_status(active_device_with_sim.id, disable=True) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_update_device.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/test_update_device.yaml") def test_update_device(self): emnify = emnify_client(app_token=self.token) device = [i for i in emnify.devices.get_devices_list()][0] - new_device_name = device.name + 'new' - device_model_for_update = emnify.devices.device_update_model(name=new_device_name) - emnify.devices.update_device(device_id=device.id, device=device_model_for_update) + new_device_name = device.name + "new" + device_model_for_update = emnify.devices.device_update_model( + name=new_device_name + ) + emnify.devices.update_device( + device_id=device.id, device=device_model_for_update + ) updated_device = emnify.devices.retrieve_device(device_id=device.id) self.assertNotEqual(device.name, updated_device.name) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_update_device_with_service_profile.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_update_device_with_service_profile.yaml" + ) def test_update_device_with_service_profile(self): emnify = emnify_client(app_token=self.token) device = [i for i in emnify.devices.get_devices_list()][0] - service_profile_for_update = emnify.devices.service_profile_model(id=device.service_profile.id) - device_model_for_update = emnify.devices.device_update_model(service_profile=service_profile_for_update) - self.assertTrue(emnify.devices.update_device(device_id=device.id, device=device_model_for_update)) + service_profile_for_update = emnify.devices.service_profile_model( + id=device.service_profile.id + ) + device_model_for_update = emnify.devices.device_update_model( + service_profile=service_profile_for_update + ) + self.assertTrue( + emnify.devices.update_device( + device_id=device.id, device=device_model_for_update + ) + ) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_update_device_error_handling_device_id.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_update_device_error_handling_device_id.yaml" + ) def test_update_device_error_handling_device_id(self): for device_id in [-1, None]: with self.subTest(device_id=device_id): emnify = emnify_client(app_token=self.token) device_model_for_update = emnify.devices.device_update_model() with pytest.raises(emnify_errors.ValidationErrorException): - emnify.devices.update_device(device_id=device_id, device=device_model_for_update) + emnify.devices.update_device( + device_id=device_id, device=device_model_for_update + ) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_update_device_error_handling_service_profile.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_update_device_error_handling_service_profile.yaml" + ) def test_update_device_error_handling_service_profile_id(self): emnify = emnify_client(app_token=self.token) device = [i for i in emnify.devices.get_devices_list()][0] non_existing_service_profile_id = -1 - service_profile_for_update = emnify.devices.service_profile_model(id=non_existing_service_profile_id) - device_model_for_update = emnify.devices.device_update_model(service_profile=service_profile_for_update) + service_profile_for_update = emnify.devices.service_profile_model( + id=non_existing_service_profile_id + ) + device_model_for_update = emnify.devices.device_update_model( + service_profile=service_profile_for_update + ) with pytest.raises(emnify_errors.ValidationErrorException): - emnify.devices.update_device(device_id=device.id, device=device_model_for_update) + emnify.devices.update_device( + device_id=device.id, device=device_model_for_update + ) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_delete_device.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/test_delete_device.yaml") def test_delete_device(self): emnify = emnify_client(app_token=self.token) all_devices = [i for i in emnify.devices.get_devices_list()] @@ -204,75 +254,105 @@ def test_delete_device(self): device = emnify.devices.retrieve_device(device_id=11380016) sim_id = device.sim.id self.assertTrue(device.sim) - self.assertEqual(device.sim.status.description, 'Activated') + self.assertEqual(device.sim.status.description, "Activated") emnify.devices.delete_device(device_id=device.id) changed_sim = emnify.sim.retrieve_sim(sim_id=sim_id) len_after_delete = len([i for i in emnify.devices.get_devices_list()]) - self.assertEqual(changed_sim.status.description, 'Suspended') + self.assertEqual(changed_sim.status.description, "Suspended") self.assertGreater(len_before_delete, len_after_delete) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_list_device_blacklist.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_list_device_blacklist.yaml" + ) def test_list_device_blacklist(self): emnify = emnify_client(app_token=self.token) device_id = 11380018 - operators = [i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id)] + operators = [ + i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id) + ] self.assertGreater(len(operators), 0) - self.assertEqual(operators[0].country.name, 'Albania') + self.assertEqual(operators[0].country.name, "Albania") - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_delete_blacklist_operator.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_delete_blacklist_operator.yaml" + ) def test_delete_blacklist_operator(self): emnify = emnify_client(app_token=self.token) device_id = 11380018 - previous_operators_list = [i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id)] - emnify.devices.delete_device_blacklist_operator(device_id=device_id, operator_id=previous_operators_list[0].id) - updated_operators_list = [i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id)] + previous_operators_list = [ + i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id) + ] + emnify.devices.delete_device_blacklist_operator( + device_id=device_id, operator_id=previous_operators_list[0].id + ) + updated_operators_list = [ + i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id) + ] self.assertGreater(len(previous_operators_list), len(updated_operators_list)) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_add_blacklist_operator.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_add_blacklist_operator.yaml" + ) def test_add_blacklist_operator(self): emnify = emnify_client(app_token=self.token) device_id = 11380018 operator_id = 553 - previous_operators_list = [i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id)] - emnify.devices.add_device_blacklist_operator(device_id=device_id, operator_id=operator_id) - updated_operators_list = [i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id)] + previous_operators_list = [ + i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id) + ] + emnify.devices.add_device_blacklist_operator( + device_id=device_id, operator_id=operator_id + ) + updated_operators_list = [ + i for i in emnify.devices.get_device_operator_blacklist(device_id=device_id) + ] self.assertGreater(len(updated_operators_list), len(previous_operators_list)) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_add_blacklist_operator_error.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_add_blacklist_operator_error.yaml" + ) def test_add_blacklist_operator_error(self): emnify = emnify_client(app_token=self.token) device_id = 11380018 operator_id = 553 try: - emnify.devices.add_device_blacklist_operator(device_id=device_id, operator_id=operator_id) + emnify.devices.add_device_blacklist_operator( + device_id=device_id, operator_id=operator_id + ) except emnify_errors.ValidationErrorException: self.assertTrue(True) else: self.assertTrue(False) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_operator_list.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/test_operator_list.yaml") def test_operator_list(self): emnify = emnify_client(app_token=self.token) operators = [i for i in emnify.operator.get_operators()] self.assertGreater(len(operators), 0) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_reset_connectivity.yaml') + @vcr_instance.use_cassette("tests/fixtures/cassettes/test_reset_connectivity.yaml") def test_reset_connectivity(self): emnify = emnify_client(app_token=self.token) device_id = 12132821 self.assertTrue(emnify.devices.reset_connectivity_data(device_id=device_id)) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_reset_connectivity_network.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_reset_connectivity_network.yaml" + ) def test_reset_connectivity_network(self): emnify = emnify_client(app_token=self.token) device_id = 12132821 self.assertTrue(emnify.devices.reset_connectivity_network(device_id=device_id)) - @vcr_instance.use_cassette('tests/fixtures/cassettes/test_get_device_connectivity.yaml') + @vcr_instance.use_cassette( + "tests/fixtures/cassettes/test_get_device_connectivity.yaml" + ) def test_get_device_connectivity_data(self): emnify = emnify_client(app_token=self.token) device_id = 12132821 - connectivity_data = emnify.devices.get_device_connectivity_status(device_id=device_id) - self.assertEqual(connectivity_data.status.description, 'OFFLINE') + connectivity_data = emnify.devices.get_device_connectivity_status( + device_id=device_id + ) + self.assertEqual(connectivity_data.status.description, "OFFLINE")