From 3cee34760c60168a69fdc9fbfc59e3dfa6abae8d Mon Sep 17 00:00:00 2001 From: Tun Loakthar Date: Wed, 26 Feb 2025 15:22:57 +0000 Subject: [PATCH 01/13] Add security.md file --- SECURITY.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..1acd27d --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,26 @@ +# Security + +If you believe you have found a new security vulnerability in this repository, please report it to us as follows. + +## Reporting Security Issues + +* Please do **not** report security vulnerabilities through public GitHub issues. + +* Please create a draft security advisory on the Github page: the reporting form is under `> Security > Advisories`. The URL is https://github.com/exasol/saas-api-python/security/advisories/new. + +* If you prefer to email, please send your report to `infosec@exasol.com`. + +## Guidelines + +* When reporting a vulnerability, please include as much information as possible, including the complete steps to reproduce the issue. + +* Avoid sending us executables. + +* Feel free to include any script you wrote and used but avoid sending us scripts that download and run binaries. + +* We will prioritise reports that show how the exploits work in realistic environments. + +* We prefer all communications to be in English. + +* We do not offer financial rewards. We are happy to acknowledge your research publicly when possible. + From 81b8a28412032903b82434bc1876054750de5977 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 10:02:30 +0200 Subject: [PATCH 02/13] Relock dependencies to resolve CVE-2025-27516 for jinja2 --- doc/changes/unreleased.md | 4 ++++ poetry.lock | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 9937766..4c7804a 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -16,3 +16,7 @@ Added `streamDescription` to the models below `components` / `schemas`: ## Refactorings * #90: Updated open API client 2025-04-15 + +## Security + +* #92: Dependencies updated, especially jinja2 (3.1.5 -> 3.1.6) \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 086e4f3..b34ad68 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1028,14 +1028,14 @@ colors = ["colorama (>=0.4.6)"] [[package]] name = "jinja2" -version = "3.1.5" +version = "3.1.6" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb"}, - {file = "jinja2-3.1.5.tar.gz", hash = "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb"}, + {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, + {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, ] [package.dependencies] From 2622a40231e51546b8391f56d9b7eece1de9ec4e Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 10:07:55 +0200 Subject: [PATCH 03/13] Add .idea to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 17239eb..b1124f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .html-documentation +.idea __pycache__ /metrics.json /.lint.txt From 4b28270ba1cdf047973feeac58894b02cb8b4e7c Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 10:08:54 +0200 Subject: [PATCH 04/13] Update exasol-toolbox to 1.0.1 & related workflows * ci.yml replaces ci-cd.yml --- .github/workflows/build-and-publish.yml | 4 +- .github/workflows/{ci-cd.yml => cd.yml} | 15 +- .github/workflows/check-api-outdated.yml | 4 +- .github/workflows/check-release-tag.yml | 4 +- .github/workflows/checks.yml | 132 ++++++-- .github/workflows/ci.yml | 13 +- .github/workflows/gh-pages.yml | 14 +- .github/workflows/matrix-python.yml | 32 ++ .github/workflows/pr-merge.yml | 9 + .github/workflows/report.yml | 37 +-- .github/workflows/run-tests.yml | 20 +- noxconfig.py | 2 + poetry.lock | 366 ++++++++++++++++++++++- pyproject.toml | 2 +- 14 files changed, 572 insertions(+), 82 deletions(-) rename .github/workflows/{ci-cd.yml => cd.yml} (65%) create mode 100644 .github/workflows/matrix-python.yml diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 25ef10a..aadb811 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -10,14 +10,14 @@ jobs: cd-job: name: Continuous Delivery - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: SCM Checkout uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/cd.yml similarity index 65% rename from .github/workflows/ci-cd.yml rename to .github/workflows/cd.yml index 7d61e26..11673c9 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/cd.yml @@ -1,4 +1,4 @@ -name: CI/CD +name: CD on: push: @@ -11,15 +11,14 @@ jobs: name: Check Release Tag uses: ./.github/workflows/check-release-tag.yml - ci-job: - name: Checks - needs: [ check-tag-version-job ] - uses: ./.github/workflows/checks.yml - secrets: inherit - cd-job: name: Continuous Delivery - needs: [ ci-job ] uses: ./.github/workflows/build-and-publish.yml secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + + publish-docs: + needs: [ cd-job ] + name: Publish Documentation + uses: ./.github/workflows/gh-pages.yml + diff --git a/.github/workflows/check-api-outdated.yml b/.github/workflows/check-api-outdated.yml index 93b1e82..b74ce7e 100644 --- a/.github/workflows/check-api-outdated.yml +++ b/.github/workflows/check-api-outdated.yml @@ -17,7 +17,7 @@ jobs: check-api-outdated: name: Check API Outdated - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -26,7 +26,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 python-version: "3.10" diff --git a/.github/workflows/check-release-tag.yml b/.github/workflows/check-release-tag.yml index e27e03a..10d4e7e 100644 --- a/.github/workflows/check-release-tag.yml +++ b/.github/workflows/check-release-tag.yml @@ -7,14 +7,14 @@ jobs: check-tag-version-job: name: Check Tag Version - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: SCM Checkout uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index bcfee08..433d28e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,12 +1,13 @@ name: Checks -on: workflow_call +on: + workflow_call: jobs: - version-check-job: - name: Version Check - runs-on: ubuntu-latest + Version-Check: + name: Version + runs-on: ubuntu-24.04 steps: - name: SCM Checkout @@ -15,82 +16,153 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 - name: Check Version(s) run: poetry run version-check version.py - build-documentation-job: - name: Build Documentation - needs: [version-check-job] - runs-on: ubuntu-latest + Documentation: + name: Docs + needs: [ Version-Check ] + runs-on: ubuntu-24.04 steps: - name: SCM Checkout uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 - name: Build Documentation run: | - poetry run python -m nox -s docs:build + poetry run -- nox -s docs:build - lint-job: + build-matrix: + name: Generate Build Matrix + uses: ./.github/workflows/matrix-python.yml + + Changelog: + name: Changelog Update Check + runs-on: ubuntu-24.04 + if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }} + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 + with: + poetry-version: 2.0.1 + + - name: Run changelog update check + run: poetry run -- nox -s changelog:updated + + Lint: name: Linting (Python-${{ matrix.python-version }}) - needs: [version-check-job] - runs-on: ubuntu-latest + needs: [ Version-Check, build-matrix ] + runs-on: ubuntu-24.04 strategy: fail-fast: false - matrix: - python-version: ["3.10"] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - name: SCM Checkout uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 python-version: ${{ matrix.python-version }} - - name: Run Tests - run: poetry run nox -s lint:code + - name: Run lint + run: poetry run -- nox -s lint:code + + - name: Upload Artifacts + uses: actions/upload-artifact@v4.6.0 + with: + name: lint-python${{ matrix.python-version }} + path: | + .lint.txt + .lint.json + include-hidden-files: true - type-check-job: + Type-Check: name: Type Checking (Python-${{ matrix.python-version }}) - needs: [version-check-job] - runs-on: ubuntu-latest + needs: [ Version-Check, build-matrix ] + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 + with: + poetry-version: 2.0.1 + python-version: ${{ matrix.python-version }} + + - name: Run type-check + run: poetry run -- nox -s lint:typing + + Security: + name: Security Checks (Python-${{ matrix.python-version }}) + needs: [ Version-Check, build-matrix ] + runs-on: ubuntu-24.04 strategy: fail-fast: false - matrix: - python-version: ["3.10"] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} steps: - name: SCM Checkout uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 python-version: ${{ matrix.python-version }} - - name: Run Tests - run: poetry run nox -s lint:typing + - name: Run security linter + run: poetry run -- nox -s lint:security + + - name: Upload Artifacts + uses: actions/upload-artifact@v4.6.0 + with: + name: security-python${{ matrix.python-version }} + path: .security.json + include-hidden-files: true + + Format: + name: Format Check + runs-on: ubuntu-24.04 + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 + with: + poetry-version: 2.0.1 + + - name: Run format check + run: poetry run -- nox -s project:format tests-job: name: Tests (Python-${{ matrix.python-version }}) - needs: [build-documentation-job, lint-job, type-check-job] + needs: [ Documentation, Lint, Type-Check, Security, Format, build-matrix ] strategy: fail-fast: false - matrix: - python-version: ["3.10"] + matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }} uses: ./.github/workflows/run-tests.yml secrets: inherit with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1e7892..eafff85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,12 @@ name: CI on: - pull_request: + push: + branches-ignore: + - "github-pages/*" + - "gh-pages/*" + - "main" + - "master" jobs: @@ -17,14 +22,14 @@ jobs: gate-1: name: Gate 1 - Regular CI needs: [ ci-job ] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Branch Protection run: true slow-test-detection: name: Run Slow or Expensive Tests (e.g. SaaS)? - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Detect Slow Tests run: true @@ -42,7 +47,7 @@ jobs: gate-2: name: Gate 2 - Allow Merge - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [ run-slow-tests ] steps: - name: Branch Protection diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 8b424d2..6653c09 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,27 +1,31 @@ name: Publish Documentation -on: workflow_call +on: + workflow_call: + workflow_dispatch: jobs: documentation-job: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: SCM Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 - name: Build Documentation run: | - poetry run python -m nox -s docs:build + poetry run -- nox -s docs:multiversion - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4.4.1 + uses: JamesIves/github-pages-deploy-action@v4.7.2 with: branch: gh-pages folder: .html-documentation diff --git a/.github/workflows/matrix-python.yml b/.github/workflows/matrix-python.yml new file mode 100644 index 0000000..5d978bc --- /dev/null +++ b/.github/workflows/matrix-python.yml @@ -0,0 +1,32 @@ +name: Build Matrix (Python) + +on: + workflow_call: + outputs: + matrix: + description: "Generates the python version build matrix" + value: ${{ jobs.python_versions.outputs.matrix }} + +jobs: + python_versions: + + runs-on: ubuntu-24.04 + + steps: + - name: SCM Checkout + uses: actions/checkout@v4 + + - name: Setup Python & Poetry Environment + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 + + - name: Generate matrix + run: poetry run -- nox -s matrix:python + with: + poetry-version: 2.0.1 + + - id: set-matrix + run: | + echo "matrix=$(poetry run -- nox -s matrix:python)" >> $GITHUB_OUTPUT + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml index c221be0..99139d6 100644 --- a/.github/workflows/pr-merge.yml +++ b/.github/workflows/pr-merge.yml @@ -8,6 +8,15 @@ on: jobs: + ci-job: + name: Checks + uses: ./.github/workflows/checks.yml + secrets: inherit + publish-docs: name: Publish Documentation uses: ./.github/workflows/gh-pages.yml + + metrics: + needs: [ ci-job ] + uses: ./.github/workflows/report.yml diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml index 9a98669..56ea3e1 100644 --- a/.github/workflows/report.yml +++ b/.github/workflows/report.yml @@ -2,18 +2,13 @@ name: Status Report on: workflow_call: - secrets: - ALTERNATIVE_GITHUB_TOKEN: - required: false jobs: report: - name: Generate Status Report - if: "contains(github.event.head_commit.message, '[generate-code-metrics-report]')" - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: - GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: SCM Checkout @@ -22,26 +17,33 @@ jobs: fetch-depth: 0 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 - name: Download Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4.1.8 with: path: ./artifacts - name: Copy Artifacts into Root Folder working-directory: ./artifacts run: | - cp .coverage/.coverage ../ - cp .lint.txt/.lint.txt ../ + poetry run -- coverage combine --keep coverage-python3.10*/.coverage + # Errors during copying are ignored because they are checked in the next step + cp .coverage ../ || true + cp lint-python3.10/.lint.txt ../ || true + cp lint-python3.10/.lint.json ../ || true + cp security-python3.10/.security.json ../ || true + + - name: Validate Artifacts + run: poetry run -- nox -s artifacts:validate - name: Generate Report - run: poetry run nox -s project:report -- -- --format json | tee metrics.json + run: poetry run -- nox -s project:report -- --format json | tee metrics.json - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.6.0 with: name: metrics.json path: metrics.json @@ -49,8 +51,9 @@ jobs: - name: Generate GitHub Summary run: | echo -e "# Summary\n" >> $GITHUB_STEP_SUMMARY - poetry run nox -s project:report -- -- --format markdown >> $GITHUB_STEP_SUMMARY + poetry run -- nox -s project:report -- --format markdown >> $GITHUB_STEP_SUMMARY + poetry run -- nox -s dependency:licenses >> $GITHUB_STEP_SUMMARY echo -e "\n\n# Coverage\n" >> $GITHUB_STEP_SUMMARY - poetry run coverage report -- --format markdown >> $GITHUB_STEP_SUMMARY - echo -e "\n\n# Static Code Analysis\n" >> $GITHUB_STEP_SUMMARY - cat .lint.txt >> $GITHUB_STEP_SUMMARY + poetry run -- coverage report --format markdown >> $GITHUB_STEP_SUMMARY || true + poetry run -- tbx lint pretty-print >> $GITHUB_STEP_SUMMARY + poetry run -- tbx security pretty-print .security.json >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7df5907..a9fe799 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,7 +13,7 @@ on: jobs: tests-job: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Set pytest markers @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v4 - name: Setup Python & Poetry Environment - uses: exasol/python-toolbox/.github/actions/python-environment@0.20.0 + uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: poetry-version: 2.0.1 python-version: ${{ inputs.python-version }} @@ -41,9 +41,19 @@ jobs: export PROJECT_SHORT_TAG=$(poetry run nox -s project:get-short-tag) poetry run nox -s test:coverage -- -- + - name: Set coverage name + id: coverage-suffix + if: ${{ ! inputs.slow-tests }} + run: | + if [ "${{ inputs.slow-tests }}" == "true" ]; then + echo value='fast' >> "$GITHUB_OUTPUT" + else + echo value='slow' >> "$GITHUB_OUTPUT" + fi + - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.6.2 with: - name: .coverage + name: coverage-python${{ inputs.python-version }}-${{ steps.coverage-suffix.outputs.value }} path: .coverage - overwrite: true + include-hidden-files: true \ No newline at end of file diff --git a/noxconfig.py b/noxconfig.py index 91a064a..122e043 100644 --- a/noxconfig.py +++ b/noxconfig.py @@ -12,5 +12,7 @@ class Config: version_file: Path = ROOT_DIR / "version.py" path_filters: Iterable[str] = ("dist", ".eggs", "venv") + python_versions = ["3.10"] + PROJECT_CONFIG = Config() diff --git a/poetry.lock b/poetry.lock index b34ad68..f58ba03 100644 --- a/poetry.lock +++ b/poetry.lock @@ -208,6 +208,46 @@ d = ["aiohttp (>=3.10)"] jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] uvloop = ["uvloop (>=0.15.2)"] +[[package]] +name = "boolean-py" +version = "5.0" +description = "Define boolean algebras, create and parse boolean expressions and create custom boolean DSL." +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "boolean_py-5.0-py3-none-any.whl", hash = "sha256:ef28a70bd43115208441b53a045d1549e2f0ec6e3d08a9d142cbc41c1938e8d9"}, + {file = "boolean_py-5.0.tar.gz", hash = "sha256:60cbc4bad079753721d32649545505362c754e121570ada4658b852a3a318d95"}, +] + +[package.extras] +dev = ["build", "twine"] +docs = ["Sphinx (>=3.3.1)", "doc8 (>=0.8.1)", "sphinx-rtd-theme (>=0.5.0)", "sphinxcontrib-apidoc (>=0.3.0)"] +linting = ["black", "isort", "pycodestyle"] +testing = ["pytest (>=6,!=7.0.0)", "pytest-xdist (>=2)"] + +[[package]] +name = "cachecontrol" +version = "0.14.2" +description = "httplib2 caching for requests" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "cachecontrol-0.14.2-py3-none-any.whl", hash = "sha256:ebad2091bf12d0d200dfc2464330db638c5deb41d546f6d7aca079e87290f3b0"}, + {file = "cachecontrol-0.14.2.tar.gz", hash = "sha256:7d47d19f866409b98ff6025b6a0fca8e4c791fb31abbd95f622093894ce903a2"}, +] + +[package.dependencies] +filelock = {version = ">=3.8.0", optional = true, markers = "extra == \"filecache\""} +msgpack = ">=0.5.2,<2.0.0" +requests = ">=2.16.0" + +[package.extras] +dev = ["CacheControl[filecache,redis]", "build", "cherrypy", "codespell[tomli]", "furo", "mypy", "pytest", "pytest-cov", "ruff", "sphinx", "sphinx-copybutton", "tox", "types-redis", "types-requests"] +filecache = ["filelock (>=3.8.0)"] +redis = ["redis (>=2.10.5)"] + [[package]] name = "certifi" version = "2025.1.31" @@ -591,6 +631,41 @@ ssh = ["bcrypt (>=3.1.5)"] test = ["certifi (>=2024)", "cryptography-vectors (==44.0.1)", "pretend (>=0.7)", "pytest (>=7.4.0)", "pytest-benchmark (>=4.0)", "pytest-cov (>=2.10.1)", "pytest-xdist (>=3.5.0)"] test-randomorder = ["pytest-randomly"] +[[package]] +name = "cyclonedx-python-lib" +version = "9.1.0" +description = "Python library for CycloneDX" +optional = false +python-versions = "<4.0,>=3.8" +groups = ["dev"] +files = [ + {file = "cyclonedx_python_lib-9.1.0-py3-none-any.whl", hash = "sha256:55693fca8edaecc3363b24af14e82cc6e659eb1e8353e58b587c42652ce0fb52"}, + {file = "cyclonedx_python_lib-9.1.0.tar.gz", hash = "sha256:86935f2c88a7b47a529b93c724dbd3e903bc573f6f8bd977628a7ca1b5dadea1"}, +] + +[package.dependencies] +license-expression = ">=30,<31" +packageurl-python = ">=0.11,<2" +py-serializable = ">=2.0.0,<3.0.0" +sortedcontainers = ">=2.4.0,<3.0.0" + +[package.extras] +json-validation = ["jsonschema[format] (>=4.18,<5.0)"] +validation = ["jsonschema[format] (>=4.18,<5.0)", "lxml (>=4,<6)"] +xml-validation = ["lxml (>=4,<6)"] + +[[package]] +name = "defusedxml" +version = "0.7.1" +description = "XML bomb protection for Python stdlib modules" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["dev"] +files = [ + {file = "defusedxml-0.7.1-py2.py3-none-any.whl", hash = "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61"}, + {file = "defusedxml-0.7.1.tar.gz", hash = "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69"}, +] + [[package]] name = "dependency-groups" version = "1.3.0" @@ -652,14 +727,14 @@ files = [ [[package]] name = "exasol-toolbox" -version = "0.20.0" +version = "1.0.1" description = "Your one-stop solution for managing all standard tasks and core workflows of your Python project." optional = false python-versions = "<4.0,>=3.9" groups = ["dev"] files = [ - {file = "exasol_toolbox-0.20.0-py3-none-any.whl", hash = "sha256:c90e805dbaf0d2ec96a1fab44a00adedb55043179201f2218e10fc8ec811ce11"}, - {file = "exasol_toolbox-0.20.0.tar.gz", hash = "sha256:f7e0cf6e346b7b3af59a007a274dc1ef48195f03eba87ad6ebf8eb95740fb1ae"}, + {file = "exasol_toolbox-1.0.1-py3-none-any.whl", hash = "sha256:69e2eaf0adaa7b3d7de24dffd4d0f06d4304a270416dc51e97a23965578cd85f"}, + {file = "exasol_toolbox-1.0.1.tar.gz", hash = "sha256:19954ec725e24209b7babf473ecc33730be9d8c4e4cb1b5337c208a62edfb66e"}, ] [package.dependencies] @@ -670,10 +745,12 @@ furo = ">=2022.9.15" import-linter = ">=2.0,<3.0" importlib-resources = ">=5.12.0" isort = ">=5.12.0,<6.0.0" -jinja2 = ">=3.1.4,<4.0.0" +jinja2 = ">=3.1.6,<4.0.0" mypy = ">=0.971" myst-parser = ">=2.0.0,<4" nox = ">=2022.8.7" +pip-audit = ">=2.7.3,<3.0.0" +pip-licenses = ">=5.0.0,<6.0.0" pluggy = ">=1.5.0,<2.0.0" pre-commit = ">=4" prysk = {version = ">0.17.0,<1", extras = ["pytest-plugin"]} @@ -1044,6 +1121,25 @@ MarkupSafe = ">=2.0" [package.extras] i18n = ["Babel (>=2.7)"] +[[package]] +name = "license-expression" +version = "30.4.1" +description = "license-expression is a comprehensive utility library to parse, compare, simplify and normalize license expressions (such as SPDX license expressions) using boolean logic." +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "license_expression-30.4.1-py3-none-any.whl", hash = "sha256:679646bc3261a17690494a3e1cada446e5ee342dbd87dcfa4a0c24cc5dce13ee"}, + {file = "license_expression-30.4.1.tar.gz", hash = "sha256:9f02105f9e0fcecba6a85dfbbed7d94ea1c3a70cf23ddbfb5adf3438a6f6fce0"}, +] + +[package.dependencies] +"boolean.py" = ">=4.0" + +[package.extras] +docs = ["Sphinx (>=5.0.2)", "doc8 (>=0.11.2)", "sphinx-autobuild", "sphinx-copybutton", "sphinx-reredirects (>=0.1.2)", "sphinx-rtd-dark-mode (>=1.3.0)", "sphinx-rtd-theme (>=1.0.0)", "sphinxcontrib-apidoc (>=0.4.0)"] +testing = ["black", "isort", "pytest (>=6,!=7.0.0)", "pytest-xdist (>=2)", "twine"] + [[package]] name = "markdown-it-py" version = "3.0.0" @@ -1184,6 +1280,80 @@ files = [ {file = "mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba"}, ] +[[package]] +name = "msgpack" +version = "1.1.0" +description = "MessagePack serializer" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "msgpack-1.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:7ad442d527a7e358a469faf43fda45aaf4ac3249c8310a82f0ccff9164e5dccd"}, + {file = "msgpack-1.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:74bed8f63f8f14d75eec75cf3d04ad581da6b914001b474a5d3cd3372c8cc27d"}, + {file = "msgpack-1.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:914571a2a5b4e7606997e169f64ce53a8b1e06f2cf2c3a7273aa106236d43dd5"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c921af52214dcbb75e6bdf6a661b23c3e6417f00c603dd2070bccb5c3ef499f5"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8ce0b22b890be5d252de90d0e0d119f363012027cf256185fc3d474c44b1b9e"}, + {file = "msgpack-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:73322a6cc57fcee3c0c57c4463d828e9428275fb85a27aa2aa1a92fdc42afd7b"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e1f3c3d21f7cf67bcf2da8e494d30a75e4cf60041d98b3f79875afb5b96f3a3f"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:64fc9068d701233effd61b19efb1485587560b66fe57b3e50d29c5d78e7fef68"}, + {file = "msgpack-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:42f754515e0f683f9c79210a5d1cad631ec3d06cea5172214d2176a42e67e19b"}, + {file = "msgpack-1.1.0-cp310-cp310-win32.whl", hash = "sha256:3df7e6b05571b3814361e8464f9304c42d2196808e0119f55d0d3e62cd5ea044"}, + {file = "msgpack-1.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:685ec345eefc757a7c8af44a3032734a739f8c45d1b0ac45efc5d8977aa4720f"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:3d364a55082fb2a7416f6c63ae383fbd903adb5a6cf78c5b96cc6316dc1cedc7"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:79ec007767b9b56860e0372085f8504db5d06bd6a327a335449508bbee9648fa"}, + {file = "msgpack-1.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6ad622bf7756d5a497d5b6836e7fc3752e2dd6f4c648e24b1803f6048596f701"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e59bca908d9ca0de3dc8684f21ebf9a690fe47b6be93236eb40b99af28b6ea6"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5e1da8f11a3dd397f0a32c76165cf0c4eb95b31013a94f6ecc0b280c05c91b59"}, + {file = "msgpack-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:452aff037287acb1d70a804ffd022b21fa2bb7c46bee884dbc864cc9024128a0"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8da4bf6d54ceed70e8861f833f83ce0814a2b72102e890cbdfe4b34764cdd66e"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:41c991beebf175faf352fb940bf2af9ad1fb77fd25f38d9142053914947cdbf6"}, + {file = "msgpack-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:a52a1f3a5af7ba1c9ace055b659189f6c669cf3657095b50f9602af3a3ba0fe5"}, + {file = "msgpack-1.1.0-cp311-cp311-win32.whl", hash = "sha256:58638690ebd0a06427c5fe1a227bb6b8b9fdc2bd07701bec13c2335c82131a88"}, + {file = "msgpack-1.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:fd2906780f25c8ed5d7b323379f6138524ba793428db5d0e9d226d3fa6aa1788"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:d46cf9e3705ea9485687aa4001a76e44748b609d260af21c4ceea7f2212a501d"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5dbad74103df937e1325cc4bfeaf57713be0b4f15e1c2da43ccdd836393e2ea2"}, + {file = "msgpack-1.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:58dfc47f8b102da61e8949708b3eafc3504509a5728f8b4ddef84bd9e16ad420"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676e5be1b472909b2ee6356ff425ebedf5142427842aa06b4dfd5117d1ca8a2"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17fb65dd0bec285907f68b15734a993ad3fc94332b5bb21b0435846228de1f39"}, + {file = "msgpack-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a51abd48c6d8ac89e0cfd4fe177c61481aca2d5e7ba42044fd218cfd8ea9899f"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2137773500afa5494a61b1208619e3871f75f27b03bcfca7b3a7023284140247"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:398b713459fea610861c8a7b62a6fec1882759f308ae0795b5413ff6a160cf3c"}, + {file = "msgpack-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:06f5fd2f6bb2a7914922d935d3b8bb4a7fff3a9a91cfce6d06c13bc42bec975b"}, + {file = "msgpack-1.1.0-cp312-cp312-win32.whl", hash = "sha256:ad33e8400e4ec17ba782f7b9cf868977d867ed784a1f5f2ab46e7ba53b6e1e1b"}, + {file = "msgpack-1.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:115a7af8ee9e8cddc10f87636767857e7e3717b7a2e97379dc2054712693e90f"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:071603e2f0771c45ad9bc65719291c568d4edf120b44eb36324dcb02a13bfddf"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:0f92a83b84e7c0749e3f12821949d79485971f087604178026085f60ce109330"}, + {file = "msgpack-1.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:4a1964df7b81285d00a84da4e70cb1383f2e665e0f1f2a7027e683956d04b734"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59caf6a4ed0d164055ccff8fe31eddc0ebc07cf7326a2aaa0dbf7a4001cd823e"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0907e1a7119b337971a689153665764adc34e89175f9a34793307d9def08e6ca"}, + {file = "msgpack-1.1.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:65553c9b6da8166e819a6aa90ad15288599b340f91d18f60b2061f402b9a4915"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7a946a8992941fea80ed4beae6bff74ffd7ee129a90b4dd5cf9c476a30e9708d"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:4b51405e36e075193bc051315dbf29168d6141ae2500ba8cd80a522964e31434"}, + {file = "msgpack-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:b4c01941fd2ff87c2a934ee6055bda4ed353a7846b8d4f341c428109e9fcde8c"}, + {file = "msgpack-1.1.0-cp313-cp313-win32.whl", hash = "sha256:7c9a35ce2c2573bada929e0b7b3576de647b0defbd25f5139dcdaba0ae35a4cc"}, + {file = "msgpack-1.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:bce7d9e614a04d0883af0b3d4d501171fbfca038f12c77fa838d9f198147a23f"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c40ffa9a15d74e05ba1fe2681ea33b9caffd886675412612d93ab17b58ea2fec"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f1ba6136e650898082d9d5a5217d5906d1e138024f836ff48691784bbe1adf96"}, + {file = "msgpack-1.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e0856a2b7e8dcb874be44fea031d22e5b3a19121be92a1e098f46068a11b0870"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:471e27a5787a2e3f974ba023f9e265a8c7cfd373632247deb225617e3100a3c7"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:646afc8102935a388ffc3914b336d22d1c2d6209c773f3eb5dd4d6d3b6f8c1cb"}, + {file = "msgpack-1.1.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:13599f8829cfbe0158f6456374e9eea9f44eee08076291771d8ae93eda56607f"}, + {file = "msgpack-1.1.0-cp38-cp38-win32.whl", hash = "sha256:8a84efb768fb968381e525eeeb3d92857e4985aacc39f3c47ffd00eb4509315b"}, + {file = "msgpack-1.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:879a7b7b0ad82481c52d3c7eb99bf6f0645dbdec5134a4bddbd16f3506947feb"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:53258eeb7a80fc46f62fd59c876957a2d0e15e6449a9e71842b6d24419d88ca1"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7e7b853bbc44fb03fbdba34feb4bd414322180135e2cb5164f20ce1c9795ee48"}, + {file = "msgpack-1.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3e9b4936df53b970513eac1758f3882c88658a220b58dcc1e39606dccaaf01c"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:46c34e99110762a76e3911fc923222472c9d681f1094096ac4102c18319e6468"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a706d1e74dd3dea05cb54580d9bd8b2880e9264856ce5068027eed09680aa74"}, + {file = "msgpack-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:534480ee5690ab3cbed89d4c8971a5c631b69a8c0883ecfea96c19118510c846"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:8cf9e8c3a2153934a23ac160cc4cba0ec035f6867c8013cc6077a79823370346"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:3180065ec2abbe13a4ad37688b61b99d7f9e012a535b930e0e683ad6bc30155b"}, + {file = "msgpack-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:c5a91481a3cc573ac8c0d9aace09345d989dc4a0202b7fcb312c88c26d4e71a8"}, + {file = "msgpack-1.1.0-cp39-cp39-win32.whl", hash = "sha256:f80bc7d47f76089633763f952e67f8214cb7b3ee6bfa489b3cb6a84cfac114cd"}, + {file = "msgpack-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:4d1b7ff2d6146e16e8bd665ac726a89c74163ef8cd39fa8c1087d4e52d3a2325"}, + {file = "msgpack-1.1.0.tar.gz", hash = "sha256:dd432ccc2c72b914e4cb77afce64aab761c1137cc698be3984eee260bcb2896e"}, +] + [[package]] name = "mypy" version = "1.15.0" @@ -1339,6 +1509,24 @@ shellingham = ">=1.3.2,<2.0.0" typer = ">0.6,<0.16" typing-extensions = ">=4.8.0,<5.0.0" +[[package]] +name = "packageurl-python" +version = "0.16.0" +description = "A purl aka. Package URL parser and builder" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "packageurl_python-0.16.0-py3-none-any.whl", hash = "sha256:5c3872638b177b0f1cf01c3673017b7b27ebee485693ae12a8bed70fa7fa7c35"}, + {file = "packageurl_python-0.16.0.tar.gz", hash = "sha256:69e3bf8a3932fe9c2400f56aaeb9f86911ecee2f9398dbe1b58ec34340be365d"}, +] + +[package.extras] +build = ["setuptools", "wheel"] +lint = ["black", "isort", "mypy"] +sqlalchemy = ["sqlalchemy (>=2.0.0)"] +test = ["pytest"] + [[package]] name = "packaging" version = "24.2" @@ -1378,6 +1566,101 @@ files = [ [package.dependencies] setuptools = "*" +[[package]] +name = "pip" +version = "25.0.1" +description = "The PyPA recommended tool for installing Python packages." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pip-25.0.1-py3-none-any.whl", hash = "sha256:c46efd13b6aa8279f33f2864459c8ce587ea6a1a59ee20de055868d8f7688f7f"}, + {file = "pip-25.0.1.tar.gz", hash = "sha256:88f96547ea48b940a3a385494e181e29fb8637898f88d88737c5049780f196ea"}, +] + +[[package]] +name = "pip-api" +version = "0.0.34" +description = "An unofficial, importable pip API" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pip_api-0.0.34-py3-none-any.whl", hash = "sha256:8b2d7d7c37f2447373aa2cf8b1f60a2f2b27a84e1e9e0294a3f6ef10eb3ba6bb"}, + {file = "pip_api-0.0.34.tar.gz", hash = "sha256:9b75e958f14c5a2614bae415f2adf7eeb54d50a2cfbe7e24fd4826471bac3625"}, +] + +[package.dependencies] +pip = "*" + +[[package]] +name = "pip-audit" +version = "2.9.0" +description = "A tool for scanning Python environments for known vulnerabilities" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pip_audit-2.9.0-py3-none-any.whl", hash = "sha256:348b16e60895749a0839875d7cc27ebd692e1584ebe5d5cb145941c8e25a80bd"}, + {file = "pip_audit-2.9.0.tar.gz", hash = "sha256:0b998410b58339d7a231e5aa004326a294e4c7c6295289cdc9d5e1ef07b1f44d"}, +] + +[package.dependencies] +CacheControl = {version = ">=0.13.0", extras = ["filecache"]} +cyclonedx-python-lib = ">=5,<10" +packaging = ">=23.0.0" +pip-api = ">=0.0.28" +pip-requirements-parser = ">=32.0.0" +platformdirs = ">=4.2.0" +requests = ">=2.31.0" +rich = ">=12.4" +toml = ">=0.10" + +[package.extras] +dev = ["build", "pip-audit[doc,lint,test]"] +doc = ["pdoc"] +lint = ["interrogate (>=1.6,<2.0)", "mypy", "ruff (>=0.9,<1.0)", "types-requests", "types-toml"] +test = ["coverage[toml] (>=7.0,!=7.3.3,<8.0)", "pretend", "pytest", "pytest-cov"] + +[[package]] +name = "pip-licenses" +version = "5.0.0" +description = "Dump the software license list of Python packages installed with pip." +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pip_licenses-5.0.0-py3-none-any.whl", hash = "sha256:82c83666753efb86d1af1c405c8ab273413eb10d6689c218df2f09acf40e477d"}, + {file = "pip_licenses-5.0.0.tar.gz", hash = "sha256:0633a1f9aab58e5a6216931b0e1d5cdded8bcc2709ff563674eb0e2ff9e77e8e"}, +] + +[package.dependencies] +prettytable = ">=2.3.0" +tomli = ">=2" + +[package.extras] +dev = ["autopep8", "black", "docutils", "isort", "mypy", "pip-tools", "pypandoc", "pytest-cov", "pytest-pycodestyle", "pytest-runner", "tomli-w", "twine", "wheel"] + +[[package]] +name = "pip-requirements-parser" +version = "32.0.1" +description = "pip requirements parser - a mostly correct pip requirements parsing library because it uses pip's own code." +optional = false +python-versions = ">=3.6.0" +groups = ["dev"] +files = [ + {file = "pip-requirements-parser-32.0.1.tar.gz", hash = "sha256:b4fa3a7a0be38243123cf9d1f3518da10c51bdb165a2b2985566247f9155a7d3"}, + {file = "pip_requirements_parser-32.0.1-py3-none-any.whl", hash = "sha256:4659bc2a667783e7a15d190f6fccf8b2486685b6dba4c19c3876314769c57526"}, +] + +[package.dependencies] +packaging = "*" +pyparsing = "*" + +[package.extras] +docs = ["Sphinx (>=3.3.1)", "doc8 (>=0.8.1)", "sphinx-rtd-theme (>=0.5.0)"] +testing = ["aboutcode-toolkit (>=6.0.0)", "black", "pytest (>=6,!=7.0.0)", "pytest-xdist (>=2)"] + [[package]] name = "platformdirs" version = "4.3.6" @@ -1430,6 +1713,24 @@ nodeenv = ">=0.11.1" pyyaml = ">=5.1" virtualenv = ">=20.10.0" +[[package]] +name = "prettytable" +version = "3.16.0" +description = "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "prettytable-3.16.0-py3-none-any.whl", hash = "sha256:b5eccfabb82222f5aa46b798ff02a8452cf530a352c31bddfa29be41242863aa"}, + {file = "prettytable-3.16.0.tar.gz", hash = "sha256:3c64b31719d961bf69c9a7e03d0c1e477320906a98da63952bc6698d6164ff57"}, +] + +[package.dependencies] +wcwidth = "*" + +[package.extras] +tests = ["pytest", "pytest-cov", "pytest-lazy-fixtures"] + [[package]] name = "prysk" version = "0.20.0" @@ -1449,6 +1750,21 @@ rich = ">=13.3.1,<14.0.0" [package.extras] pytest-plugin = ["pytest-prysk (>=0.2.0,<0.3.0)"] +[[package]] +name = "py-serializable" +version = "2.0.0" +description = "Library for serializing and deserializing Python Objects to and from JSON and XML." +optional = false +python-versions = "<4.0,>=3.8" +groups = ["dev"] +files = [ + {file = "py_serializable-2.0.0-py3-none-any.whl", hash = "sha256:1721e4c0368adeec965c183168da4b912024702f19e15e13f8577098b9a4f8fe"}, + {file = "py_serializable-2.0.0.tar.gz", hash = "sha256:e9e6491dd7d29c31daf1050232b57f9657f9e8a43b867cca1ff204752cf420a5"}, +] + +[package.dependencies] +defusedxml = ">=0.7.1,<0.8.0" + [[package]] name = "pyasn1" version = "0.6.1" @@ -1699,6 +2015,21 @@ typing-extensions = {version = ">=4.9", markers = "python_version < \"3.13\" and docs = ["sphinx (!=5.2.0,!=5.2.0.post0,!=7.2.5)", "sphinx_rtd_theme"] test = ["pretend", "pytest (>=3.0.1)", "pytest-rerunfailures"] +[[package]] +name = "pyparsing" +version = "3.2.3" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +optional = false +python-versions = ">=3.9" +groups = ["dev"] +files = [ + {file = "pyparsing-3.2.3-py3-none-any.whl", hash = "sha256:a749938e02d6fd0b59b356ca504a24982314bb090c383e3cf201c95ef7e2bfcf"}, + {file = "pyparsing-3.2.3.tar.gz", hash = "sha256:b9c13f1ab8b3b542f72e28f634bad4de758ab3ce4546e4301970ad6fa77c38be"}, +] + +[package.extras] +diagrams = ["jinja2", "railroad-diagrams"] + [[package]] name = "pytest" version = "7.4.4" @@ -2094,6 +2425,18 @@ files = [ {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, ] +[[package]] +name = "sortedcontainers" +version = "2.4.0" +description = "Sorted Containers -- Sorted List, Sorted Dict, Sorted Set" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "sortedcontainers-2.4.0-py2.py3-none-any.whl", hash = "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0"}, + {file = "sortedcontainers-2.4.0.tar.gz", hash = "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88"}, +] + [[package]] name = "soupsieve" version = "2.6" @@ -2386,7 +2729,6 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.8" groups = ["dev"] -markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249"}, {file = "tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6"}, @@ -2519,6 +2861,18 @@ platformdirs = ">=3.9.1,<5" docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] +[[package]] +name = "wcwidth" +version = "0.2.13" +description = "Measures the displayed width of unicode strings in a terminal" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"}, + {file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"}, +] + [[package]] name = "websocket-client" version = "1.8.0" @@ -2539,4 +2893,4 @@ test = ["websockets"] [metadata] lock-version = "2.1" python-versions = "^3.10.0" -content-hash = "d5af8fba2cbe06da857cea28ac43f9397ec6b0333e8a431af24d5317078a6c75" +content-hash = "22f6df7e3b5a13dec8b46478a1c88581658f28004fcaf0297f0e33b6ea6228d1" diff --git a/pyproject.toml b/pyproject.toml index d7c8486..26e04b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry.group.dev.dependencies] pytest = "^7.1.1" pytest-mock = "^3.7.0" -exasol-toolbox = ">=0.12.0" +exasol-toolbox = "^1.0.0" openapi-python-client = ">=0.21.5" pyexasol = ">=0.25.0" toml = "^0.10.2" From ed92e825d195c16acf0c93e0530f60c93e1bad90 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 13:23:46 +0200 Subject: [PATCH 05/13] Update poetry run to poetry run -- for poetry 2.1+ compatibility --- .github/workflows/check-api-outdated.yml | 2 +- .github/workflows/checks.yml | 2 +- .github/workflows/run-tests.yml | 4 ++-- .pre-commit-config.yaml | 8 ++++---- doc/developer_guide/developer_guide.md | 12 ++++++------ version.py | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/check-api-outdated.yml b/.github/workflows/check-api-outdated.yml index b74ce7e..173f78a 100644 --- a/.github/workflows/check-api-outdated.yml +++ b/.github/workflows/check-api-outdated.yml @@ -32,7 +32,7 @@ jobs: python-version: "3.10" - name: Run Nox Task api:check-outdated - run: poetry run nox -s api:check-outdated + run: poetry run -- nox -s api:check-outdated - name: Report Failure Status to Slack Channel if: ${{ failure() && github.event_name == 'schedule' }} diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 433d28e..49397e3 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -21,7 +21,7 @@ jobs: poetry-version: 2.0.1 - name: Check Version(s) - run: poetry run version-check version.py + run: poetry run -- version-check version.py Documentation: name: Docs diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a9fe799..ccf4da6 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -38,8 +38,8 @@ jobs: PYTEST_ADDOPTS: '-o log_cli=true -o log_cli_level=INFO ${{ steps.pytest-markers.outputs.slow-tests }}' run: | echo "PYTEST_ADDOPTS = $PYTEST_ADDOPTS" - export PROJECT_SHORT_TAG=$(poetry run nox -s project:get-short-tag) - poetry run nox -s test:coverage -- -- + export PROJECT_SHORT_TAG=$(poetry run -- nox -s project:get-short-tag) + poetry run -- nox -s test:coverage -- - name: Set coverage name id: coverage-suffix diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b5d11c6..73992a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: files: "pyproject.toml" pass_filenames: false language: system - entry: poetry run nox -s project:fix + entry: poetry run -- nox -s project:fix - repo: local hooks: @@ -18,7 +18,7 @@ repos: types: [ python ] pass_filenames: false language: system - entry: poetry run nox -s lint:typing + entry: poetry run -- nox -s lint:typing - repo: local hooks: @@ -27,7 +27,7 @@ repos: types: [ python ] pass_filenames: false language: system - entry: poetry run nox -s lint:code + entry: poetry run -- nox -s lint:code - repo: local hooks: @@ -36,7 +36,7 @@ repos: types: [ python ] pass_filenames: false language: system - entry: poetry run nox -s api:generate + entry: poetry run -- nox -s api:generate - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 diff --git a/doc/developer_guide/developer_guide.md b/doc/developer_guide/developer_guide.md index bb15c98..5d45987 100644 --- a/doc/developer_guide/developer_guide.md +++ b/doc/developer_guide/developer_guide.md @@ -7,7 +7,7 @@ saas-api-python includes a file `.pre-commit-config.yaml`. The following command installs the pre-commit hooks, see also [framework pre-commmit](https://pre-commit.com/) and Git documentation on [Customizing Git Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks): ```shell -poetry run pre-commit install +poetry run -- pre-commit install ``` When the hooks are installed, then git will run each of the hooks on the resp. stage, e.g. before executing a commit. @@ -22,7 +22,7 @@ See also [API Documentation](https://docs.exasol.com/saas/administration/rest_ap In order to regenerate the model layer please use the following command line: ```shell -poetry run nox -s api:generate +poetry run -- nox -s api:generate ``` ### Check API Outdated @@ -44,7 +44,7 @@ but can also be done manually by calling the nox task `api:generate`, and commit Before commiting, you might want to run the nox task `api:check-outdated` locally to see if it passed or if there are further problems: ```shell -poetry run nox -s api:check-outdated +poetry run -- nox -s api:check-outdated ``` another cause for the check failing might be a python-toolbox update changing the linting/code formating. This can result in formatting tools @@ -116,7 +116,7 @@ The invocation depends on your setup: * When calling `poetry` directly for one-time usage, then you need to add _two_ double-dashes `-- --` to terminate arguments to poetry and nox before arguments to the nox-session. ```shell -poetry run nox -s release:prepare -- -- +poetry run -- nox -s release:prepare -- ``` #### Scenario a) Prepare a Release from Branch `main` @@ -144,7 +144,7 @@ Please note that creating a pull request on GitHub requires If you prefer to create the pull request manually or cannot provide one of the prerequisites, you can add command line option `--no-pr`: ```shell -poetry run nox -s release:prepare -- -- --no-pr +poetry run -- nox -s release:prepare -- --no-pr ``` #### Scenario b) Prepare a Release from Another Branch @@ -152,7 +152,7 @@ poetry run nox -s release:prepare -- -- --no-pr In case you currently are already working on a branch other than `main`, please ensure to have all changes commited and add command line option `--no-branch`: ```shell -poetry run nox -s release:prepare -- -- --no-pr --no-branch +poetry run -- nox -s release:prepare -- --no-pr --no-branch ``` ### Finalize and Publish the Release diff --git a/version.py b/version.py index 84b9409..ccb7c4e 100644 --- a/version.py +++ b/version.py @@ -1,7 +1,7 @@ # ATTENTION: # This file is generated by exasol/toolbox/pre_commit_hooks/package_version.py when using: -# * either "poetry run nox -s project:fix" -# * or "poetry run version-check --fix" +# * either "poetry run -- nox -s project:fix" +# * or "poetry run -- version-check --fix" # Do not edit this file manually! # If you need to change the version, do so in the project.toml, e.g. by using `poetry version X.Y.Z`. MAJOR = 1 From 42dc54cd32fa3dd878c13e0c32e4a90cac5af3ad Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 13:33:14 +0200 Subject: [PATCH 06/13] Update poetry to 2.1.2 --- .github/workflows/build-and-publish.yml | 2 - .github/workflows/check-api-outdated.yml | 1 - .github/workflows/check-release-tag.yml | 2 - .github/workflows/checks.yml | 11 ----- .github/workflows/gh-pages.yml | 2 - .github/workflows/matrix-python.yml | 2 - .github/workflows/report.yml | 2 - .github/workflows/run-tests.yml | 1 - doc/changes/unreleased.md | 1 + poetry.lock | 52 ++++++++++++------------ pyproject.toml | 33 +++++++++------ 11 files changed, 47 insertions(+), 62 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index aadb811..2487c7a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -18,8 +18,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Build Artifacts run: poetry build diff --git a/.github/workflows/check-api-outdated.yml b/.github/workflows/check-api-outdated.yml index 173f78a..94ba861 100644 --- a/.github/workflows/check-api-outdated.yml +++ b/.github/workflows/check-api-outdated.yml @@ -28,7 +28,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: - poetry-version: 2.0.1 python-version: "3.10" - name: Run Nox Task api:check-outdated diff --git a/.github/workflows/check-release-tag.yml b/.github/workflows/check-release-tag.yml index 10d4e7e..2ab47a1 100644 --- a/.github/workflows/check-release-tag.yml +++ b/.github/workflows/check-release-tag.yml @@ -15,8 +15,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Check Tag Version # make sure the pushed/created tag matched the project version diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 49397e3..9b18972 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -17,8 +17,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Check Version(s) run: poetry run -- version-check version.py @@ -34,8 +32,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Build Documentation run: | @@ -56,8 +52,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Run changelog update check run: poetry run -- nox -s changelog:updated @@ -77,7 +71,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: - poetry-version: 2.0.1 python-version: ${{ matrix.python-version }} - name: Run lint @@ -107,7 +100,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: - poetry-version: 2.0.1 python-version: ${{ matrix.python-version }} - name: Run type-check @@ -128,7 +120,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: - poetry-version: 2.0.1 python-version: ${{ matrix.python-version }} - name: Run security linter @@ -151,8 +142,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Run format check run: poetry run -- nox -s project:format diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 6653c09..9a9f38b 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -17,8 +17,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Build Documentation run: | diff --git a/.github/workflows/matrix-python.yml b/.github/workflows/matrix-python.yml index 5d978bc..59729f3 100644 --- a/.github/workflows/matrix-python.yml +++ b/.github/workflows/matrix-python.yml @@ -21,8 +21,6 @@ jobs: - name: Generate matrix run: poetry run -- nox -s matrix:python - with: - poetry-version: 2.0.1 - id: set-matrix run: | diff --git a/.github/workflows/report.yml b/.github/workflows/report.yml index 56ea3e1..a1f8f44 100644 --- a/.github/workflows/report.yml +++ b/.github/workflows/report.yml @@ -18,8 +18,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 - with: - poetry-version: 2.0.1 - name: Download Artifacts uses: actions/download-artifact@v4.1.8 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ccf4da6..712132d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -27,7 +27,6 @@ jobs: - name: Setup Python & Poetry Environment uses: exasol/python-toolbox/.github/actions/python-environment@1.0.1 with: - poetry-version: 2.0.1 python-version: ${{ inputs.python-version }} - name: Run Tests and Calculate Coverage diff --git a/doc/changes/unreleased.md b/doc/changes/unreleased.md index 4c7804a..7e13bab 100644 --- a/doc/changes/unreleased.md +++ b/doc/changes/unreleased.md @@ -16,6 +16,7 @@ Added `streamDescription` to the models below `components` / `schemas`: ## Refactorings * #90: Updated open API client 2025-04-15 +* #92: Updated poetry to 2.1.2 ## Security diff --git a/poetry.lock b/poetry.lock index f58ba03..c13a9f5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "alabaster" @@ -44,7 +44,7 @@ typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} [package.extras] doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx_rtd_theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "trustme", "truststore (>=0.9.1)", "uvloop (>=0.21)"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "trustme", "truststore (>=0.9.1) ; python_version >= \"3.10\"", "uvloop (>=0.21) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\" and python_version < \"3.14\""] trio = ["trio (>=0.26.1)"] [[package]] @@ -90,12 +90,12 @@ files = [ ] [package.extras] -benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +benchmark = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] +cov = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] +dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pre-commit-uv", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier"] -tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] -tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] +tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "hypothesis", "mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.11.1) ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\"", "pytest-mypy-plugins ; platform_python_implementation == \"CPython\" and python_version >= \"3.10\""] [[package]] name = "babel" @@ -110,7 +110,7 @@ files = [ ] [package.extras] -dev = ["backports.zoneinfo", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata"] +dev = ["backports.zoneinfo ; python_version < \"3.9\"", "freezegun (>=1.0,<2.0)", "jinja2 (>=3.0)", "pytest (>=6.0)", "pytest-cov", "pytz", "setuptools", "tzdata ; sys_platform == \"win32\""] [[package]] name = "bandit" @@ -135,7 +135,7 @@ tomli = {version = ">=1.1.0", optional = true, markers = "python_version < \"3.1 baseline = ["GitPython (>=3.1.30)"] sarif = ["jschema-to-python (>=1.2.3)", "sarif-om (>=1.0.4)"] test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)", "flake8 (>=4.0.0)", "pylint (==1.9.4)", "stestr (>=2.5.0)", "testscenarios (>=0.5.0)", "testtools (>=2.3.0)"] -toml = ["tomli (>=1.1.0)"] +toml = ["tomli (>=1.1.0) ; python_version < \"3.11\""] yaml = ["PyYAML"] [[package]] @@ -575,7 +575,7 @@ files = [ ] [package.extras] -toml = ["tomli"] +toml = ["tomli ; python_full_version <= \"3.11.0a6\""] [[package]] name = "cryptography" @@ -622,10 +622,10 @@ files = [ cffi = {version = ">=1.12", markers = "platform_python_implementation != \"PyPy\""} [package.extras] -docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=3.0.0)"] +docs = ["sphinx (>=5.3.0)", "sphinx-rtd-theme (>=3.0.0) ; python_version >= \"3.8\""] docstest = ["pyenchant (>=3)", "readme-renderer (>=30.0)", "sphinxcontrib-spelling (>=7.3.1)"] -nox = ["nox (>=2024.4.15)", "nox[uv] (>=2024.3.2)"] -pep8test = ["check-sdist", "click (>=8.0.1)", "mypy (>=1.4)", "ruff (>=0.3.6)"] +nox = ["nox (>=2024.4.15)", "nox[uv] (>=2024.3.2) ; python_version >= \"3.8\""] +pep8test = ["check-sdist ; python_version >= \"3.8\"", "click (>=8.0.1)", "mypy (>=1.4)", "ruff (>=0.3.6)"] sdist = ["build (>=1.0.0)"] ssh = ["bcrypt (>=3.1.5)"] test = ["certifi (>=2024)", "cryptography-vectors (==44.0.1)", "pretend (>=0.7)", "pytest (>=7.4.0)", "pytest-benchmark (>=4.0)", "pytest-cov (>=2.10.1)", "pytest-xdist (>=3.5.0)"] @@ -683,7 +683,7 @@ packaging = "*" tomli = {version = "*", markers = "python_version < \"3.11\""} [package.extras] -cli = ["tomli"] +cli = ["tomli ; python_version < \"3.11\""] [[package]] name = "dill" @@ -795,7 +795,7 @@ files = [ [package.extras] docs = ["furo (>=2024.8.6)", "sphinx (>=8.1.3)", "sphinx-autodoc-typehints (>=3)"] testing = ["covdefaults (>=2.3)", "coverage (>=7.6.10)", "diff-cover (>=9.2.1)", "pytest (>=8.3.4)", "pytest-asyncio (>=0.25.2)", "pytest-cov (>=6)", "pytest-mock (>=3.14)", "pytest-timeout (>=2.3.1)", "virtualenv (>=20.28.1)"] -typing = ["typing-extensions (>=4.12.2)"] +typing = ["typing-extensions (>=4.12.2) ; python_version < \"3.11\""] [[package]] name = "furo" @@ -978,7 +978,7 @@ httpcore = "==1.*" idna = "*" [package.extras] -brotli = ["brotli", "brotlicffi"] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] @@ -1069,7 +1069,7 @@ files = [ ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] @@ -1481,7 +1481,7 @@ tomli = {version = ">=1", markers = "python_version < \"3.11\""} virtualenv = ">=20.14.1" [package.extras] -tox-to-nox = ["importlib-resources", "jinja2", "tox (>=4)"] +tox-to-nox = ["importlib-resources ; python_version < \"3.9\"", "jinja2", "tox (>=4)"] uv = ["uv (>=0.1.6)"] [[package]] @@ -1809,7 +1809,7 @@ typing-extensions = ">=4.12.2" [package.extras] email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] [[package]] name = "pydantic-core" @@ -1983,7 +1983,7 @@ colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=0.3.6", markers = "python_version == \"3.11\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<7" mccabe = ">=0.6,<0.8" @@ -2354,13 +2354,13 @@ files = [ ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.8.0)"] -core = ["importlib_metadata (>=6)", "jaraco.collections", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\"", "ruff (>=0.8.0) ; sys_platform != \"cygwin\""] +core = ["importlib_metadata (>=6) ; python_version < \"3.10\"", "jaraco.collections", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1) ; python_version < \"3.11\"", "wheel (>=0.43.0)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] enabler = ["pytest-enabler (>=2.2)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] -type = ["importlib_metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.14.*)", "pytest-mypy"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib_metadata (>=7.0.2) ; python_version < \"3.10\"", "jaraco.develop (>=7.21) ; sys_platform != \"cygwin\"", "mypy (==1.14.*)", "pytest-mypy"] [[package]] name = "shellingham" @@ -2835,7 +2835,7 @@ files = [ ] [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] zstd = ["zstandard (>=0.18.0)"] @@ -2859,7 +2859,7 @@ platformdirs = ">=3.9.1,<5" [package.extras] docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2,!=7.3)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] -test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8)", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10)"] +test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess (>=1)", "flaky (>=3.7)", "packaging (>=23.1)", "pytest (>=7.4)", "pytest-env (>=0.8.2)", "pytest-freezer (>=0.4.8) ; platform_python_implementation == \"PyPy\" or platform_python_implementation == \"CPython\" and sys_platform == \"win32\" and python_version >= \"3.13\"", "pytest-mock (>=3.11.1)", "pytest-randomly (>=3.12)", "pytest-timeout (>=2.1)", "setuptools (>=68)", "time-machine (>=2.10) ; platform_python_implementation == \"CPython\""] [[package]] name = "wcwidth" diff --git a/pyproject.toml b/pyproject.toml index 26e04b1..5d0f778 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,24 +1,31 @@ -[tool.poetry] +[project] name = "exasol-saas-api" version = "1.1.0" description = "API enabling Python applications connecting to Exasol database SaaS instances and using their SaaS services" +authors = [ + {name="Christoph Kuhnke", email="christoph.kuhnke@exasol.com"}, +] +maintainers = [ + {name="Christoph Kuhnke", email="christoph.kuhnke@exasol.com"}, +] +readme = "README.md" +license = "MIT" +dynamic = ["classifiers"] + +[project.urls] +Homepage = "https://github.com/exasol/saas-api-python" +Documentation = "https://github.com/exasol/saas-api-python" +Source = "https://github.com/exasol/saas-api-python" +Issues = "https://github.com/exasol/saas-api-python/issues" + +[tool.poetry] +requires-poetry = ">=2.1.0" packages = [ {include = "exasol"}, ] -authors = [ "Christoph Kuhnke " ] -maintainers = [ "Christoph Kuhnke " ] classifiers = [ "Programming Language :: Python :: 3", "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", ] -readme = "README.md" -license = "MIT" - -[tool.poetry.urls] -"Homepage" = "https://github.com/exasol/saas-api-python" -"Documentation" = "https://github.com/exasol/saas-api-python" -"Source" = "https://github.com/exasol/saas-api-python" -"Issues" = "https://github.com/exasol/saas-api-python/issues" - [tool.poetry.dependencies] python = "^3.10.0" @@ -33,7 +40,7 @@ attrs = ">=22.2.0" [build-system] -requires = ["poetry_core>=1.0.0"] +requires = ["poetry_core>=2.0.0"] build-backend = "poetry.core.masonry.api" From dbc521a5838721b59ed3109d490941d9bfa1ae81 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 13:39:51 +0200 Subject: [PATCH 07/13] Fix formatting missed in previous work --- exasol/saas/client/__init__.py | 8 +- exasol/saas/client/api_access.py | 216 ++++++++++-------- exasol/saas/client/openapi/__init__.py | 2 +- exasol/saas/client/openapi/api/__init__.py | 2 +- .../openapi/api/clusters/create_cluster.py | 84 +++---- .../openapi/api/clusters/delete_cluster.py | 44 ++-- .../openapi/api/clusters/get_cluster.py | 84 +++---- .../api/clusters/get_cluster_connection.py | 84 +++---- .../openapi/api/clusters/list_clusters.py | 86 +++---- .../openapi/api/clusters/scale_cluster.py | 48 ++-- .../openapi/api/clusters/start_cluster.py | 44 ++-- .../openapi/api/clusters/stop_cluster.py | 44 ++-- .../openapi/api/clusters/update_cluster.py | 48 ++-- .../openapi/api/databases/create_database.py | 76 +++--- .../openapi/api/databases/create_schedule.py | 84 +++---- .../openapi/api/databases/delete_database.py | 40 ++-- .../openapi/api/databases/delete_schedule.py | 44 ++-- .../openapi/api/databases/get_database.py | 76 +++--- .../api/databases/get_database_settings.py | 76 +++--- .../databases/get_database_upgrade_info.py | 76 +++--- .../openapi/api/databases/list_databases.py | 76 +++--- .../openapi/api/databases/list_schedules.py | 86 +++---- .../databases/set_auto_updates_database.py | 44 ++-- .../openapi/api/databases/start_database.py | 40 ++-- .../openapi/api/databases/stop_database.py | 40 ++-- .../openapi/api/databases/update_database.py | 44 ++-- .../openapi/api/databases/upgrade_database.py | 40 ++-- .../extensions/create_extension_instance.py | 102 ++++----- .../extensions/delete_extension_instance.py | 52 ++--- .../openapi/api/extensions/get_extension.py | 94 ++++---- .../api/extensions/install_extension.py | 48 ++-- .../extensions/list_extension_instances.py | 104 ++++----- .../openapi/api/extensions/list_extensions.py | 86 +++---- .../api/extensions/uninstall_extension.py | 48 ++-- .../client/openapi/api/files/create_folder.py | 44 ++-- .../client/openapi/api/files/delete_file.py | 44 ++-- .../client/openapi/api/files/delete_folder.py | 44 ++-- .../client/openapi/api/files/download_file.py | 84 +++---- .../client/openapi/api/files/list_files.py | 86 +++---- .../client/openapi/api/files/upload_file.py | 84 +++---- .../api/platform/list_cluster_sizes.py | 76 +++--- .../openapi/api/platform/list_platforms.py | 79 +++---- .../openapi/api/platform/list_regions.py | 76 +++--- .../openapi/api/profile/update_profile.py | 34 +-- .../openapi/api/security/add_allowed_ip.py | 76 +++--- .../openapi/api/security/delete_allowed_ip.py | 40 ++-- .../openapi/api/security/get_allowed_ip.py | 76 +++--- .../openapi/api/security/list_allowed_i_ps.py | 76 +++--- .../openapi/api/security/update_allowed_ip.py | 44 ++-- .../client/openapi/api/usage/get_usage.py | 84 +++---- .../client/openapi/api/users/delete_user.py | 40 ++-- .../saas/client/openapi/api/users/get_user.py | 76 +++--- .../client/openapi/api/users/list_users.py | 102 ++++----- .../client/openapi/api/users/patch_user.py | 44 ++-- exasol/saas/client/openapi/client.py | 38 ++- exasol/saas/client/openapi/errors.py | 4 +- exasol/saas/client/openapi/models/__init__.py | 2 +- .../saas/client/openapi/models/allowed_ip.py | 49 ++-- .../saas/client/openapi/models/api_error.py | 51 ++--- .../saas/client/openapi/models/auto_stop.py | 25 +- exasol/saas/client/openapi/models/cluster.py | 87 +++---- .../openapi/models/cluster_action_scale.py | 25 +- .../models/cluster_action_start_stop.py | 21 +- .../openapi/models/cluster_connection.py | 49 ++-- .../client/openapi/models/cluster_settings.py | 25 +- .../openapi/models/cluster_settings_update.py | 18 +- .../client/openapi/models/cluster_size.py | 41 ++-- .../client/openapi/models/connection_i_ps.py | 31 +-- .../openapi/models/create_allowed_ip.py | 25 +- .../client/openapi/models/create_cluster.py | 52 ++--- .../client/openapi/models/create_database.py | 53 ++--- .../models/create_database_initial_cluster.py | 52 ++--- .../models/create_extension_instance.py | 41 ++-- .../openapi/models/database_settings.py | 41 ++-- .../openapi/models/database_upgrade_info.py | 29 ++- .../client/openapi/models/download_file.py | 21 +- .../client/openapi/models/exasol_database.py | 106 ++++----- .../models/exasol_database_clusters.py | 25 +- .../exasol_database_integrations_item.py | 27 +-- .../models/exasol_database_settings.py | 41 ++-- .../saas/client/openapi/models/extension.py | 57 ++--- .../client/openapi/models/extension_detail.py | 49 ++-- .../openapi/models/extension_instance.py | 25 +- .../models/extension_parameter_definitions.py | 27 +-- .../models/extension_parameter_value.py | 25 +- .../openapi/models/extension_version.py | 33 ++- exasol/saas/client/openapi/models/file.py | 49 ++-- .../saas/client/openapi/models/patch_user.py | 34 +-- .../openapi/models/patch_user_databases.py | 31 +-- exasol/saas/client/openapi/models/platform.py | 25 +- exasol/saas/client/openapi/models/region.py | 33 ++- .../client/openapi/models/scale_cluster.py | 21 +- exasol/saas/client/openapi/models/schedule.py | 65 +++--- .../models/set_auto_updates_database.py | 21 +- .../openapi/models/update_allowed_ip.py | 25 +- .../client/openapi/models/update_cluster.py | 43 ++-- .../client/openapi/models/update_database.py | 21 +- .../client/openapi/models/update_profile.py | 25 +- .../saas/client/openapi/models/upload_file.py | 21 +- exasol/saas/client/openapi/models/usage.py | 36 ++- .../models/usage_additional_property_item.py | 47 ++-- .../client/openapi/models/usage_cluster.py | 37 ++- exasol/saas/client/openapi/models/user.py | 86 +++---- .../client/openapi/models/user_database.py | 25 +- .../saas/client/openapi/models/user_role.py | 25 +- exasol/saas/client/openapi/types.py | 8 +- noxfile.py | 63 ++--- test/integration/conftest.py | 15 +- test/integration/connection_test.py | 44 ++-- test/integration/databases_test.py | 20 +- test/unit/test_placeholder.py | 5 +- 111 files changed, 2308 insertions(+), 3191 deletions(-) diff --git a/exasol/saas/client/__init__.py b/exasol/saas/client/__init__.py index a792713..b3c017d 100644 --- a/exasol/saas/client/__init__.py +++ b/exasol/saas/client/__init__.py @@ -3,10 +3,13 @@ """ from dataclasses import dataclass +from datetime import ( + datetime, + timedelta, +) from typing import Final -from datetime import datetime, timedelta -from exasol.saas.client.openapi.models.status import Status +from exasol.saas.client.openapi.models.status import Status SAAS_HOST = "https://cloud.exasol.com" @@ -23,6 +26,7 @@ class Limits: """ Constants for Exasol SaaS databases. """ + MAX_DATABASE_NAME_LENGTH: Final[int] = 20 MAX_CLUSTER_NAME_LENGTH: Final[int] = 40 AUTOSTOP_MIN_IDLE_TIME: Final[timedelta] = timedelta(minutes=15) diff --git a/exasol/saas/client/api_access.py b/exasol/saas/client/api_access.py index 1b3af2e..699c6b3 100644 --- a/exasol/saas/client/api_access.py +++ b/exasol/saas/client/api_access.py @@ -1,40 +1,50 @@ from __future__ import annotations + +import datetime as dt import getpass import logging import time - -from typing import Iterable, List, Optional, Any from contextlib import contextmanager -import datetime as dt -from datetime import datetime, timedelta +from datetime import ( + datetime, + timedelta, +) +from typing import ( + Any, + Iterable, + List, + Optional, +) -from tenacity import retry, TryAgain -from tenacity.wait import wait_fixed +from tenacity import ( + TryAgain, + retry, +) from tenacity.stop import stop_after_delay +from tenacity.wait import wait_fixed from exasol.saas.client import ( - openapi, Limits, + openapi, +) +from exasol.saas.client.openapi.api.clusters import ( + get_cluster_connection, + list_clusters, ) -from exasol.saas.client.openapi.models.status import Status from exasol.saas.client.openapi.api.databases import ( create_database, delete_database, - list_databases, get_database, -) -from exasol.saas.client.openapi.api.clusters import ( - get_cluster_connection, - list_clusters, + list_databases, ) from exasol.saas.client.openapi.api.security import ( - list_allowed_i_ps, add_allowed_ip, delete_allowed_ip, + list_allowed_i_ps, ) +from exasol.saas.client.openapi.models.status import Status from exasol.saas.client.openapi.types import UNSET - LOG = logging.getLogger(__name__) LOG.setLevel(logging.INFO) @@ -43,18 +53,19 @@ def timestamp_name(project_short_tag: str | None = None) -> str: """ project_short_tag: Abbreviation of your project """ - timestamp = f'{datetime.now().timestamp():.0f}' + timestamp = f"{datetime.now().timestamp():.0f}" owner = getpass.getuser() candidate = f"{timestamp}{project_short_tag or ''}-{owner}" - return candidate[:Limits.MAX_DATABASE_NAME_LENGTH] + return candidate[: Limits.MAX_DATABASE_NAME_LENGTH] def wait_for_delete_clearance(start: dt.datetime): lifetime = datetime.now() - start if lifetime < Limits.MIN_DATABASE_LIFETIME: wait = Limits.MIN_DATABASE_LIFETIME - lifetime - LOG.info(f"Waiting {int(wait.seconds)} seconds" - " before deleting the database.") + LOG.info( + f"Waiting {int(wait.seconds)} seconds" " before deleting the database." + ) time.sleep(wait.seconds) @@ -64,46 +75,53 @@ class DatabaseStartupFailure(Exception): successful. """ + class DatabaseDeleteTimeout(Exception): """ If deletion of a SaaS database instance was requested but during the specified timeout it was still reported in the list of existing databases. """ + def create_saas_client( - host: str, - pat: str, - raise_on_unexpected_status: bool = True, + host: str, + pat: str, + raise_on_unexpected_status: bool = True, ) -> openapi.AuthenticatedClient: return openapi.AuthenticatedClient( base_url=host, token=pat, - raise_on_unexpected_status = raise_on_unexpected_status, + raise_on_unexpected_status=raise_on_unexpected_status, ) def _get_database_id( - account_id: str, - client: openapi.AuthenticatedClient, - database_name: str, + account_id: str, + client: openapi.AuthenticatedClient, + database_name: str, ) -> str: """ Finds the database id, given the database name. """ dbs = list_databases.sync(account_id, client=client) - dbs = list(filter(lambda db: (db.name == database_name) and # type: ignore - (db.deleted_at is UNSET) and # type: ignore - (db.deleted_by is UNSET), dbs)) # type: ignore + dbs = list( + filter( + lambda db: (db.name == database_name) # type: ignore + and (db.deleted_at is UNSET) # type: ignore + and (db.deleted_by is UNSET), + dbs, + ) + ) # type: ignore if not dbs: - raise RuntimeError(f'SaaS database {database_name} was not found.') + raise RuntimeError(f"SaaS database {database_name} was not found.") return dbs[0].id def get_database_id( - host: str, - account_id: str, - pat: str, - database_name: str, + host: str, + account_id: str, + pat: str, + database_name: str, ) -> str: """ Finds the database id, given the database name. @@ -119,11 +137,11 @@ def get_database_id( def get_connection_params( - host: str, - account_id: str, - pat: str, - database_id: str | None = None, - database_name: str | None = None, + host: str, + account_id: str, + pat: str, + database_id: str | None = None, + database_name: str | None = None, ) -> dict[str, Any]: """ Gets the database connection parameters, such as those required by pyexasol: @@ -147,23 +165,24 @@ def get_connection_params( with create_saas_client(host, pat) as client: if not database_id: if not database_name: - raise ValueError(('To get SaaS connection parameters, ' - 'either database name or database id must be provided.')) - database_id = _get_database_id(account_id, client, database_name=database_name) - clusters = list_clusters.sync(account_id, - database_id, - client=client) + raise ValueError( + "To get SaaS connection parameters, " + "either database name or database id must be provided." + ) + database_id = _get_database_id( + account_id, client, database_name=database_name + ) + clusters = list_clusters.sync(account_id, database_id, client=client) cluster_id = next(filter(lambda cl: cl.main_cluster, clusters)).id # type: ignore - connections = get_cluster_connection.sync(account_id, - database_id, - cluster_id, - client=client) + connections = get_cluster_connection.sync( + account_id, database_id, cluster_id, client=client + ) if connections is None: - raise RuntimeError('Failed to get the SaaS connection data.') + raise RuntimeError("Failed to get the SaaS connection data.") connection_params = { - 'dsn': f'{connections.dns}:{connections.port}', - 'user': connections.db_username, - 'password': pat + "dsn": f"{connections.dns}:{connections.port}", + "user": connections.db_username, + "password": pat, } return connection_params @@ -180,12 +199,12 @@ def __init__(self, client: openapi.AuthenticatedClient, account_id: str): self._account_id = account_id def create_database( - self, - name: str, - cluster_size: str = "XS", - region: str = "eu-central-1", - idle_time: timedelta | None = None - ) -> Optional[openapi.models.exasol_database.ExasolDatabase]: + self, + name: str, + cluster_size: str = "XS", + region: str = "eu-central-1", + idle_time: timedelta | None = None, + ) -> openapi.models.exasol_database.ExasolDatabase | None: def minutes(x: timedelta) -> int: return x.seconds // 60 @@ -207,7 +226,7 @@ def minutes(x: timedelta) -> int: initial_cluster=cluster_spec, provider="aws", region=region, - ) + ), ) @contextmanager @@ -218,10 +237,10 @@ def _ignore_failures(self, ignore: bool = False): self._client.raise_on_unexpected_status = before def wait_until_deleted( - self, - database_id: str, - timeout: timedelta = timedelta(seconds=1), - interval: timedelta = timedelta(minutes=1), + self, + database_id: str, + timeout: timedelta = timedelta(seconds=1), + interval: timedelta = timedelta(minutes=1), ): @retry(wait=wait_fixed(interval), stop=stop_after_delay(timeout)) def still_exists() -> bool: @@ -236,7 +255,8 @@ def still_exists() -> bool: def delete_database(self, database_id: str, ignore_failures=False): with self._ignore_failures(ignore_failures) as client: return delete_database.sync_detailed( - self._account_id, database_id, client=client) + self._account_id, database_id, client=client + ) def list_database_ids(self) -> Iterable[str]: dbs = list_databases.sync(self._account_id, client=self._client) or [] @@ -244,11 +264,11 @@ def list_database_ids(self) -> Iterable[str]: @contextmanager def database( - self, - name: str, - keep: bool = False, - ignore_delete_failure: bool = False, - idle_time: timedelta | None = None + self, + name: str, + keep: bool = False, + ignore_delete_failure: bool = False, + idle_time: timedelta | None = None, ): db = None start = datetime.now() @@ -271,9 +291,9 @@ def database( LOG.info(f"Keeping database {db_repr} as keep = {keep}") def get_database( - self, - database_id: str, - ) -> Optional[openapi.models.exasol_database.ExasolDatabase]: + self, + database_id: str, + ) -> openapi.models.exasol_database.ExasolDatabase | None: return get_database.sync( self._account_id, database_id, @@ -281,10 +301,10 @@ def get_database( ) def wait_until_running( - self, - database_id: str, - timeout: timedelta = timedelta(minutes=30), - interval: timedelta = timedelta(minutes=2), + self, + database_id: str, + timeout: timedelta = timedelta(minutes=30), + interval: timedelta = timedelta(minutes=2), ): success = [ Status.RUNNING, @@ -302,9 +322,9 @@ def poll_status(): raise DatabaseStartupFailure() def clusters( - self, - database_id: str, - ) -> Optional[List[openapi.models.Cluster]]: + self, + database_id: str, + ) -> list[openapi.models.Cluster] | None: return list_clusters.sync( self._account_id, database_id, @@ -312,10 +332,10 @@ def clusters( ) def get_connection( - self, - database_id: str, - cluster_id: str, - ) -> Optional[openapi.models.ClusterConnection]: + self, + database_id: str, + cluster_id: str, + ) -> openapi.models.ClusterConnection | None: return get_cluster_connection.sync( self._account_id, database_id, @@ -324,16 +344,19 @@ def get_connection( ) def list_allowed_ip_ids(self) -> Iterable[str]: - ips = list_allowed_i_ps.sync( - self._account_id, - client=self._client, - ) or [] + ips = ( + list_allowed_i_ps.sync( + self._account_id, + client=self._client, + ) + or [] + ) return (x.id for x in ips) def add_allowed_ip( - self, - cidr_ip: str = "0.0.0.0/0", - ) -> Optional[openapi.models.allowed_ip.AllowedIP]: + self, + cidr_ip: str = "0.0.0.0/0", + ) -> openapi.models.allowed_ip.AllowedIP | None: """ Suggested values for cidr_ip: * 185.17.207.78/32 @@ -352,15 +375,14 @@ def add_allowed_ip( def delete_allowed_ip(self, id: str, ignore_failures=False): with self._ignore_failures(ignore_failures) as client: - return delete_allowed_ip.sync_detailed( - self._account_id, id, client=client) + return delete_allowed_ip.sync_detailed(self._account_id, id, client=client) @contextmanager def allowed_ip( - self, - cidr_ip: str = "0.0.0.0/0", - keep: bool = False, - ignore_delete_failure: bool = False, + self, + cidr_ip: str = "0.0.0.0/0", + keep: bool = False, + ignore_delete_failure: bool = False, ): ip = None try: diff --git a/exasol/saas/client/openapi/__init__.py b/exasol/saas/client/openapi/__init__.py index 96a49c6..a900b76 100644 --- a/exasol/saas/client/openapi/__init__.py +++ b/exasol/saas/client/openapi/__init__.py @@ -1,5 +1,5 @@ +"""A client library for accessing Exasol SaaS REST-API""" -""" A client library for accessing Exasol SaaS REST-API """ from .client import ( AuthenticatedClient, Client, diff --git a/exasol/saas/client/openapi/api/__init__.py b/exasol/saas/client/openapi/api/__init__.py index dc035f4..81f9fa2 100644 --- a/exasol/saas/client/openapi/api/__init__.py +++ b/exasol/saas/client/openapi/api/__init__.py @@ -1 +1 @@ -""" Contains methods for accessing the API """ +"""Contains methods for accessing the API""" diff --git a/exasol/saas/client/openapi/api/clusters/create_cluster.py b/exasol/saas/client/openapi/api/clusters/create_cluster.py index f6de30b..9917fd7 100644 --- a/exasol/saas/client/openapi/api/clusters/create_cluster.py +++ b/exasol/saas/client/openapi/api/clusters/create_cluster.py @@ -26,23 +26,16 @@ def _get_kwargs( database_id: str, *, body: CreateCluster, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -50,12 +43,12 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Cluster]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Cluster]: if response.status_code == 200: response_200 = Cluster.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -63,7 +56,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Cluster]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Cluster]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -78,9 +73,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateCluster, - ) -> Response[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -92,14 +86,12 @@ def sync_detailed( Returns: Response[Cluster] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) response = client.get_httpx_client().request( @@ -108,15 +100,15 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, body: CreateCluster, - ) -> Optional[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -128,26 +120,24 @@ def sync( Returns: Cluster - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, -body=body, - + database_id=database_id, + client=client, + body=body, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, body: CreateCluster, - ) -> Response[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -159,31 +149,27 @@ async def asyncio_detailed( Returns: Response[Cluster] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, body: CreateCluster, - ) -> Optional[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -195,13 +181,13 @@ async def asyncio( Returns: Cluster - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, -body=body, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + body=body, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/clusters/delete_cluster.py b/exasol/saas/client/openapi/api/clusters/delete_cluster.py index 9def1a4..9899795 100644 --- a/exasol/saas/client/openapi/api/clusters/delete_cluster.py +++ b/exasol/saas/client/openapi/api/clusters/delete_cluster.py @@ -23,24 +23,19 @@ def _get_kwargs( account_id: str, database_id: str, cluster_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}".format(account_id=account_id,database_id=database_id,cluster_id=cluster_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -49,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +61,8 @@ def sync_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -78,14 +74,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) response = client.get_httpx_client().request( @@ -101,9 +95,8 @@ async def asyncio_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -115,19 +108,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/clusters/get_cluster.py b/exasol/saas/client/openapi/api/clusters/get_cluster.py index ebd3874..fba2dd9 100644 --- a/exasol/saas/client/openapi/api/clusters/get_cluster.py +++ b/exasol/saas/client/openapi/api/clusters/get_cluster.py @@ -24,29 +24,22 @@ def _get_kwargs( account_id: str, database_id: str, cluster_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}".format(account_id=account_id,database_id=database_id,cluster_id=cluster_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Cluster]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Cluster]: if response.status_code == 200: response_200 = Cluster.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -54,7 +47,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Cluster]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Cluster]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,9 +64,8 @@ def sync_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -83,14 +77,12 @@ def sync_detailed( Returns: Response[Cluster] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) response = client.get_httpx_client().request( @@ -99,15 +91,15 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, cluster_id: str, *, client: AuthenticatedClient, - ) -> Optional[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -119,26 +111,24 @@ def sync( Returns: Cluster - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -client=client, - + database_id=database_id, + cluster_id=cluster_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -150,31 +140,27 @@ async def asyncio_detailed( Returns: Response[Cluster] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, cluster_id: str, *, client: AuthenticatedClient, - ) -> Optional[Cluster]: - """ + """ Args: account_id (str): database_id (str): @@ -186,13 +172,13 @@ async def asyncio( Returns: Cluster - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + cluster_id=cluster_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/clusters/get_cluster_connection.py b/exasol/saas/client/openapi/api/clusters/get_cluster_connection.py index 29ade24..5259abb 100644 --- a/exasol/saas/client/openapi/api/clusters/get_cluster_connection.py +++ b/exasol/saas/client/openapi/api/clusters/get_cluster_connection.py @@ -24,29 +24,22 @@ def _get_kwargs( account_id: str, database_id: str, cluster_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/connect".format(account_id=account_id,database_id=database_id,cluster_id=cluster_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/connect", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ClusterConnection]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ClusterConnection]: if response.status_code == 200: response_200 = ClusterConnection.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -54,7 +47,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ClusterConnection]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ClusterConnection]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,9 +64,8 @@ def sync_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[ClusterConnection]: - """ + """ Args: account_id (str): database_id (str): @@ -83,14 +77,12 @@ def sync_detailed( Returns: Response[ClusterConnection] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) response = client.get_httpx_client().request( @@ -99,15 +91,15 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, cluster_id: str, *, client: AuthenticatedClient, - ) -> Optional[ClusterConnection]: - """ + """ Args: account_id (str): database_id (str): @@ -119,26 +111,24 @@ def sync( Returns: ClusterConnection - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -client=client, - + database_id=database_id, + cluster_id=cluster_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[ClusterConnection]: - """ + """ Args: account_id (str): database_id (str): @@ -150,31 +140,27 @@ async def asyncio_detailed( Returns: Response[ClusterConnection] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, cluster_id: str, *, client: AuthenticatedClient, - ) -> Optional[ClusterConnection]: - """ + """ Args: account_id (str): database_id (str): @@ -186,13 +172,13 @@ async def asyncio( Returns: ClusterConnection - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + cluster_id=cluster_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/clusters/list_clusters.py b/exasol/saas/client/openapi/api/clusters/list_clusters.py index 83601a6..fc8afd5 100644 --- a/exasol/saas/client/openapi/api/clusters/list_clusters.py +++ b/exasol/saas/client/openapi/api/clusters/list_clusters.py @@ -23,32 +23,25 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['Cluster']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["Cluster"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = Cluster.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -58,7 +51,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['Cluster']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["Cluster"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,9 +67,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['Cluster']]: - """ +) -> Response[list["Cluster"]]: + """ Args: account_id (str): database_id (str): @@ -85,13 +79,11 @@ def sync_detailed( Returns: Response[list['Cluster']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -100,14 +92,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['Cluster']]: - """ +) -> Optional[list["Cluster"]]: + """ Args: account_id (str): database_id (str): @@ -118,24 +110,22 @@ def sync( Returns: list['Cluster'] - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, - + database_id=database_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['Cluster']]: - """ +) -> Response[list["Cluster"]]: + """ Args: account_id (str): database_id (str): @@ -146,29 +136,25 @@ async def asyncio_detailed( Returns: Response[list['Cluster']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['Cluster']]: - """ +) -> Optional[list["Cluster"]]: + """ Args: account_id (str): database_id (str): @@ -179,12 +165,12 @@ async def asyncio( Returns: list['Cluster'] - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/clusters/scale_cluster.py b/exasol/saas/client/openapi/api/clusters/scale_cluster.py index 9c1f6e4..bfcbbe1 100644 --- a/exasol/saas/client/openapi/api/clusters/scale_cluster.py +++ b/exasol/saas/client/openapi/api/clusters/scale_cluster.py @@ -26,23 +26,16 @@ def _get_kwargs( cluster_id: str, *, body: ScaleCluster, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/scale".format(account_id=account_id,database_id=database_id,cluster_id=cluster_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/scale", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -50,7 +43,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -59,7 +54,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,9 +72,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: ScaleCluster, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -90,15 +86,13 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -body=body, - + database_id=database_id, + cluster_id=cluster_id, + body=body, ) response = client.get_httpx_client().request( @@ -115,9 +109,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: ScaleCluster, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -130,20 +123,15 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -body=body, - + database_id=database_id, + cluster_id=cluster_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/clusters/start_cluster.py b/exasol/saas/client/openapi/api/clusters/start_cluster.py index ccf97a4..67f0cee 100644 --- a/exasol/saas/client/openapi/api/clusters/start_cluster.py +++ b/exasol/saas/client/openapi/api/clusters/start_cluster.py @@ -23,24 +23,19 @@ def _get_kwargs( account_id: str, database_id: str, cluster_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/start".format(account_id=account_id,database_id=database_id,cluster_id=cluster_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/start", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -49,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +61,8 @@ def sync_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -78,14 +74,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) response = client.get_httpx_client().request( @@ -101,9 +95,8 @@ async def asyncio_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -115,19 +108,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/clusters/stop_cluster.py b/exasol/saas/client/openapi/api/clusters/stop_cluster.py index f775150..e297520 100644 --- a/exasol/saas/client/openapi/api/clusters/stop_cluster.py +++ b/exasol/saas/client/openapi/api/clusters/stop_cluster.py @@ -23,24 +23,19 @@ def _get_kwargs( account_id: str, database_id: str, cluster_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/stop".format(account_id=account_id,database_id=database_id,cluster_id=cluster_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}/stop", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -49,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +61,8 @@ def sync_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -78,14 +74,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) response = client.get_httpx_client().request( @@ -101,9 +95,8 @@ async def asyncio_detailed( cluster_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -115,19 +108,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, - + database_id=database_id, + cluster_id=cluster_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/clusters/update_cluster.py b/exasol/saas/client/openapi/api/clusters/update_cluster.py index 202d802..2a0a7c6 100644 --- a/exasol/saas/client/openapi/api/clusters/update_cluster.py +++ b/exasol/saas/client/openapi/api/clusters/update_cluster.py @@ -26,23 +26,16 @@ def _get_kwargs( cluster_id: str, *, body: UpdateCluster, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}".format(account_id=account_id,database_id=database_id,cluster_id=cluster_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/clusters/{cluster_id}", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -50,7 +43,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -59,7 +54,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -75,9 +72,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateCluster, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -90,15 +86,13 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -body=body, - + database_id=database_id, + cluster_id=cluster_id, + body=body, ) response = client.get_httpx_client().request( @@ -115,9 +109,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateCluster, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -130,20 +123,15 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -cluster_id=cluster_id, -body=body, - + database_id=database_id, + cluster_id=cluster_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/databases/create_database.py b/exasol/saas/client/openapi/api/databases/create_database.py index 79b6324..3d57f93 100644 --- a/exasol/saas/client/openapi/api/databases/create_database.py +++ b/exasol/saas/client/openapi/api/databases/create_database.py @@ -25,23 +25,16 @@ def _get_kwargs( account_id: str, *, body: CreateDatabase, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v1/accounts/{account_id}/databases".format(account_id=account_id,), + "url": f"/api/v1/accounts/{account_id}/databases", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -49,12 +42,12 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ExasolDatabase]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ExasolDatabase]: if response.status_code == 200: response_200 = ExasolDatabase.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +55,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ExasolDatabase]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ExasolDatabase]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,9 +71,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateDatabase, - ) -> Response[ExasolDatabase]: - """ + """ Args: account_id (str): body (CreateDatabase): @@ -89,13 +83,11 @@ def sync_detailed( Returns: Response[ExasolDatabase] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -body=body, - + body=body, ) response = client.get_httpx_client().request( @@ -104,14 +96,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, *, client: AuthenticatedClient, body: CreateDatabase, - ) -> Optional[ExasolDatabase]: - """ + """ Args: account_id (str): body (CreateDatabase): @@ -122,24 +114,22 @@ def sync( Returns: ExasolDatabase - """ - + """ return sync_detailed( account_id=account_id, -client=client, -body=body, - + client=client, + body=body, ).parsed + async def asyncio_detailed( account_id: str, *, client: AuthenticatedClient, body: CreateDatabase, - ) -> Response[ExasolDatabase]: - """ + """ Args: account_id (str): body (CreateDatabase): @@ -150,29 +140,25 @@ async def asyncio_detailed( Returns: Response[ExasolDatabase] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -body=body, - + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, *, client: AuthenticatedClient, body: CreateDatabase, - ) -> Optional[ExasolDatabase]: - """ + """ Args: account_id (str): body (CreateDatabase): @@ -183,12 +169,12 @@ async def asyncio( Returns: ExasolDatabase - """ - - - return (await asyncio_detailed( - account_id=account_id, -client=client, -body=body, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + body=body, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/databases/create_schedule.py b/exasol/saas/client/openapi/api/databases/create_schedule.py index 411c878..1d2530a 100644 --- a/exasol/saas/client/openapi/api/databases/create_schedule.py +++ b/exasol/saas/client/openapi/api/databases/create_schedule.py @@ -25,23 +25,16 @@ def _get_kwargs( database_id: str, *, body: Schedule, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/schedules".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/schedules", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -49,12 +42,12 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Schedule]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Schedule]: if response.status_code == 201: response_201 = Schedule.from_dict(response.json()) - - return response_201 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +55,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Schedule]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Schedule]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -77,9 +72,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: Schedule, - ) -> Response[Schedule]: - """ + """ Args: account_id (str): database_id (str): @@ -91,14 +85,12 @@ def sync_detailed( Returns: Response[Schedule] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) response = client.get_httpx_client().request( @@ -107,15 +99,15 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, body: Schedule, - ) -> Optional[Schedule]: - """ + """ Args: account_id (str): database_id (str): @@ -127,26 +119,24 @@ def sync( Returns: Schedule - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, -body=body, - + database_id=database_id, + client=client, + body=body, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, body: Schedule, - ) -> Response[Schedule]: - """ + """ Args: account_id (str): database_id (str): @@ -158,31 +148,27 @@ async def asyncio_detailed( Returns: Response[Schedule] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, body: Schedule, - ) -> Optional[Schedule]: - """ + """ Args: account_id (str): database_id (str): @@ -194,13 +180,13 @@ async def asyncio( Returns: Schedule - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, -body=body, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + body=body, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/databases/delete_database.py b/exasol/saas/client/openapi/api/databases/delete_database.py index b94439f..6d0e782 100644 --- a/exasol/saas/client/openapi/api/databases/delete_database.py +++ b/exasol/saas/client/openapi/api/databases/delete_database.py @@ -22,24 +22,19 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -48,7 +43,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,9 +59,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -75,13 +71,11 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -96,9 +90,8 @@ async def asyncio_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -109,18 +102,13 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/databases/delete_schedule.py b/exasol/saas/client/openapi/api/databases/delete_schedule.py index 85edf65..6cd6917 100644 --- a/exasol/saas/client/openapi/api/databases/delete_schedule.py +++ b/exasol/saas/client/openapi/api/databases/delete_schedule.py @@ -23,24 +23,19 @@ def _get_kwargs( account_id: str, database_id: str, action_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/schedules/{action_id}".format(account_id=account_id,database_id=database_id,action_id=action_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/schedules/{action_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -49,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +61,8 @@ def sync_detailed( action_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -78,14 +74,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -action_id=action_id, - + database_id=database_id, + action_id=action_id, ) response = client.get_httpx_client().request( @@ -101,9 +95,8 @@ async def asyncio_detailed( action_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -115,19 +108,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -action_id=action_id, - + database_id=database_id, + action_id=action_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/databases/get_database.py b/exasol/saas/client/openapi/api/databases/get_database.py index 9394d4f..16fca77 100644 --- a/exasol/saas/client/openapi/api/databases/get_database.py +++ b/exasol/saas/client/openapi/api/databases/get_database.py @@ -23,29 +23,22 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ExasolDatabase]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[ExasolDatabase]: if response.status_code == 200: response_200 = ExasolDatabase.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -53,7 +46,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ExasolDatabase]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[ExasolDatabase]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,9 +62,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[ExasolDatabase]: - """ + """ Args: account_id (str): database_id (str): @@ -80,13 +74,11 @@ def sync_detailed( Returns: Response[ExasolDatabase] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -95,14 +87,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Optional[ExasolDatabase]: - """ + """ Args: account_id (str): database_id (str): @@ -113,24 +105,22 @@ def sync( Returns: ExasolDatabase - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, - + database_id=database_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Response[ExasolDatabase]: - """ + """ Args: account_id (str): database_id (str): @@ -141,29 +131,25 @@ async def asyncio_detailed( Returns: Response[ExasolDatabase] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Optional[ExasolDatabase]: - """ + """ Args: account_id (str): database_id (str): @@ -174,12 +160,12 @@ async def asyncio( Returns: ExasolDatabase - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/databases/get_database_settings.py b/exasol/saas/client/openapi/api/databases/get_database_settings.py index 08ccc0b..6fe9053 100644 --- a/exasol/saas/client/openapi/api/databases/get_database_settings.py +++ b/exasol/saas/client/openapi/api/databases/get_database_settings.py @@ -23,29 +23,22 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/settings".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/settings", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DatabaseSettings]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DatabaseSettings]: if response.status_code == 200: response_200 = DatabaseSettings.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -53,7 +46,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DatabaseSettings]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[DatabaseSettings]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,9 +62,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[DatabaseSettings]: - """ + """ Args: account_id (str): database_id (str): @@ -80,13 +74,11 @@ def sync_detailed( Returns: Response[DatabaseSettings] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -95,14 +87,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Optional[DatabaseSettings]: - """ + """ Args: account_id (str): database_id (str): @@ -113,24 +105,22 @@ def sync( Returns: DatabaseSettings - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, - + database_id=database_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Response[DatabaseSettings]: - """ + """ Args: account_id (str): database_id (str): @@ -141,29 +131,25 @@ async def asyncio_detailed( Returns: Response[DatabaseSettings] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Optional[DatabaseSettings]: - """ + """ Args: account_id (str): database_id (str): @@ -174,12 +160,12 @@ async def asyncio( Returns: DatabaseSettings - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/databases/get_database_upgrade_info.py b/exasol/saas/client/openapi/api/databases/get_database_upgrade_info.py index 3e97bd5..7ce7583 100644 --- a/exasol/saas/client/openapi/api/databases/get_database_upgrade_info.py +++ b/exasol/saas/client/openapi/api/databases/get_database_upgrade_info.py @@ -23,29 +23,22 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/upgrade".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/upgrade", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DatabaseUpgradeInfo]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DatabaseUpgradeInfo]: if response.status_code == 200: response_200 = DatabaseUpgradeInfo.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -53,7 +46,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DatabaseUpgradeInfo]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[DatabaseUpgradeInfo]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,9 +62,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[DatabaseUpgradeInfo]: - """ + """ Args: account_id (str): database_id (str): @@ -80,13 +74,11 @@ def sync_detailed( Returns: Response[DatabaseUpgradeInfo] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -95,14 +87,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Optional[DatabaseUpgradeInfo]: - """ + """ Args: account_id (str): database_id (str): @@ -113,24 +105,22 @@ def sync( Returns: DatabaseUpgradeInfo - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, - + database_id=database_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Response[DatabaseUpgradeInfo]: - """ + """ Args: account_id (str): database_id (str): @@ -141,29 +131,25 @@ async def asyncio_detailed( Returns: Response[DatabaseUpgradeInfo] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, - ) -> Optional[DatabaseUpgradeInfo]: - """ + """ Args: account_id (str): database_id (str): @@ -174,12 +160,12 @@ async def asyncio( Returns: DatabaseUpgradeInfo - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/databases/list_databases.py b/exasol/saas/client/openapi/api/databases/list_databases.py index 6b59db6..e67b2a5 100644 --- a/exasol/saas/client/openapi/api/databases/list_databases.py +++ b/exasol/saas/client/openapi/api/databases/list_databases.py @@ -22,32 +22,25 @@ def _get_kwargs( account_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases".format(account_id=account_id,), + "url": f"/api/v1/accounts/{account_id}/databases", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['ExasolDatabase']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["ExasolDatabase"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = ExasolDatabase.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -57,7 +50,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['ExasolDatabase']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["ExasolDatabase"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,9 +65,8 @@ def sync_detailed( account_id: str, *, client: AuthenticatedClient, - -) -> Response[list['ExasolDatabase']]: - """ +) -> Response[list["ExasolDatabase"]]: + """ Args: account_id (str): @@ -82,12 +76,10 @@ def sync_detailed( Returns: Response[list['ExasolDatabase']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, - ) response = client.get_httpx_client().request( @@ -96,13 +88,13 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['ExasolDatabase']]: - """ +) -> Optional[list["ExasolDatabase"]]: + """ Args: account_id (str): @@ -112,22 +104,20 @@ def sync( Returns: list['ExasolDatabase'] - """ - + """ return sync_detailed( account_id=account_id, -client=client, - + client=client, ).parsed + async def asyncio_detailed( account_id: str, *, client: AuthenticatedClient, - -) -> Response[list['ExasolDatabase']]: - """ +) -> Response[list["ExasolDatabase"]]: + """ Args: account_id (str): @@ -137,27 +127,23 @@ async def asyncio_detailed( Returns: Response[list['ExasolDatabase']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, - ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['ExasolDatabase']]: - """ +) -> Optional[list["ExasolDatabase"]]: + """ Args: account_id (str): @@ -167,11 +153,11 @@ async def asyncio( Returns: list['ExasolDatabase'] - """ - + """ - return (await asyncio_detailed( - account_id=account_id, -client=client, - - )).parsed + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/databases/list_schedules.py b/exasol/saas/client/openapi/api/databases/list_schedules.py index 0306415..2e78c9c 100644 --- a/exasol/saas/client/openapi/api/databases/list_schedules.py +++ b/exasol/saas/client/openapi/api/databases/list_schedules.py @@ -23,32 +23,25 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/schedules".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/schedules", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['Schedule']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["Schedule"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = Schedule.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -58,7 +51,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['Schedule']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["Schedule"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,9 +67,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['Schedule']]: - """ +) -> Response[list["Schedule"]]: + """ Args: account_id (str): database_id (str): @@ -85,13 +79,11 @@ def sync_detailed( Returns: Response[list['Schedule']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -100,14 +92,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['Schedule']]: - """ +) -> Optional[list["Schedule"]]: + """ Args: account_id (str): database_id (str): @@ -118,24 +110,22 @@ def sync( Returns: list['Schedule'] - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, - + database_id=database_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['Schedule']]: - """ +) -> Response[list["Schedule"]]: + """ Args: account_id (str): database_id (str): @@ -146,29 +136,25 @@ async def asyncio_detailed( Returns: Response[list['Schedule']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['Schedule']]: - """ +) -> Optional[list["Schedule"]]: + """ Args: account_id (str): database_id (str): @@ -179,12 +165,12 @@ async def asyncio( Returns: list['Schedule'] - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/databases/set_auto_updates_database.py b/exasol/saas/client/openapi/api/databases/set_auto_updates_database.py index ec2607b..c61277a 100644 --- a/exasol/saas/client/openapi/api/databases/set_auto_updates_database.py +++ b/exasol/saas/client/openapi/api/databases/set_auto_updates_database.py @@ -25,23 +25,16 @@ def _get_kwargs( database_id: str, *, body: SetAutoUpdatesDatabase, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "patch", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/settings".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/settings", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -49,7 +42,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -58,7 +53,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,9 +70,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: SetAutoUpdatesDatabase, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -87,14 +83,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) response = client.get_httpx_client().request( @@ -110,9 +104,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: SetAutoUpdatesDatabase, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -124,19 +117,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/databases/start_database.py b/exasol/saas/client/openapi/api/databases/start_database.py index 7f9287a..a79d1b4 100644 --- a/exasol/saas/client/openapi/api/databases/start_database.py +++ b/exasol/saas/client/openapi/api/databases/start_database.py @@ -22,24 +22,19 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/start".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/start", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -48,7 +43,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,9 +59,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -75,13 +71,11 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -96,9 +90,8 @@ async def asyncio_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -109,18 +102,13 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/databases/stop_database.py b/exasol/saas/client/openapi/api/databases/stop_database.py index e093eba..27d9b30 100644 --- a/exasol/saas/client/openapi/api/databases/stop_database.py +++ b/exasol/saas/client/openapi/api/databases/stop_database.py @@ -22,24 +22,19 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/stop".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/stop", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -48,7 +43,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,9 +59,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -75,13 +71,11 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -96,9 +90,8 @@ async def asyncio_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -109,18 +102,13 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/databases/update_database.py b/exasol/saas/client/openapi/api/databases/update_database.py index 2eeb897..56042fe 100644 --- a/exasol/saas/client/openapi/api/databases/update_database.py +++ b/exasol/saas/client/openapi/api/databases/update_database.py @@ -25,23 +25,16 @@ def _get_kwargs( database_id: str, *, body: UpdateDatabase, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -49,7 +42,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -58,7 +53,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,9 +70,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateDatabase, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -87,14 +83,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) response = client.get_httpx_client().request( @@ -110,9 +104,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateDatabase, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -124,19 +117,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -body=body, - + database_id=database_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/databases/upgrade_database.py b/exasol/saas/client/openapi/api/databases/upgrade_database.py index 0fe1f12..ba261a9 100644 --- a/exasol/saas/client/openapi/api/databases/upgrade_database.py +++ b/exasol/saas/client/openapi/api/databases/upgrade_database.py @@ -22,24 +22,19 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/upgrade".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/upgrade", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -48,7 +43,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,9 +59,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -75,13 +71,11 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -96,9 +90,8 @@ async def asyncio_detailed( database_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -109,18 +102,13 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/extensions/create_extension_instance.py b/exasol/saas/client/openapi/api/extensions/create_extension_instance.py index ec141b3..ef205a3 100644 --- a/exasol/saas/client/openapi/api/extensions/create_extension_instance.py +++ b/exasol/saas/client/openapi/api/extensions/create_extension_instance.py @@ -29,23 +29,16 @@ def _get_kwargs( extension_version: str, *, body: CreateExtensionInstance, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/instances".format(account_id=account_id,database_id=database_id,extension_id=extension_id,extension_version=extension_version,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/instances", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -53,18 +46,16 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[ApiError, ExtensionInstance]]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiError, ExtensionInstance]]: if response.status_code == 200: response_200 = ExtensionInstance.from_dict(response.json()) - - return response_200 if response.status_code == 422: response_422 = ApiError.from_dict(response.json()) - - return response_422 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -72,7 +63,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[ApiError, ExtensionInstance]]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiError, ExtensionInstance]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,9 +82,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateExtensionInstance, - ) -> Response[Union[ApiError, ExtensionInstance]]: - """ + """ Args: account_id (str): database_id (str): @@ -105,16 +97,14 @@ def sync_detailed( Returns: Response[Union[ApiError, ExtensionInstance]] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -body=body, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + body=body, ) response = client.get_httpx_client().request( @@ -123,6 +113,7 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, @@ -131,9 +122,8 @@ def sync( *, client: AuthenticatedClient, body: CreateExtensionInstance, - ) -> Optional[Union[ApiError, ExtensionInstance]]: - """ + """ Args: account_id (str): database_id (str): @@ -147,19 +137,18 @@ def sync( Returns: Union[ApiError, ExtensionInstance] - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -client=client, -body=body, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + client=client, + body=body, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, @@ -168,9 +157,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: CreateExtensionInstance, - ) -> Response[Union[ApiError, ExtensionInstance]]: - """ + """ Args: account_id (str): database_id (str): @@ -184,24 +172,21 @@ async def asyncio_detailed( Returns: Response[Union[ApiError, ExtensionInstance]] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -body=body, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, @@ -210,9 +195,8 @@ async def asyncio( *, client: AuthenticatedClient, body: CreateExtensionInstance, - ) -> Optional[Union[ApiError, ExtensionInstance]]: - """ + """ Args: account_id (str): database_id (str): @@ -226,15 +210,15 @@ async def asyncio( Returns: Union[ApiError, ExtensionInstance] - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -client=client, -body=body, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + client=client, + body=body, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/extensions/delete_extension_instance.py b/exasol/saas/client/openapi/api/extensions/delete_extension_instance.py index e02514a..e5f41d7 100644 --- a/exasol/saas/client/openapi/api/extensions/delete_extension_instance.py +++ b/exasol/saas/client/openapi/api/extensions/delete_extension_instance.py @@ -25,24 +25,19 @@ def _get_kwargs( extension_id: str, extension_version: str, instance_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/instances/{instance_id}".format(account_id=account_id,database_id=database_id,extension_id=extension_id,extension_version=extension_version,instance_id=instance_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/instances/{instance_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -51,7 +46,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,9 +65,8 @@ def sync_detailed( instance_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -84,16 +80,14 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -instance_id=instance_id, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + instance_id=instance_id, ) response = client.get_httpx_client().request( @@ -111,9 +105,8 @@ async def asyncio_detailed( instance_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -127,21 +120,16 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -instance_id=instance_id, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + instance_id=instance_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/extensions/get_extension.py b/exasol/saas/client/openapi/api/extensions/get_extension.py index 5d18326..d607b0c 100644 --- a/exasol/saas/client/openapi/api/extensions/get_extension.py +++ b/exasol/saas/client/openapi/api/extensions/get_extension.py @@ -26,35 +26,26 @@ def _get_kwargs( database_id: str, extension_id: str, extension_version: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}".format(account_id=account_id,database_id=database_id,extension_id=extension_id,extension_version=extension_version,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[ApiError, ExtensionDetail]]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiError, ExtensionDetail]]: if response.status_code == 200: response_200 = ExtensionDetail.from_dict(response.json()) - - return response_200 if response.status_code == 422: response_422 = ApiError.from_dict(response.json()) - - return response_422 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +53,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[ApiError, ExtensionDetail]]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiError, ExtensionDetail]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -78,9 +71,8 @@ def sync_detailed( extension_version: str, *, client: AuthenticatedClient, - ) -> Response[Union[ApiError, ExtensionDetail]]: - """ + """ Args: account_id (str): database_id (str): @@ -93,15 +85,13 @@ def sync_detailed( Returns: Response[Union[ApiError, ExtensionDetail]] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) response = client.get_httpx_client().request( @@ -110,6 +100,7 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, @@ -117,9 +108,8 @@ def sync( extension_version: str, *, client: AuthenticatedClient, - ) -> Optional[Union[ApiError, ExtensionDetail]]: - """ + """ Args: account_id (str): database_id (str): @@ -132,18 +122,17 @@ def sync( Returns: Union[ApiError, ExtensionDetail] - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -client=client, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, @@ -151,9 +140,8 @@ async def asyncio_detailed( extension_version: str, *, client: AuthenticatedClient, - ) -> Response[Union[ApiError, ExtensionDetail]]: - """ + """ Args: account_id (str): database_id (str): @@ -166,23 +154,20 @@ async def asyncio_detailed( Returns: Response[Union[ApiError, ExtensionDetail]] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, @@ -190,9 +175,8 @@ async def asyncio( extension_version: str, *, client: AuthenticatedClient, - ) -> Optional[Union[ApiError, ExtensionDetail]]: - """ + """ Args: account_id (str): database_id (str): @@ -205,14 +189,14 @@ async def asyncio( Returns: Union[ApiError, ExtensionDetail] - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/extensions/install_extension.py b/exasol/saas/client/openapi/api/extensions/install_extension.py index c0c6987..a3f7f4f 100644 --- a/exasol/saas/client/openapi/api/extensions/install_extension.py +++ b/exasol/saas/client/openapi/api/extensions/install_extension.py @@ -24,24 +24,19 @@ def _get_kwargs( database_id: str, extension_id: str, extension_version: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/install".format(account_id=account_id,database_id=database_id,extension_id=extension_id,extension_version=extension_version,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/install", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -50,7 +45,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,9 +63,8 @@ def sync_detailed( extension_version: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -81,15 +77,13 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) response = client.get_httpx_client().request( @@ -106,9 +100,8 @@ async def asyncio_detailed( extension_version: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -121,20 +114,15 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/extensions/list_extension_instances.py b/exasol/saas/client/openapi/api/extensions/list_extension_instances.py index 888980f..fe6d111 100644 --- a/exasol/saas/client/openapi/api/extensions/list_extension_instances.py +++ b/exasol/saas/client/openapi/api/extensions/list_extension_instances.py @@ -26,40 +26,31 @@ def _get_kwargs( database_id: str, extension_id: str, extension_version: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/instances".format(account_id=account_id,database_id=database_id,extension_id=extension_id,extension_version=extension_version,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/instances", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Union[ApiError, list['ExtensionInstance']]]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[ApiError, list["ExtensionInstance"]]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = ExtensionInstance.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 if response.status_code == 422: response_422 = ApiError.from_dict(response.json()) - - return response_422 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -67,7 +58,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Union[ApiError, list['ExtensionInstance']]]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[ApiError, list["ExtensionInstance"]]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -83,9 +76,8 @@ def sync_detailed( extension_version: str, *, client: AuthenticatedClient, - -) -> Response[Union[ApiError, list['ExtensionInstance']]]: - """ +) -> Response[Union[ApiError, list["ExtensionInstance"]]]: + """ Args: account_id (str): database_id (str): @@ -98,15 +90,13 @@ def sync_detailed( Returns: Response[Union[ApiError, list['ExtensionInstance']]] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) response = client.get_httpx_client().request( @@ -115,6 +105,7 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, @@ -122,9 +113,8 @@ def sync( extension_version: str, *, client: AuthenticatedClient, - -) -> Optional[Union[ApiError, list['ExtensionInstance']]]: - """ +) -> Optional[Union[ApiError, list["ExtensionInstance"]]]: + """ Args: account_id (str): database_id (str): @@ -137,18 +127,17 @@ def sync( Returns: Union[ApiError, list['ExtensionInstance']] - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -client=client, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, @@ -156,9 +145,8 @@ async def asyncio_detailed( extension_version: str, *, client: AuthenticatedClient, - -) -> Response[Union[ApiError, list['ExtensionInstance']]]: - """ +) -> Response[Union[ApiError, list["ExtensionInstance"]]]: + """ Args: account_id (str): database_id (str): @@ -171,23 +159,20 @@ async def asyncio_detailed( Returns: Response[Union[ApiError, list['ExtensionInstance']]] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, @@ -195,9 +180,8 @@ async def asyncio( extension_version: str, *, client: AuthenticatedClient, - -) -> Optional[Union[ApiError, list['ExtensionInstance']]]: - """ +) -> Optional[Union[ApiError, list["ExtensionInstance"]]]: + """ Args: account_id (str): database_id (str): @@ -210,14 +194,14 @@ async def asyncio( Returns: Union[ApiError, list['ExtensionInstance']] - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/extensions/list_extensions.py b/exasol/saas/client/openapi/api/extensions/list_extensions.py index db78e7b..1f33ef0 100644 --- a/exasol/saas/client/openapi/api/extensions/list_extensions.py +++ b/exasol/saas/client/openapi/api/extensions/list_extensions.py @@ -23,32 +23,25 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/extensions".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/extensions", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['Extension']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["Extension"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = Extension.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -58,7 +51,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['Extension']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["Extension"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,9 +67,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['Extension']]: - """ +) -> Response[list["Extension"]]: + """ Args: account_id (str): database_id (str): @@ -85,13 +79,11 @@ def sync_detailed( Returns: Response[list['Extension']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -100,14 +92,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['Extension']]: - """ +) -> Optional[list["Extension"]]: + """ Args: account_id (str): database_id (str): @@ -118,24 +110,22 @@ def sync( Returns: list['Extension'] - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, - + database_id=database_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['Extension']]: - """ +) -> Response[list["Extension"]]: + """ Args: account_id (str): database_id (str): @@ -146,29 +136,25 @@ async def asyncio_detailed( Returns: Response[list['Extension']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['Extension']]: - """ +) -> Optional[list["Extension"]]: + """ Args: account_id (str): database_id (str): @@ -179,12 +165,12 @@ async def asyncio( Returns: list['Extension'] - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/extensions/uninstall_extension.py b/exasol/saas/client/openapi/api/extensions/uninstall_extension.py index 43a3c7f..7e415e2 100644 --- a/exasol/saas/client/openapi/api/extensions/uninstall_extension.py +++ b/exasol/saas/client/openapi/api/extensions/uninstall_extension.py @@ -24,24 +24,19 @@ def _get_kwargs( database_id: str, extension_id: str, extension_version: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/uninstall".format(account_id=account_id,database_id=database_id,extension_id=extension_id,extension_version=extension_version,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/extensions/{extension_id}/{extension_version}/uninstall", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -50,7 +45,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -66,9 +63,8 @@ def sync_detailed( extension_version: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -81,15 +77,13 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) response = client.get_httpx_client().request( @@ -106,9 +100,8 @@ async def asyncio_detailed( extension_version: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -121,20 +114,15 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -extension_id=extension_id, -extension_version=extension_version, - + database_id=database_id, + extension_id=extension_id, + extension_version=extension_version, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/files/create_folder.py b/exasol/saas/client/openapi/api/files/create_folder.py index 1569d83..689f0e6 100644 --- a/exasol/saas/client/openapi/api/files/create_folder.py +++ b/exasol/saas/client/openapi/api/files/create_folder.py @@ -23,24 +23,19 @@ def _get_kwargs( account_id: str, database_id: str, key: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/folder/{key}".format(account_id=account_id,database_id=database_id,key=key,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/folder/{key}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -49,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +61,8 @@ def sync_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -78,14 +74,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) response = client.get_httpx_client().request( @@ -101,9 +95,8 @@ async def asyncio_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -115,19 +108,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/files/delete_file.py b/exasol/saas/client/openapi/api/files/delete_file.py index 05bcc7a..33bdb6e 100644 --- a/exasol/saas/client/openapi/api/files/delete_file.py +++ b/exasol/saas/client/openapi/api/files/delete_file.py @@ -23,24 +23,19 @@ def _get_kwargs( account_id: str, database_id: str, key: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/files/{key}".format(account_id=account_id,database_id=database_id,key=key,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/files/{key}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -49,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +61,8 @@ def sync_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -78,14 +74,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) response = client.get_httpx_client().request( @@ -101,9 +95,8 @@ async def asyncio_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -115,19 +108,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/files/delete_folder.py b/exasol/saas/client/openapi/api/files/delete_folder.py index b452272..5f9293a 100644 --- a/exasol/saas/client/openapi/api/files/delete_folder.py +++ b/exasol/saas/client/openapi/api/files/delete_folder.py @@ -23,24 +23,19 @@ def _get_kwargs( account_id: str, database_id: str, key: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/folder/{key}".format(account_id=account_id,database_id=database_id,key=key,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/folder/{key}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -49,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -64,9 +61,8 @@ def sync_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -78,14 +74,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) response = client.get_httpx_client().request( @@ -101,9 +95,8 @@ async def asyncio_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): database_id (str): @@ -115,19 +108,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/files/download_file.py b/exasol/saas/client/openapi/api/files/download_file.py index 341f45d..d68fc34 100644 --- a/exasol/saas/client/openapi/api/files/download_file.py +++ b/exasol/saas/client/openapi/api/files/download_file.py @@ -24,29 +24,22 @@ def _get_kwargs( account_id: str, database_id: str, key: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/internal/accounts/{account_id}/databases/{database_id}/files/{key}".format(account_id=account_id,database_id=database_id,key=key,), + "url": f"/api/v1/internal/accounts/{account_id}/databases/{database_id}/files/{key}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[DownloadFile]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[DownloadFile]: if response.status_code == 200: response_200 = DownloadFile.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -54,7 +47,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[DownloadFile]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[DownloadFile]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,9 +64,8 @@ def sync_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[DownloadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -83,14 +77,12 @@ def sync_detailed( Returns: Response[DownloadFile] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) response = client.get_httpx_client().request( @@ -99,15 +91,15 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, key: str, *, client: AuthenticatedClient, - ) -> Optional[DownloadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -119,26 +111,24 @@ def sync( Returns: DownloadFile - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -key=key, -client=client, - + database_id=database_id, + key=key, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, key: str, *, client: AuthenticatedClient, - ) -> Response[DownloadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -150,31 +140,27 @@ async def asyncio_detailed( Returns: Response[DownloadFile] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, key: str, *, client: AuthenticatedClient, - ) -> Optional[DownloadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -186,13 +172,13 @@ async def asyncio( Returns: DownloadFile - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -key=key, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + key=key, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/files/list_files.py b/exasol/saas/client/openapi/api/files/list_files.py index f7cce57..c1fd9a2 100644 --- a/exasol/saas/client/openapi/api/files/list_files.py +++ b/exasol/saas/client/openapi/api/files/list_files.py @@ -23,32 +23,25 @@ def _get_kwargs( account_id: str, database_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/files".format(account_id=account_id,database_id=database_id,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/files", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['File']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["File"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = File.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -58,7 +51,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['File']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["File"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -72,9 +67,8 @@ def sync_detailed( database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['File']]: - """ +) -> Response[list["File"]]: + """ Args: account_id (str): database_id (str): @@ -85,13 +79,11 @@ def sync_detailed( Returns: Response[list['File']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) response = client.get_httpx_client().request( @@ -100,14 +92,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['File']]: - """ +) -> Optional[list["File"]]: + """ Args: account_id (str): database_id (str): @@ -118,24 +110,22 @@ def sync( Returns: list['File'] - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -client=client, - + database_id=database_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Response[list['File']]: - """ +) -> Response[list["File"]]: + """ Args: account_id (str): database_id (str): @@ -146,29 +136,25 @@ async def asyncio_detailed( Returns: Response[list['File']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, - + database_id=database_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['File']]: - """ +) -> Optional[list["File"]]: + """ Args: account_id (str): database_id (str): @@ -179,12 +165,12 @@ async def asyncio( Returns: list['File'] - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/files/upload_file.py b/exasol/saas/client/openapi/api/files/upload_file.py index 83d29b1..191b21d 100644 --- a/exasol/saas/client/openapi/api/files/upload_file.py +++ b/exasol/saas/client/openapi/api/files/upload_file.py @@ -24,29 +24,22 @@ def _get_kwargs( account_id: str, database_id: str, key: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v1/accounts/{account_id}/databases/{database_id}/files/{key}".format(account_id=account_id,database_id=database_id,key=key,), + "url": f"/api/v1/accounts/{account_id}/databases/{database_id}/files/{key}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[UploadFile]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[UploadFile]: if response.status_code == 200: response_200 = UploadFile.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -54,7 +47,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[UploadFile]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[UploadFile]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,9 +64,8 @@ def sync_detailed( key: str, *, client: AuthenticatedClient, - ) -> Response[UploadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -83,14 +77,12 @@ def sync_detailed( Returns: Response[UploadFile] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) response = client.get_httpx_client().request( @@ -99,15 +91,15 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, database_id: str, key: str, *, client: AuthenticatedClient, - ) -> Optional[UploadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -119,26 +111,24 @@ def sync( Returns: UploadFile - """ - + """ return sync_detailed( account_id=account_id, -database_id=database_id, -key=key, -client=client, - + database_id=database_id, + key=key, + client=client, ).parsed + async def asyncio_detailed( account_id: str, database_id: str, key: str, *, client: AuthenticatedClient, - ) -> Response[UploadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -150,31 +140,27 @@ async def asyncio_detailed( Returns: Response[UploadFile] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -database_id=database_id, -key=key, - + database_id=database_id, + key=key, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, database_id: str, key: str, *, client: AuthenticatedClient, - ) -> Optional[UploadFile]: - """ + """ Args: account_id (str): database_id (str): @@ -186,13 +172,13 @@ async def asyncio( Returns: UploadFile - """ - - - return (await asyncio_detailed( - account_id=account_id, -database_id=database_id, -key=key, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + database_id=database_id, + key=key, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/platform/list_cluster_sizes.py b/exasol/saas/client/openapi/api/platform/list_cluster_sizes.py index a13b4f9..2499150 100644 --- a/exasol/saas/client/openapi/api/platform/list_cluster_sizes.py +++ b/exasol/saas/client/openapi/api/platform/list_cluster_sizes.py @@ -22,32 +22,25 @@ def _get_kwargs( platform: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/platforms/{platform}/sizes".format(platform=platform,), + "url": f"/api/v1/platforms/{platform}/sizes", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['ClusterSize']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["ClusterSize"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = ClusterSize.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -57,7 +50,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['ClusterSize']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["ClusterSize"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,9 +65,8 @@ def sync_detailed( platform: str, *, client: AuthenticatedClient, - -) -> Response[list['ClusterSize']]: - """ +) -> Response[list["ClusterSize"]]: + """ Args: platform (str): @@ -82,12 +76,10 @@ def sync_detailed( Returns: Response[list['ClusterSize']] - """ - + """ kwargs = _get_kwargs( platform=platform, - ) response = client.get_httpx_client().request( @@ -96,13 +88,13 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( platform: str, *, client: AuthenticatedClient, - -) -> Optional[list['ClusterSize']]: - """ +) -> Optional[list["ClusterSize"]]: + """ Args: platform (str): @@ -112,22 +104,20 @@ def sync( Returns: list['ClusterSize'] - """ - + """ return sync_detailed( platform=platform, -client=client, - + client=client, ).parsed + async def asyncio_detailed( platform: str, *, client: AuthenticatedClient, - -) -> Response[list['ClusterSize']]: - """ +) -> Response[list["ClusterSize"]]: + """ Args: platform (str): @@ -137,27 +127,23 @@ async def asyncio_detailed( Returns: Response[list['ClusterSize']] - """ - + """ kwargs = _get_kwargs( platform=platform, - ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( platform: str, *, client: AuthenticatedClient, - -) -> Optional[list['ClusterSize']]: - """ +) -> Optional[list["ClusterSize"]]: + """ Args: platform (str): @@ -167,11 +153,11 @@ async def asyncio( Returns: list['ClusterSize'] - """ - + """ - return (await asyncio_detailed( - platform=platform, -client=client, - - )).parsed + return ( + await asyncio_detailed( + platform=platform, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/platform/list_platforms.py b/exasol/saas/client/openapi/api/platform/list_platforms.py index e416db9..ec98e52 100644 --- a/exasol/saas/client/openapi/api/platform/list_platforms.py +++ b/exasol/saas/client/openapi/api/platform/list_platforms.py @@ -20,33 +20,25 @@ ) -def _get_kwargs( - -) -> dict[str, Any]: - - - - - +def _get_kwargs() -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/platforms", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['Platform']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["Platform"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = Platform.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -56,7 +48,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['Platform']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["Platform"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -68,21 +62,17 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( *, client: AuthenticatedClient, - -) -> Response[list['Platform']]: - """ +) -> Response[list["Platform"]]: + """ Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: Response[list['Platform']] - """ + """ - - kwargs = _get_kwargs( - - ) + kwargs = _get_kwargs() response = client.get_httpx_client().request( **kwargs, @@ -90,67 +80,60 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( *, client: AuthenticatedClient, - -) -> Optional[list['Platform']]: - """ +) -> Optional[list["Platform"]]: + """ Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: list['Platform'] - """ - + """ return sync_detailed( client=client, - ).parsed + async def asyncio_detailed( *, client: AuthenticatedClient, - -) -> Response[list['Platform']]: - """ +) -> Response[list["Platform"]]: + """ Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: Response[list['Platform']] - """ - + """ - kwargs = _get_kwargs( - - ) + kwargs = _get_kwargs() - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( *, client: AuthenticatedClient, - -) -> Optional[list['Platform']]: - """ +) -> Optional[list["Platform"]]: + """ Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: list['Platform'] - """ - + """ - return (await asyncio_detailed( - client=client, - - )).parsed + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/platform/list_regions.py b/exasol/saas/client/openapi/api/platform/list_regions.py index d01fc56..a09ea5a 100644 --- a/exasol/saas/client/openapi/api/platform/list_regions.py +++ b/exasol/saas/client/openapi/api/platform/list_regions.py @@ -22,32 +22,25 @@ def _get_kwargs( platform: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/platforms/{platform}/regions".format(platform=platform,), + "url": f"/api/v1/platforms/{platform}/regions", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['Region']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["Region"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = Region.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -57,7 +50,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['Region']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["Region"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,9 +65,8 @@ def sync_detailed( platform: str, *, client: AuthenticatedClient, - -) -> Response[list['Region']]: - """ +) -> Response[list["Region"]]: + """ Args: platform (str): @@ -82,12 +76,10 @@ def sync_detailed( Returns: Response[list['Region']] - """ - + """ kwargs = _get_kwargs( platform=platform, - ) response = client.get_httpx_client().request( @@ -96,13 +88,13 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( platform: str, *, client: AuthenticatedClient, - -) -> Optional[list['Region']]: - """ +) -> Optional[list["Region"]]: + """ Args: platform (str): @@ -112,22 +104,20 @@ def sync( Returns: list['Region'] - """ - + """ return sync_detailed( platform=platform, -client=client, - + client=client, ).parsed + async def asyncio_detailed( platform: str, *, client: AuthenticatedClient, - -) -> Response[list['Region']]: - """ +) -> Response[list["Region"]]: + """ Args: platform (str): @@ -137,27 +127,23 @@ async def asyncio_detailed( Returns: Response[list['Region']] - """ - + """ kwargs = _get_kwargs( platform=platform, - ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( platform: str, *, client: AuthenticatedClient, - -) -> Optional[list['Region']]: - """ +) -> Optional[list["Region"]]: + """ Args: platform (str): @@ -167,11 +153,11 @@ async def asyncio( Returns: list['Region'] - """ - + """ - return (await asyncio_detailed( - platform=platform, -client=client, - - )).parsed + return ( + await asyncio_detailed( + platform=platform, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/profile/update_profile.py b/exasol/saas/client/openapi/api/profile/update_profile.py index 62667e4..553a0ce 100644 --- a/exasol/saas/client/openapi/api/profile/update_profile.py +++ b/exasol/saas/client/openapi/api/profile/update_profile.py @@ -23,15 +23,9 @@ def _get_kwargs( *, body: UpdateProfile, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "put", "url": "/api/v1/me", @@ -39,7 +33,6 @@ def _get_kwargs( _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -47,7 +40,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -56,7 +51,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -69,9 +66,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateProfile, - ) -> Response[Any]: - """ + """ Args: body (UpdateProfile): @@ -81,12 +77,10 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( body=body, - ) response = client.get_httpx_client().request( @@ -100,9 +94,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateProfile, - ) -> Response[Any]: - """ + """ Args: body (UpdateProfile): @@ -112,17 +105,12 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( body=body, - ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/security/add_allowed_ip.py b/exasol/saas/client/openapi/api/security/add_allowed_ip.py index 228464e..7d48a49 100644 --- a/exasol/saas/client/openapi/api/security/add_allowed_ip.py +++ b/exasol/saas/client/openapi/api/security/add_allowed_ip.py @@ -25,23 +25,16 @@ def _get_kwargs( account_id: str, *, body: CreateAllowedIP, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "post", - "url": "/api/v1/accounts/{account_id}/security/allowlist_ip".format(account_id=account_id,), + "url": f"/api/v1/accounts/{account_id}/security/allowlist_ip", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -49,12 +42,12 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AllowedIP]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AllowedIP]: if response.status_code == 200: response_200 = AllowedIP.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -62,7 +55,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AllowedIP]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AllowedIP]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -76,9 +71,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: CreateAllowedIP, - ) -> Response[AllowedIP]: - """ + """ Args: account_id (str): body (CreateAllowedIP): @@ -89,13 +83,11 @@ def sync_detailed( Returns: Response[AllowedIP] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -body=body, - + body=body, ) response = client.get_httpx_client().request( @@ -104,14 +96,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, *, client: AuthenticatedClient, body: CreateAllowedIP, - ) -> Optional[AllowedIP]: - """ + """ Args: account_id (str): body (CreateAllowedIP): @@ -122,24 +114,22 @@ def sync( Returns: AllowedIP - """ - + """ return sync_detailed( account_id=account_id, -client=client, -body=body, - + client=client, + body=body, ).parsed + async def asyncio_detailed( account_id: str, *, client: AuthenticatedClient, body: CreateAllowedIP, - ) -> Response[AllowedIP]: - """ + """ Args: account_id (str): body (CreateAllowedIP): @@ -150,29 +140,25 @@ async def asyncio_detailed( Returns: Response[AllowedIP] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -body=body, - + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, *, client: AuthenticatedClient, body: CreateAllowedIP, - ) -> Optional[AllowedIP]: - """ + """ Args: account_id (str): body (CreateAllowedIP): @@ -183,12 +169,12 @@ async def asyncio( Returns: AllowedIP - """ - - - return (await asyncio_detailed( - account_id=account_id, -client=client, -body=body, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + body=body, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/security/delete_allowed_ip.py b/exasol/saas/client/openapi/api/security/delete_allowed_ip.py index f154007..b209d03 100644 --- a/exasol/saas/client/openapi/api/security/delete_allowed_ip.py +++ b/exasol/saas/client/openapi/api/security/delete_allowed_ip.py @@ -22,24 +22,19 @@ def _get_kwargs( account_id: str, allowlist_ip_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/security/allowlist_ip/{allowlist_ip_id}".format(account_id=account_id,allowlist_ip_id=allowlist_ip_id,), + "url": f"/api/v1/accounts/{account_id}/security/allowlist_ip/{allowlist_ip_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -48,7 +43,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,9 +59,8 @@ def sync_detailed( allowlist_ip_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -75,13 +71,11 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -allowlist_ip_id=allowlist_ip_id, - + allowlist_ip_id=allowlist_ip_id, ) response = client.get_httpx_client().request( @@ -96,9 +90,8 @@ async def asyncio_detailed( allowlist_ip_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -109,18 +102,13 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -allowlist_ip_id=allowlist_ip_id, - + allowlist_ip_id=allowlist_ip_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/security/get_allowed_ip.py b/exasol/saas/client/openapi/api/security/get_allowed_ip.py index 1e7a013..025b43e 100644 --- a/exasol/saas/client/openapi/api/security/get_allowed_ip.py +++ b/exasol/saas/client/openapi/api/security/get_allowed_ip.py @@ -23,29 +23,22 @@ def _get_kwargs( account_id: str, allowlist_ip_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/security/allowlist_ip/{allowlist_ip_id}".format(account_id=account_id,allowlist_ip_id=allowlist_ip_id,), + "url": f"/api/v1/accounts/{account_id}/security/allowlist_ip/{allowlist_ip_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AllowedIP]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[AllowedIP]: if response.status_code == 200: response_200 = AllowedIP.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -53,7 +46,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AllowedIP]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[AllowedIP]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,9 +62,8 @@ def sync_detailed( allowlist_ip_id: str, *, client: AuthenticatedClient, - ) -> Response[AllowedIP]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -80,13 +74,11 @@ def sync_detailed( Returns: Response[AllowedIP] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -allowlist_ip_id=allowlist_ip_id, - + allowlist_ip_id=allowlist_ip_id, ) response = client.get_httpx_client().request( @@ -95,14 +87,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, allowlist_ip_id: str, *, client: AuthenticatedClient, - ) -> Optional[AllowedIP]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -113,24 +105,22 @@ def sync( Returns: AllowedIP - """ - + """ return sync_detailed( account_id=account_id, -allowlist_ip_id=allowlist_ip_id, -client=client, - + allowlist_ip_id=allowlist_ip_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, allowlist_ip_id: str, *, client: AuthenticatedClient, - ) -> Response[AllowedIP]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -141,29 +131,25 @@ async def asyncio_detailed( Returns: Response[AllowedIP] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -allowlist_ip_id=allowlist_ip_id, - + allowlist_ip_id=allowlist_ip_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, allowlist_ip_id: str, *, client: AuthenticatedClient, - ) -> Optional[AllowedIP]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -174,12 +160,12 @@ async def asyncio( Returns: AllowedIP - """ - - - return (await asyncio_detailed( - account_id=account_id, -allowlist_ip_id=allowlist_ip_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + allowlist_ip_id=allowlist_ip_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/security/list_allowed_i_ps.py b/exasol/saas/client/openapi/api/security/list_allowed_i_ps.py index fb48e64..2f476c6 100644 --- a/exasol/saas/client/openapi/api/security/list_allowed_i_ps.py +++ b/exasol/saas/client/openapi/api/security/list_allowed_i_ps.py @@ -22,32 +22,25 @@ def _get_kwargs( account_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/security/allowlist_ip".format(account_id=account_id,), + "url": f"/api/v1/accounts/{account_id}/security/allowlist_ip", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['AllowedIP']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["AllowedIP"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = AllowedIP.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -57,7 +50,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['AllowedIP']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["AllowedIP"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -70,9 +65,8 @@ def sync_detailed( account_id: str, *, client: AuthenticatedClient, - -) -> Response[list['AllowedIP']]: - """ +) -> Response[list["AllowedIP"]]: + """ Args: account_id (str): @@ -82,12 +76,10 @@ def sync_detailed( Returns: Response[list['AllowedIP']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, - ) response = client.get_httpx_client().request( @@ -96,13 +88,13 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['AllowedIP']]: - """ +) -> Optional[list["AllowedIP"]]: + """ Args: account_id (str): @@ -112,22 +104,20 @@ def sync( Returns: list['AllowedIP'] - """ - + """ return sync_detailed( account_id=account_id, -client=client, - + client=client, ).parsed + async def asyncio_detailed( account_id: str, *, client: AuthenticatedClient, - -) -> Response[list['AllowedIP']]: - """ +) -> Response[list["AllowedIP"]]: + """ Args: account_id (str): @@ -137,27 +127,23 @@ async def asyncio_detailed( Returns: Response[list['AllowedIP']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, - ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, *, client: AuthenticatedClient, - -) -> Optional[list['AllowedIP']]: - """ +) -> Optional[list["AllowedIP"]]: + """ Args: account_id (str): @@ -167,11 +153,11 @@ async def asyncio( Returns: list['AllowedIP'] - """ - + """ - return (await asyncio_detailed( - account_id=account_id, -client=client, - - )).parsed + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/security/update_allowed_ip.py b/exasol/saas/client/openapi/api/security/update_allowed_ip.py index 31df302..889bbe9 100644 --- a/exasol/saas/client/openapi/api/security/update_allowed_ip.py +++ b/exasol/saas/client/openapi/api/security/update_allowed_ip.py @@ -25,23 +25,16 @@ def _get_kwargs( allowlist_ip_id: str, *, body: UpdateAllowedIP, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "put", - "url": "/api/v1/accounts/{account_id}/security/allowlist_ip/{allowlist_ip_id}".format(account_id=account_id,allowlist_ip_id=allowlist_ip_id,), + "url": f"/api/v1/accounts/{account_id}/security/allowlist_ip/{allowlist_ip_id}", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -49,7 +42,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -58,7 +53,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,9 +70,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: UpdateAllowedIP, - ) -> Response[Any]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -87,14 +83,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -allowlist_ip_id=allowlist_ip_id, -body=body, - + allowlist_ip_id=allowlist_ip_id, + body=body, ) response = client.get_httpx_client().request( @@ -110,9 +104,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: UpdateAllowedIP, - ) -> Response[Any]: - """ + """ Args: account_id (str): allowlist_ip_id (str): @@ -124,19 +117,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -allowlist_ip_id=allowlist_ip_id, -body=body, - + allowlist_ip_id=allowlist_ip_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/usage/get_usage.py b/exasol/saas/client/openapi/api/usage/get_usage.py index 1951c74..be004a8 100644 --- a/exasol/saas/client/openapi/api/usage/get_usage.py +++ b/exasol/saas/client/openapi/api/usage/get_usage.py @@ -27,11 +27,7 @@ def _get_kwargs( *, year_month: Union[Unset, str] = UNSET, type_: Union[Unset, GetUsageType] = UNSET, - ) -> dict[str, Any]: - - - params: dict[str, Any] = {} @@ -43,26 +39,23 @@ def _get_kwargs( params["type"] = json_type_ - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/usage".format(account_id=account_id,), + "url": f"/api/v1/accounts/{account_id}/usage", "params": params, } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Usage]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Usage]: if response.status_code == 200: response_200 = Usage.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -70,7 +63,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Usage]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Usage]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -85,9 +80,8 @@ def sync_detailed( client: AuthenticatedClient, year_month: Union[Unset, str] = UNSET, type_: Union[Unset, GetUsageType] = UNSET, - ) -> Response[Usage]: - """ + """ Args: account_id (str): year_month (Union[Unset, str]): @@ -99,14 +93,12 @@ def sync_detailed( Returns: Response[Usage] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -year_month=year_month, -type_=type_, - + year_month=year_month, + type_=type_, ) response = client.get_httpx_client().request( @@ -115,15 +107,15 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, *, client: AuthenticatedClient, year_month: Union[Unset, str] = UNSET, type_: Union[Unset, GetUsageType] = UNSET, - ) -> Optional[Usage]: - """ + """ Args: account_id (str): year_month (Union[Unset, str]): @@ -135,26 +127,24 @@ def sync( Returns: Usage - """ - + """ return sync_detailed( account_id=account_id, -client=client, -year_month=year_month, -type_=type_, - + client=client, + year_month=year_month, + type_=type_, ).parsed + async def asyncio_detailed( account_id: str, *, client: AuthenticatedClient, year_month: Union[Unset, str] = UNSET, type_: Union[Unset, GetUsageType] = UNSET, - ) -> Response[Usage]: - """ + """ Args: account_id (str): year_month (Union[Unset, str]): @@ -166,31 +156,27 @@ async def asyncio_detailed( Returns: Response[Usage] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -year_month=year_month, -type_=type_, - + year_month=year_month, + type_=type_, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, *, client: AuthenticatedClient, year_month: Union[Unset, str] = UNSET, type_: Union[Unset, GetUsageType] = UNSET, - ) -> Optional[Usage]: - """ + """ Args: account_id (str): year_month (Union[Unset, str]): @@ -202,13 +188,13 @@ async def asyncio( Returns: Usage - """ - - - return (await asyncio_detailed( - account_id=account_id, -client=client, -year_month=year_month, -type_=type_, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + year_month=year_month, + type_=type_, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/users/delete_user.py b/exasol/saas/client/openapi/api/users/delete_user.py index 9c98618..2a96219 100644 --- a/exasol/saas/client/openapi/api/users/delete_user.py +++ b/exasol/saas/client/openapi/api/users/delete_user.py @@ -22,24 +22,19 @@ def _get_kwargs( account_id: str, user_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "delete", - "url": "/api/v1/accounts/{account_id}/users/{user_id}".format(account_id=account_id,user_id=user_id,), + "url": f"/api/v1/accounts/{account_id}/users/{user_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -48,7 +43,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -62,9 +59,8 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): user_id (str): @@ -75,13 +71,11 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -user_id=user_id, - + user_id=user_id, ) response = client.get_httpx_client().request( @@ -96,9 +90,8 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, - ) -> Response[Any]: - """ + """ Args: account_id (str): user_id (str): @@ -109,18 +102,13 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -user_id=user_id, - + user_id=user_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/api/users/get_user.py b/exasol/saas/client/openapi/api/users/get_user.py index 4d26f3f..f08053b 100644 --- a/exasol/saas/client/openapi/api/users/get_user.py +++ b/exasol/saas/client/openapi/api/users/get_user.py @@ -23,29 +23,22 @@ def _get_kwargs( account_id: str, user_id: str, - ) -> dict[str, Any]: - - - - - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/internal/accounts/{account_id}/users/{user_id}".format(account_id=account_id,user_id=user_id,), + "url": f"/api/v1/internal/accounts/{account_id}/users/{user_id}", } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[User]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[User]: if response.status_code == 200: response_200 = User.from_dict(response.json()) - - return response_200 if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) @@ -53,7 +46,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[User]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[User]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -67,9 +62,8 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, - ) -> Response[User]: - """ + """ Args: account_id (str): user_id (str): @@ -80,13 +74,11 @@ def sync_detailed( Returns: Response[User] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -user_id=user_id, - + user_id=user_id, ) response = client.get_httpx_client().request( @@ -95,14 +87,14 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, user_id: str, *, client: AuthenticatedClient, - ) -> Optional[User]: - """ + """ Args: account_id (str): user_id (str): @@ -113,24 +105,22 @@ def sync( Returns: User - """ - + """ return sync_detailed( account_id=account_id, -user_id=user_id, -client=client, - + user_id=user_id, + client=client, ).parsed + async def asyncio_detailed( account_id: str, user_id: str, *, client: AuthenticatedClient, - ) -> Response[User]: - """ + """ Args: account_id (str): user_id (str): @@ -141,29 +131,25 @@ async def asyncio_detailed( Returns: Response[User] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -user_id=user_id, - + user_id=user_id, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, user_id: str, *, client: AuthenticatedClient, - ) -> Optional[User]: - """ + """ Args: account_id (str): user_id (str): @@ -174,12 +160,12 @@ async def asyncio( Returns: User - """ - - - return (await asyncio_detailed( - account_id=account_id, -user_id=user_id, -client=client, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + user_id=user_id, + client=client, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/users/list_users.py b/exasol/saas/client/openapi/api/users/list_users.py index 0437e18..dad1431 100644 --- a/exasol/saas/client/openapi/api/users/list_users.py +++ b/exasol/saas/client/openapi/api/users/list_users.py @@ -27,11 +27,7 @@ def _get_kwargs( filter_: Union[Unset, str] = UNSET, next_: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, - ) -> dict[str, Any]: - - - params: dict[str, Any] = {} @@ -41,29 +37,26 @@ def _get_kwargs( params["limit"] = limit - params = {k: v for k, v in params.items() if v is not UNSET and v is not None} - _kwargs: dict[str, Any] = { "method": "get", - "url": "/api/v1/accounts/{account_id}/users".format(account_id=account_id,), + "url": f"/api/v1/accounts/{account_id}/users", "params": params, } - return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list['User']]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[list["User"]]: if response.status_code == 200: response_200 = [] _response_200 = response.json() - for response_200_item_data in (_response_200): + for response_200_item_data in _response_200: response_200_item = User.from_dict(response_200_item_data) - - response_200.append(response_200_item) return response_200 @@ -73,7 +66,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list['User']]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[list["User"]]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,9 +84,8 @@ def sync_detailed( filter_: Union[Unset, str] = UNSET, next_: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, - -) -> Response[list['User']]: - """ +) -> Response[list["User"]]: + """ Args: account_id (str): filter_ (Union[Unset, str]): @@ -104,15 +98,13 @@ def sync_detailed( Returns: Response[list['User']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -filter_=filter_, -next_=next_, -limit=limit, - + filter_=filter_, + next_=next_, + limit=limit, ) response = client.get_httpx_client().request( @@ -121,6 +113,7 @@ def sync_detailed( return _build_response(client=client, response=response) + def sync( account_id: str, *, @@ -128,9 +121,8 @@ def sync( filter_: Union[Unset, str] = UNSET, next_: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, - -) -> Optional[list['User']]: - """ +) -> Optional[list["User"]]: + """ Args: account_id (str): filter_ (Union[Unset, str]): @@ -143,18 +135,17 @@ def sync( Returns: list['User'] - """ - + """ return sync_detailed( account_id=account_id, -client=client, -filter_=filter_, -next_=next_, -limit=limit, - + client=client, + filter_=filter_, + next_=next_, + limit=limit, ).parsed + async def asyncio_detailed( account_id: str, *, @@ -162,9 +153,8 @@ async def asyncio_detailed( filter_: Union[Unset, str] = UNSET, next_: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, - -) -> Response[list['User']]: - """ +) -> Response[list["User"]]: + """ Args: account_id (str): filter_ (Union[Unset, str]): @@ -177,23 +167,20 @@ async def asyncio_detailed( Returns: Response[list['User']] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -filter_=filter_, -next_=next_, -limit=limit, - + filter_=filter_, + next_=next_, + limit=limit, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) + async def asyncio( account_id: str, *, @@ -201,9 +188,8 @@ async def asyncio( filter_: Union[Unset, str] = UNSET, next_: Union[Unset, int] = UNSET, limit: Union[Unset, int] = UNSET, - -) -> Optional[list['User']]: - """ +) -> Optional[list["User"]]: + """ Args: account_id (str): filter_ (Union[Unset, str]): @@ -216,14 +202,14 @@ async def asyncio( Returns: list['User'] - """ - - - return (await asyncio_detailed( - account_id=account_id, -client=client, -filter_=filter_, -next_=next_, -limit=limit, - - )).parsed + """ + + return ( + await asyncio_detailed( + account_id=account_id, + client=client, + filter_=filter_, + next_=next_, + limit=limit, + ) + ).parsed diff --git a/exasol/saas/client/openapi/api/users/patch_user.py b/exasol/saas/client/openapi/api/users/patch_user.py index 7e9fd31..ef4bc39 100644 --- a/exasol/saas/client/openapi/api/users/patch_user.py +++ b/exasol/saas/client/openapi/api/users/patch_user.py @@ -25,23 +25,16 @@ def _get_kwargs( user_id: str, *, body: PatchUser, - ) -> dict[str, Any]: headers: dict[str, Any] = {} - - - - - _kwargs: dict[str, Any] = { "method": "patch", - "url": "/api/v1/accounts/{account_id}/users/{user_id}".format(account_id=account_id,user_id=user_id,), + "url": f"/api/v1/accounts/{account_id}/users/{user_id}", } _body = body.to_dict() - _kwargs["json"] = _body headers["Content-Type"] = "application/json" @@ -49,7 +42,9 @@ def _get_kwargs( return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]: +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Any]: if response.status_code == 204: return None if client.raise_on_unexpected_status: @@ -58,7 +53,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]: +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Any]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -73,9 +70,8 @@ def sync_detailed( *, client: AuthenticatedClient, body: PatchUser, - ) -> Response[Any]: - """ + """ Args: account_id (str): user_id (str): @@ -87,14 +83,12 @@ def sync_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -user_id=user_id, -body=body, - + user_id=user_id, + body=body, ) response = client.get_httpx_client().request( @@ -110,9 +104,8 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: PatchUser, - ) -> Response[Any]: - """ + """ Args: account_id (str): user_id (str): @@ -124,19 +117,14 @@ async def asyncio_detailed( Returns: Response[Any] - """ - + """ kwargs = _get_kwargs( account_id=account_id, -user_id=user_id, -body=body, - + user_id=user_id, + body=body, ) - response = await client.get_async_httpx_client().request( - **kwargs - ) + response = await client.get_async_httpx_client().request(**kwargs) return _build_response(client=client, response=response) - diff --git a/exasol/saas/client/openapi/client.py b/exasol/saas/client/openapi/client.py index 7ead9ef..605406a 100644 --- a/exasol/saas/client/openapi/client.py +++ b/exasol/saas/client/openapi/client.py @@ -41,13 +41,20 @@ class Client: status code that was not documented in the source OpenAPI document. Can also be provided as a keyword argument to the constructor. """ + raise_on_unexpected_status: bool = field(default=False, kw_only=True) _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -175,9 +182,15 @@ class AuthenticatedClient: _base_url: str = field(alias="base_url") _cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies") _headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers") - _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout") - _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl") - _follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects") + _timeout: Optional[httpx.Timeout] = field( + default=None, kw_only=True, alias="timeout" + ) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field( + default=True, kw_only=True, alias="verify_ssl" + ) + _follow_redirects: bool = field( + default=False, kw_only=True, alias="follow_redirects" + ) _httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args") _client: Optional[httpx.Client] = field(default=None, init=False) _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) @@ -221,7 +234,9 @@ def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": def get_httpx_client(self) -> httpx.Client: """Get the underlying httpx.Client, constructing a new one if not previously set""" if self._client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._client = httpx.Client( base_url=self._base_url, cookies=self._cookies, @@ -242,7 +257,9 @@ def __exit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for internal httpx.Client (see httpx docs)""" self.get_httpx_client().__exit__(*args, **kwargs) - def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + def set_async_httpx_client( + self, async_client: httpx.AsyncClient + ) -> "AuthenticatedClient": """Manually the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. @@ -253,7 +270,9 @@ def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Authentica def get_async_httpx_client(self) -> httpx.AsyncClient: """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" if self._async_client is None: - self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._headers[self.auth_header_name] = ( + f"{self.prefix} {self.token}" if self.prefix else self.token + ) self._async_client = httpx.AsyncClient( base_url=self._base_url, cookies=self._cookies, @@ -273,4 +292,3 @@ async def __aenter__(self) -> "AuthenticatedClient": async def __aexit__(self, *args: Any, **kwargs: Any) -> None: """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" await self.get_async_httpx_client().__aexit__(*args, **kwargs) - diff --git a/exasol/saas/client/openapi/errors.py b/exasol/saas/client/openapi/errors.py index b912123..5f92e76 100644 --- a/exasol/saas/client/openapi/errors.py +++ b/exasol/saas/client/openapi/errors.py @@ -1,4 +1,5 @@ -""" Contains shared errors types that can be raised from API functions """ +"""Contains shared errors types that can be raised from API functions""" + class UnexpectedStatus(Exception): """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" @@ -11,4 +12,5 @@ def __init__(self, status_code: int, content: bytes): f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}" ) + __all__ = ["UnexpectedStatus"] diff --git a/exasol/saas/client/openapi/models/__init__.py b/exasol/saas/client/openapi/models/__init__.py index acf1a38..0caf673 100644 --- a/exasol/saas/client/openapi/models/__init__.py +++ b/exasol/saas/client/openapi/models/__init__.py @@ -1,4 +1,4 @@ -""" Contains all the data models used in inputs/outputs """ +"""Contains all the data models used in inputs/outputs""" from .allowed_ip import AllowedIP from .api_error import ApiError diff --git a/exasol/saas/client/openapi/models/allowed_ip.py b/exasol/saas/client/openapi/models/allowed_ip.py index 83dd291..62a1b75 100644 --- a/exasol/saas/client/openapi/models/allowed_ip.py +++ b/exasol/saas/client/openapi/models/allowed_ip.py @@ -24,16 +24,16 @@ @_attrs_define class AllowedIP: - """ - Attributes: - id (str): - name (str): - cidr_ip (str): - created_at (datetime.datetime): - created_by (str): - deleted_by (Union[Unset, str]): - deleted_at (Union[Unset, datetime.datetime]): - """ + """ + Attributes: + id (str): + name (str): + cidr_ip (str): + created_at (datetime.datetime): + created_by (str): + deleted_by (Union[Unset, str]): + deleted_at (Union[Unset, datetime.datetime]): + """ id: str name: str @@ -43,7 +43,6 @@ class AllowedIP: deleted_by: Union[Unset, str] = UNSET deleted_at: Union[Unset, datetime.datetime] = UNSET - def to_dict(self) -> dict[str, Any]: id = self.id @@ -61,15 +60,16 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.deleted_at, Unset): deleted_at = self.deleted_at.isoformat() - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - "cidrIp": cidr_ip, - "createdAt": created_at, - "createdBy": created_by, - }) + field_dict.update( + { + "id": id, + "name": name, + "cidrIp": cidr_ip, + "createdAt": created_at, + "createdBy": created_by, + } + ) if deleted_by is not UNSET: field_dict["deletedBy"] = deleted_by if deleted_at is not UNSET: @@ -77,8 +77,6 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -90,23 +88,17 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: created_at = isoparse(d.pop("createdAt")) - - - created_by = d.pop("createdBy") deleted_by = d.pop("deletedBy", UNSET) _deleted_at = d.pop("deletedAt", UNSET) deleted_at: Union[Unset, datetime.datetime] - if isinstance(_deleted_at, Unset): + if isinstance(_deleted_at, Unset): deleted_at = UNSET else: deleted_at = isoparse(_deleted_at) - - - allowed_ip = cls( id=id, name=name, @@ -118,4 +110,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return allowed_ip - diff --git a/exasol/saas/client/openapi/models/api_error.py b/exasol/saas/client/openapi/models/api_error.py index bb0000c..29faee6 100644 --- a/exasol/saas/client/openapi/models/api_error.py +++ b/exasol/saas/client/openapi/models/api_error.py @@ -21,18 +21,18 @@ @_attrs_define class ApiError: - """ - Attributes: - status (float): - message (str): - request_id (str): - path (str): - method (str): - log_id (str): - handler (str): - timestamp (str): - causes (Union[Unset, Any]): - """ + """ + Attributes: + status (float): + message (str): + request_id (str): + path (str): + method (str): + log_id (str): + handler (str): + timestamp (str): + causes (Union[Unset, Any]): + """ status: float message: str @@ -44,7 +44,6 @@ class ApiError: timestamp: str causes: Union[Unset, Any] = UNSET - def to_dict(self) -> dict[str, Any]: status = self.status @@ -64,25 +63,24 @@ def to_dict(self) -> dict[str, Any]: causes = self.causes - field_dict: dict[str, Any] = {} - field_dict.update({ - "status": status, - "message": message, - "requestId": request_id, - "path": path, - "method": method, - "logId": log_id, - "handler": handler, - "timestamp": timestamp, - }) + field_dict.update( + { + "status": status, + "message": message, + "requestId": request_id, + "path": path, + "method": method, + "logId": log_id, + "handler": handler, + "timestamp": timestamp, + } + ) if causes is not UNSET: field_dict["causes"] = causes return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -117,4 +115,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return api_error - diff --git a/exasol/saas/client/openapi/models/auto_stop.py b/exasol/saas/client/openapi/models/auto_stop.py index 7141785..94b7c15 100644 --- a/exasol/saas/client/openapi/models/auto_stop.py +++ b/exasol/saas/client/openapi/models/auto_stop.py @@ -20,32 +20,30 @@ @_attrs_define class AutoStop: - """ - Attributes: - enabled (bool): - idle_time (int): - """ + """ + Attributes: + enabled (bool): + idle_time (int): + """ enabled: bool idle_time: int - def to_dict(self) -> dict[str, Any]: enabled = self.enabled idle_time = self.idle_time - field_dict: dict[str, Any] = {} - field_dict.update({ - "enabled": enabled, - "idleTime": idle_time, - }) + field_dict.update( + { + "enabled": enabled, + "idleTime": idle_time, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return auto_stop - diff --git a/exasol/saas/client/openapi/models/cluster.py b/exasol/saas/client/openapi/models/cluster.py index b5d2681..4144a63 100644 --- a/exasol/saas/client/openapi/models/cluster.py +++ b/exasol/saas/client/openapi/models/cluster.py @@ -21,11 +21,8 @@ ) if TYPE_CHECKING: - from ..models.auto_stop import AutoStop - from ..models.cluster_settings import ClusterSettings - - - + from ..models.auto_stop import AutoStop + from ..models.cluster_settings import ClusterSettings T = TypeVar("T", bound="Cluster") @@ -33,20 +30,20 @@ @_attrs_define class Cluster: - """ - Attributes: - status (Status): - id (str): - name (str): - size (str): - created_at (datetime.datetime): - created_by (str): - main_cluster (bool): - settings (ClusterSettings): - deleted_at (Union[Unset, datetime.datetime]): - deleted_by (Union[Unset, str]): - auto_stop (Union[Unset, AutoStop]): - """ + """ + Attributes: + status (Status): + id (str): + name (str): + size (str): + created_at (datetime.datetime): + created_by (str): + main_cluster (bool): + settings (ClusterSettings): + deleted_at (Union[Unset, datetime.datetime]): + deleted_by (Union[Unset, str]): + auto_stop (Union[Unset, AutoStop]): + """ status: Status id: str @@ -55,15 +52,15 @@ class Cluster: created_at: datetime.datetime created_by: str main_cluster: bool - settings: 'ClusterSettings' + settings: "ClusterSettings" deleted_at: Union[Unset, datetime.datetime] = UNSET deleted_by: Union[Unset, str] = UNSET - auto_stop: Union[Unset, 'AutoStop'] = UNSET - + auto_stop: Union[Unset, "AutoStop"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.auto_stop import AutoStop from ..models.cluster_settings import ClusterSettings + status = self.status.value id = self.id @@ -90,18 +87,19 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.auto_stop, Unset): auto_stop = self.auto_stop.to_dict() - field_dict: dict[str, Any] = {} - field_dict.update({ - "status": status, - "id": id, - "name": name, - "size": size, - "createdAt": created_at, - "createdBy": created_by, - "mainCluster": main_cluster, - "settings": settings, - }) + field_dict.update( + { + "status": status, + "id": id, + "name": name, + "size": size, + "createdAt": created_at, + "createdBy": created_by, + "mainCluster": main_cluster, + "settings": settings, + } + ) if deleted_at is not UNSET: field_dict["deletedAt"] = deleted_at if deleted_by is not UNSET: @@ -111,18 +109,14 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.auto_stop import AutoStop from ..models.cluster_settings import ClusterSettings + d = src_dict.copy() status = Status(d.pop("status")) - - - id = d.pop("id") name = d.pop("name") @@ -131,40 +125,28 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: created_at = isoparse(d.pop("createdAt")) - - - created_by = d.pop("createdBy") main_cluster = d.pop("mainCluster") settings = ClusterSettings.from_dict(d.pop("settings")) - - - _deleted_at = d.pop("deletedAt", UNSET) deleted_at: Union[Unset, datetime.datetime] - if isinstance(_deleted_at, Unset): + if isinstance(_deleted_at, Unset): deleted_at = UNSET else: deleted_at = isoparse(_deleted_at) - - - deleted_by = d.pop("deletedBy", UNSET) _auto_stop = d.pop("autoStop", UNSET) auto_stop: Union[Unset, AutoStop] - if isinstance(_auto_stop, Unset): + if isinstance(_auto_stop, Unset): auto_stop = UNSET else: auto_stop = AutoStop.from_dict(_auto_stop) - - - cluster = cls( status=status, id=id, @@ -180,4 +162,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return cluster - diff --git a/exasol/saas/client/openapi/models/cluster_action_scale.py b/exasol/saas/client/openapi/models/cluster_action_scale.py index 98f79f6..aed60a4 100644 --- a/exasol/saas/client/openapi/models/cluster_action_scale.py +++ b/exasol/saas/client/openapi/models/cluster_action_scale.py @@ -20,32 +20,30 @@ @_attrs_define class ClusterActionScale: - """ - Attributes: - cluster_id (str): - size (str): - """ + """ + Attributes: + cluster_id (str): + size (str): + """ cluster_id: str size: str - def to_dict(self) -> dict[str, Any]: cluster_id = self.cluster_id size = self.size - field_dict: dict[str, Any] = {} - field_dict.update({ - "clusterId": cluster_id, - "size": size, - }) + field_dict.update( + { + "clusterId": cluster_id, + "size": size, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return cluster_action_scale - diff --git a/exasol/saas/client/openapi/models/cluster_action_start_stop.py b/exasol/saas/client/openapi/models/cluster_action_start_stop.py index c27d2a6..68eef38 100644 --- a/exasol/saas/client/openapi/models/cluster_action_start_stop.py +++ b/exasol/saas/client/openapi/models/cluster_action_start_stop.py @@ -20,27 +20,25 @@ @_attrs_define class ClusterActionStartStop: - """ - Attributes: - cluster_id (str): - """ + """ + Attributes: + cluster_id (str): + """ cluster_id: str - def to_dict(self) -> dict[str, Any]: cluster_id = self.cluster_id - field_dict: dict[str, Any] = {} - field_dict.update({ - "clusterId": cluster_id, - }) + field_dict.update( + { + "clusterId": cluster_id, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -51,4 +49,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return cluster_action_start_stop - diff --git a/exasol/saas/client/openapi/models/cluster_connection.py b/exasol/saas/client/openapi/models/cluster_connection.py index 9ca498c..2510824 100644 --- a/exasol/saas/client/openapi/models/cluster_connection.py +++ b/exasol/saas/client/openapi/models/cluster_connection.py @@ -17,10 +17,7 @@ ) if TYPE_CHECKING: - from ..models.connection_i_ps import ConnectionIPs - - - + from ..models.connection_i_ps import ConnectionIPs T = TypeVar("T", bound="ClusterConnection") @@ -28,24 +25,24 @@ @_attrs_define class ClusterConnection: - """ - Attributes: - dns (str): - port (int): - jdbc (str): - ips (ConnectionIPs): - db_username (str): - """ + """ + Attributes: + dns (str): + port (int): + jdbc (str): + ips (ConnectionIPs): + db_username (str): + """ dns: str port: int jdbc: str - ips: 'ConnectionIPs' + ips: "ConnectionIPs" db_username: str - def to_dict(self) -> dict[str, Any]: from ..models.connection_i_ps import ConnectionIPs + dns = self.dns port = self.port @@ -56,23 +53,23 @@ def to_dict(self) -> dict[str, Any]: db_username = self.db_username - field_dict: dict[str, Any] = {} - field_dict.update({ - "dns": dns, - "port": port, - "jdbc": jdbc, - "ips": ips, - "dbUsername": db_username, - }) + field_dict.update( + { + "dns": dns, + "port": port, + "jdbc": jdbc, + "ips": ips, + "dbUsername": db_username, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.connection_i_ps import ConnectionIPs + d = src_dict.copy() dns = d.pop("dns") @@ -82,9 +79,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ips = ConnectionIPs.from_dict(d.pop("ips")) - - - db_username = d.pop("dbUsername") cluster_connection = cls( @@ -96,4 +90,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return cluster_connection - diff --git a/exasol/saas/client/openapi/models/cluster_settings.py b/exasol/saas/client/openapi/models/cluster_settings.py index 584b55c..dbc4a2e 100644 --- a/exasol/saas/client/openapi/models/cluster_settings.py +++ b/exasol/saas/client/openapi/models/cluster_settings.py @@ -20,32 +20,30 @@ @_attrs_define class ClusterSettings: - """ - Attributes: - offload_enabled (bool): - offload_timeout_min (int): - """ + """ + Attributes: + offload_enabled (bool): + offload_timeout_min (int): + """ offload_enabled: bool offload_timeout_min: int - def to_dict(self) -> dict[str, Any]: offload_enabled = self.offload_enabled offload_timeout_min = self.offload_timeout_min - field_dict: dict[str, Any] = {} - field_dict.update({ - "offloadEnabled": offload_enabled, - "offloadTimeoutMin": offload_timeout_min, - }) + field_dict.update( + { + "offloadEnabled": offload_enabled, + "offloadTimeoutMin": offload_timeout_min, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return cluster_settings - diff --git a/exasol/saas/client/openapi/models/cluster_settings_update.py b/exasol/saas/client/openapi/models/cluster_settings_update.py index 0a10f3c..389f862 100644 --- a/exasol/saas/client/openapi/models/cluster_settings_update.py +++ b/exasol/saas/client/openapi/models/cluster_settings_update.py @@ -21,25 +21,22 @@ @_attrs_define class ClusterSettingsUpdate: - """ - Attributes: - offload_enabled (Union[Unset, bool]): - offload_timeout_min (Union[Unset, int]): - """ + """ + Attributes: + offload_enabled (Union[Unset, bool]): + offload_timeout_min (Union[Unset, int]): + """ offload_enabled: Union[Unset, bool] = UNSET offload_timeout_min: Union[Unset, int] = UNSET - def to_dict(self) -> dict[str, Any]: offload_enabled = self.offload_enabled offload_timeout_min = self.offload_timeout_min - field_dict: dict[str, Any] = {} - field_dict.update({ - }) + field_dict.update({}) if offload_enabled is not UNSET: field_dict["offloadEnabled"] = offload_enabled if offload_timeout_min is not UNSET: @@ -47,8 +44,6 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -62,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return cluster_settings_update - diff --git a/exasol/saas/client/openapi/models/cluster_size.py b/exasol/saas/client/openapi/models/cluster_size.py index 76d27a3..077b395 100644 --- a/exasol/saas/client/openapi/models/cluster_size.py +++ b/exasol/saas/client/openapi/models/cluster_size.py @@ -20,15 +20,15 @@ @_attrs_define class ClusterSize: - """ - Attributes: - size (str): - price (float): - vcpu (float): - ram (float): - is_default (bool): - name (str): - """ + """ + Attributes: + size (str): + price (float): + vcpu (float): + ram (float): + is_default (bool): + name (str): + """ size: str price: float @@ -37,7 +37,6 @@ class ClusterSize: is_default: bool name: str - def to_dict(self) -> dict[str, Any]: size = self.size @@ -51,21 +50,20 @@ def to_dict(self) -> dict[str, Any]: name = self.name - field_dict: dict[str, Any] = {} - field_dict.update({ - "size": size, - "price": price, - "vcpu": vcpu, - "ram": ram, - "isDefault": is_default, - "name": name, - }) + field_dict.update( + { + "size": size, + "price": price, + "vcpu": vcpu, + "ram": ram, + "isDefault": is_default, + "name": name, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -91,4 +89,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return cluster_size - diff --git a/exasol/saas/client/openapi/models/connection_i_ps.py b/exasol/saas/client/openapi/models/connection_i_ps.py index 7710377..b488d2f 100644 --- a/exasol/saas/client/openapi/models/connection_i_ps.py +++ b/exasol/saas/client/openapi/models/connection_i_ps.py @@ -21,49 +21,40 @@ @_attrs_define class ConnectionIPs: - """ - Attributes: - private (list[str]): - public (list[str]): - """ + """ + Attributes: + private (list[str]): + public (list[str]): + """ private: list[str] public: list[str] - def to_dict(self) -> dict[str, Any]: private = self.private - - public = self.public - - - field_dict: dict[str, Any] = {} - field_dict.update({ - "private": private, - "public": public, - }) + field_dict.update( + { + "private": private, + "public": public, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() private = cast(list[str], d.pop("private")) - public = cast(list[str], d.pop("public")) - connection_i_ps = cls( private=private, public=public, ) return connection_i_ps - diff --git a/exasol/saas/client/openapi/models/create_allowed_ip.py b/exasol/saas/client/openapi/models/create_allowed_ip.py index 82963fe..9fcc84f 100644 --- a/exasol/saas/client/openapi/models/create_allowed_ip.py +++ b/exasol/saas/client/openapi/models/create_allowed_ip.py @@ -20,32 +20,30 @@ @_attrs_define class CreateAllowedIP: - """ - Attributes: - name (str): - cidr_ip (str): - """ + """ + Attributes: + name (str): + cidr_ip (str): + """ name: str cidr_ip: str - def to_dict(self) -> dict[str, Any]: name = self.name cidr_ip = self.cidr_ip - field_dict: dict[str, Any] = {} - field_dict.update({ - "name": name, - "cidrIp": cidr_ip, - }) + field_dict.update( + { + "name": name, + "cidrIp": cidr_ip, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return create_allowed_ip - diff --git a/exasol/saas/client/openapi/models/create_cluster.py b/exasol/saas/client/openapi/models/create_cluster.py index 4249411..cf28c51 100644 --- a/exasol/saas/client/openapi/models/create_cluster.py +++ b/exasol/saas/client/openapi/models/create_cluster.py @@ -18,11 +18,8 @@ ) if TYPE_CHECKING: - from ..models.auto_stop import AutoStop - from ..models.cluster_settings_update import ClusterSettingsUpdate - - - + from ..models.auto_stop import AutoStop + from ..models.cluster_settings_update import ClusterSettingsUpdate T = TypeVar("T", bound="CreateCluster") @@ -30,23 +27,23 @@ @_attrs_define class CreateCluster: - """ - Attributes: - name (str): - size (str): - auto_stop (Union[Unset, AutoStop]): - settings (Union[Unset, ClusterSettingsUpdate]): - """ + """ + Attributes: + name (str): + size (str): + auto_stop (Union[Unset, AutoStop]): + settings (Union[Unset, ClusterSettingsUpdate]): + """ name: str size: str - auto_stop: Union[Unset, 'AutoStop'] = UNSET - settings: Union[Unset, 'ClusterSettingsUpdate'] = UNSET - + auto_stop: Union[Unset, "AutoStop"] = UNSET + settings: Union[Unset, "ClusterSettingsUpdate"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.auto_stop import AutoStop from ..models.cluster_settings_update import ClusterSettingsUpdate + name = self.name size = self.size @@ -59,12 +56,13 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.settings, Unset): settings = self.settings.to_dict() - field_dict: dict[str, Any] = {} - field_dict.update({ - "name": name, - "size": size, - }) + field_dict.update( + { + "name": name, + "size": size, + } + ) if auto_stop is not UNSET: field_dict["autoStop"] = auto_stop if settings is not UNSET: @@ -72,12 +70,11 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.auto_stop import AutoStop from ..models.cluster_settings_update import ClusterSettingsUpdate + d = src_dict.copy() name = d.pop("name") @@ -85,24 +82,18 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: _auto_stop = d.pop("autoStop", UNSET) auto_stop: Union[Unset, AutoStop] - if isinstance(_auto_stop, Unset): + if isinstance(_auto_stop, Unset): auto_stop = UNSET else: auto_stop = AutoStop.from_dict(_auto_stop) - - - _settings = d.pop("settings", UNSET) settings: Union[Unset, ClusterSettingsUpdate] - if isinstance(_settings, Unset): + if isinstance(_settings, Unset): settings = UNSET else: settings = ClusterSettingsUpdate.from_dict(_settings) - - - create_cluster = cls( name=name, size=size, @@ -111,4 +102,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return create_cluster - diff --git a/exasol/saas/client/openapi/models/create_database.py b/exasol/saas/client/openapi/models/create_database.py index 7e39339..e63b09d 100644 --- a/exasol/saas/client/openapi/models/create_database.py +++ b/exasol/saas/client/openapi/models/create_database.py @@ -18,10 +18,7 @@ ) if TYPE_CHECKING: - from ..models.create_database_initial_cluster import CreateDatabaseInitialCluster - - - + from ..models.create_database_initial_cluster import CreateDatabaseInitialCluster T = TypeVar("T", bound="CreateDatabase") @@ -29,29 +26,29 @@ @_attrs_define class CreateDatabase: - """ - Attributes: - name (str): - initial_cluster (CreateDatabaseInitialCluster): - provider (str): - region (str): - num_nodes (Union[Unset, int]): - stream_type (Union[Unset, str]): - """ + """ + Attributes: + name (str): + initial_cluster (CreateDatabaseInitialCluster): + provider (str): + region (str): + num_nodes (Union[Unset, int]): + stream_type (Union[Unset, str]): + """ name: str - initial_cluster: 'CreateDatabaseInitialCluster' + initial_cluster: "CreateDatabaseInitialCluster" provider: str region: str num_nodes: Union[Unset, int] = UNSET stream_type: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> dict[str, Any]: from ..models.create_database_initial_cluster import ( CreateDatabaseInitialCluster, ) + name = self.name initial_cluster = self.initial_cluster.to_dict() @@ -64,15 +61,16 @@ def to_dict(self) -> dict[str, Any]: stream_type = self.stream_type - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({ - "name": name, - "initialCluster": initial_cluster, - "provider": provider, - "region": region, - }) + field_dict.update( + { + "name": name, + "initialCluster": initial_cluster, + "provider": provider, + "region": region, + } + ) if num_nodes is not UNSET: field_dict["numNodes"] = num_nodes if stream_type is not UNSET: @@ -80,20 +78,18 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.create_database_initial_cluster import ( CreateDatabaseInitialCluster, ) + d = src_dict.copy() name = d.pop("name") - initial_cluster = CreateDatabaseInitialCluster.from_dict(d.pop("initialCluster")) - - - + initial_cluster = CreateDatabaseInitialCluster.from_dict( + d.pop("initialCluster") + ) provider = d.pop("provider") @@ -112,7 +108,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: stream_type=stream_type, ) - create_database.additional_properties = d return create_database diff --git a/exasol/saas/client/openapi/models/create_database_initial_cluster.py b/exasol/saas/client/openapi/models/create_database_initial_cluster.py index 4a03674..6d70db3 100644 --- a/exasol/saas/client/openapi/models/create_database_initial_cluster.py +++ b/exasol/saas/client/openapi/models/create_database_initial_cluster.py @@ -18,11 +18,8 @@ ) if TYPE_CHECKING: - from ..models.auto_stop import AutoStop - from ..models.cluster_settings_update import ClusterSettingsUpdate - - - + from ..models.auto_stop import AutoStop + from ..models.cluster_settings_update import ClusterSettingsUpdate T = TypeVar("T", bound="CreateDatabaseInitialCluster") @@ -30,23 +27,23 @@ @_attrs_define class CreateDatabaseInitialCluster: - """ - Attributes: - name (str): - size (str): - auto_stop (Union[Unset, AutoStop]): - settings (Union[Unset, ClusterSettingsUpdate]): - """ + """ + Attributes: + name (str): + size (str): + auto_stop (Union[Unset, AutoStop]): + settings (Union[Unset, ClusterSettingsUpdate]): + """ name: str size: str - auto_stop: Union[Unset, 'AutoStop'] = UNSET - settings: Union[Unset, 'ClusterSettingsUpdate'] = UNSET - + auto_stop: Union[Unset, "AutoStop"] = UNSET + settings: Union[Unset, "ClusterSettingsUpdate"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.auto_stop import AutoStop from ..models.cluster_settings_update import ClusterSettingsUpdate + name = self.name size = self.size @@ -59,12 +56,13 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.settings, Unset): settings = self.settings.to_dict() - field_dict: dict[str, Any] = {} - field_dict.update({ - "name": name, - "size": size, - }) + field_dict.update( + { + "name": name, + "size": size, + } + ) if auto_stop is not UNSET: field_dict["autoStop"] = auto_stop if settings is not UNSET: @@ -72,12 +70,11 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.auto_stop import AutoStop from ..models.cluster_settings_update import ClusterSettingsUpdate + d = src_dict.copy() name = d.pop("name") @@ -85,24 +82,18 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: _auto_stop = d.pop("autoStop", UNSET) auto_stop: Union[Unset, AutoStop] - if isinstance(_auto_stop, Unset): + if isinstance(_auto_stop, Unset): auto_stop = UNSET else: auto_stop = AutoStop.from_dict(_auto_stop) - - - _settings = d.pop("settings", UNSET) settings: Union[Unset, ClusterSettingsUpdate] - if isinstance(_settings, Unset): + if isinstance(_settings, Unset): settings = UNSET else: settings = ClusterSettingsUpdate.from_dict(_settings) - - - create_database_initial_cluster = cls( name=name, size=size, @@ -111,4 +102,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return create_database_initial_cluster - diff --git a/exasol/saas/client/openapi/models/create_extension_instance.py b/exasol/saas/client/openapi/models/create_extension_instance.py index 309ce3e..a58f962 100644 --- a/exasol/saas/client/openapi/models/create_extension_instance.py +++ b/exasol/saas/client/openapi/models/create_extension_instance.py @@ -17,10 +17,7 @@ ) if TYPE_CHECKING: - from ..models.extension_parameter_value import ExtensionParameterValue - - - + from ..models.extension_parameter_value import ExtensionParameterValue T = TypeVar("T", bound="CreateExtensionInstance") @@ -28,50 +25,46 @@ @_attrs_define class CreateExtensionInstance: - """ - Attributes: - parameter_values (list['ExtensionParameterValue']): - """ - - parameter_values: list['ExtensionParameterValue'] + """ + Attributes: + parameter_values (list['ExtensionParameterValue']): + """ + parameter_values: list["ExtensionParameterValue"] def to_dict(self) -> dict[str, Any]: from ..models.extension_parameter_value import ExtensionParameterValue + parameter_values = [] for parameter_values_item_data in self.parameter_values: parameter_values_item = parameter_values_item_data.to_dict() parameter_values.append(parameter_values_item) - - - field_dict: dict[str, Any] = {} - field_dict.update({ - "parameterValues": parameter_values, - }) + field_dict.update( + { + "parameterValues": parameter_values, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.extension_parameter_value import ExtensionParameterValue + d = src_dict.copy() parameter_values = [] _parameter_values = d.pop("parameterValues") - for parameter_values_item_data in (_parameter_values): - parameter_values_item = ExtensionParameterValue.from_dict(parameter_values_item_data) - - + for parameter_values_item_data in _parameter_values: + parameter_values_item = ExtensionParameterValue.from_dict( + parameter_values_item_data + ) parameter_values.append(parameter_values_item) - create_extension_instance = cls( parameter_values=parameter_values, ) return create_extension_instance - diff --git a/exasol/saas/client/openapi/models/database_settings.py b/exasol/saas/client/openapi/models/database_settings.py index e574299..4451f2e 100644 --- a/exasol/saas/client/openapi/models/database_settings.py +++ b/exasol/saas/client/openapi/models/database_settings.py @@ -20,15 +20,15 @@ @_attrs_define class DatabaseSettings: - """ - Attributes: - offload_enabled (bool): - auto_updates_enabled (bool): - auto_updates_hard_disabled (bool): - num_nodes (int): - stream_type (str): - stream_description (str): - """ + """ + Attributes: + offload_enabled (bool): + auto_updates_enabled (bool): + auto_updates_hard_disabled (bool): + num_nodes (int): + stream_type (str): + stream_description (str): + """ offload_enabled: bool auto_updates_enabled: bool @@ -37,7 +37,6 @@ class DatabaseSettings: stream_type: str stream_description: str - def to_dict(self) -> dict[str, Any]: offload_enabled = self.offload_enabled @@ -51,21 +50,20 @@ def to_dict(self) -> dict[str, Any]: stream_description = self.stream_description - field_dict: dict[str, Any] = {} - field_dict.update({ - "offloadEnabled": offload_enabled, - "autoUpdatesEnabled": auto_updates_enabled, - "autoUpdatesHardDisabled": auto_updates_hard_disabled, - "numNodes": num_nodes, - "streamType": stream_type, - "streamDescription": stream_description, - }) + field_dict.update( + { + "offloadEnabled": offload_enabled, + "autoUpdatesEnabled": auto_updates_enabled, + "autoUpdatesHardDisabled": auto_updates_hard_disabled, + "numNodes": num_nodes, + "streamType": stream_type, + "streamDescription": stream_description, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -91,4 +89,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return database_settings - diff --git a/exasol/saas/client/openapi/models/database_upgrade_info.py b/exasol/saas/client/openapi/models/database_upgrade_info.py index bc331da..70b5fef 100644 --- a/exasol/saas/client/openapi/models/database_upgrade_info.py +++ b/exasol/saas/client/openapi/models/database_upgrade_info.py @@ -20,19 +20,18 @@ @_attrs_define class DatabaseUpgradeInfo: - """ - Attributes: - current_version (str): - update_version (str): - update_possible (bool): - """ + """ + Attributes: + current_version (str): + update_version (str): + update_possible (bool): + """ current_version: str update_version: str update_possible: bool additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> dict[str, Any]: current_version = self.current_version @@ -40,19 +39,18 @@ def to_dict(self) -> dict[str, Any]: update_possible = self.update_possible - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({ - "currentVersion": current_version, - "updateVersion": update_version, - "updatePossible": update_possible, - }) + field_dict.update( + { + "currentVersion": current_version, + "updateVersion": update_version, + "updatePossible": update_possible, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -68,7 +66,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: update_possible=update_possible, ) - database_upgrade_info.additional_properties = d return database_upgrade_info diff --git a/exasol/saas/client/openapi/models/download_file.py b/exasol/saas/client/openapi/models/download_file.py index 2b3fab7..0e03073 100644 --- a/exasol/saas/client/openapi/models/download_file.py +++ b/exasol/saas/client/openapi/models/download_file.py @@ -20,27 +20,25 @@ @_attrs_define class DownloadFile: - """ - Attributes: - url (str): - """ + """ + Attributes: + url (str): + """ url: str - def to_dict(self) -> dict[str, Any]: url = self.url - field_dict: dict[str, Any] = {} - field_dict.update({ - "url": url, - }) + field_dict.update( + { + "url": url, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -51,4 +49,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return download_file - diff --git a/exasol/saas/client/openapi/models/exasol_database.py b/exasol/saas/client/openapi/models/exasol_database.py index 0268758..1000d99 100644 --- a/exasol/saas/client/openapi/models/exasol_database.py +++ b/exasol/saas/client/openapi/models/exasol_database.py @@ -21,12 +21,11 @@ ) if TYPE_CHECKING: - from ..models.exasol_database_clusters import ExasolDatabaseClusters - from ..models.exasol_database_integrations_item import ExasolDatabaseIntegrationsItem - from ..models.exasol_database_settings import ExasolDatabaseSettings - - - + from ..models.exasol_database_clusters import ExasolDatabaseClusters + from ..models.exasol_database_integrations_item import ( + ExasolDatabaseIntegrationsItem, + ) + from ..models.exasol_database_settings import ExasolDatabaseSettings T = TypeVar("T", bound="ExasolDatabase") @@ -34,43 +33,43 @@ @_attrs_define class ExasolDatabase: - """ - Attributes: - status (Status): - id (str): - name (str): - clusters (ExasolDatabaseClusters): - provider (str): - region (str): - created_at (datetime.datetime): - created_by (str): - settings (ExasolDatabaseSettings): - integrations (Union[Unset, list['ExasolDatabaseIntegrationsItem']]): - deleted_by (Union[Unset, str]): - deleted_at (Union[Unset, datetime.datetime]): - """ + """ + Attributes: + status (Status): + id (str): + name (str): + clusters (ExasolDatabaseClusters): + provider (str): + region (str): + created_at (datetime.datetime): + created_by (str): + settings (ExasolDatabaseSettings): + integrations (Union[Unset, list['ExasolDatabaseIntegrationsItem']]): + deleted_by (Union[Unset, str]): + deleted_at (Union[Unset, datetime.datetime]): + """ status: Status id: str name: str - clusters: 'ExasolDatabaseClusters' + clusters: "ExasolDatabaseClusters" provider: str region: str created_at: datetime.datetime created_by: str - settings: 'ExasolDatabaseSettings' - integrations: Union[Unset, list['ExasolDatabaseIntegrationsItem']] = UNSET + settings: "ExasolDatabaseSettings" + integrations: Union[Unset, list["ExasolDatabaseIntegrationsItem"]] = UNSET deleted_by: Union[Unset, str] = UNSET deleted_at: Union[Unset, datetime.datetime] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> dict[str, Any]: from ..models.exasol_database_clusters import ExasolDatabaseClusters from ..models.exasol_database_integrations_item import ( ExasolDatabaseIntegrationsItem, ) from ..models.exasol_database_settings import ExasolDatabaseSettings + status = self.status.value id = self.id @@ -96,28 +95,27 @@ def to_dict(self) -> dict[str, Any]: integrations_item = integrations_item_data.to_dict() integrations.append(integrations_item) - - deleted_by = self.deleted_by deleted_at: Union[Unset, str] = UNSET if not isinstance(self.deleted_at, Unset): deleted_at = self.deleted_at.isoformat() - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({ - "status": status, - "id": id, - "name": name, - "clusters": clusters, - "provider": provider, - "region": region, - "createdAt": created_at, - "createdBy": created_by, - "settings": settings, - }) + field_dict.update( + { + "status": status, + "id": id, + "name": name, + "clusters": clusters, + "provider": provider, + "region": region, + "createdAt": created_at, + "createdBy": created_by, + "settings": settings, + } + ) if integrations is not UNSET: field_dict["integrations"] = integrations if deleted_by is not UNSET: @@ -127,8 +125,6 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.exasol_database_clusters import ExasolDatabaseClusters @@ -136,59 +132,44 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ExasolDatabaseIntegrationsItem, ) from ..models.exasol_database_settings import ExasolDatabaseSettings + d = src_dict.copy() status = Status(d.pop("status")) - - - id = d.pop("id") name = d.pop("name") clusters = ExasolDatabaseClusters.from_dict(d.pop("clusters")) - - - provider = d.pop("provider") region = d.pop("region") created_at = isoparse(d.pop("createdAt")) - - - created_by = d.pop("createdBy") settings = ExasolDatabaseSettings.from_dict(d.pop("settings")) - - - integrations = [] _integrations = d.pop("integrations", UNSET) - for integrations_item_data in (_integrations or []): - integrations_item = ExasolDatabaseIntegrationsItem.from_dict(integrations_item_data) - - + for integrations_item_data in _integrations or []: + integrations_item = ExasolDatabaseIntegrationsItem.from_dict( + integrations_item_data + ) integrations.append(integrations_item) - deleted_by = d.pop("deletedBy", UNSET) _deleted_at = d.pop("deletedAt", UNSET) deleted_at: Union[Unset, datetime.datetime] - if isinstance(_deleted_at, Unset): + if isinstance(_deleted_at, Unset): deleted_at = UNSET else: deleted_at = isoparse(_deleted_at) - - - exasol_database = cls( status=status, id=id, @@ -204,7 +185,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: deleted_at=deleted_at, ) - exasol_database.additional_properties = d return exasol_database diff --git a/exasol/saas/client/openapi/models/exasol_database_clusters.py b/exasol/saas/client/openapi/models/exasol_database_clusters.py index e9dd529..6283ab8 100644 --- a/exasol/saas/client/openapi/models/exasol_database_clusters.py +++ b/exasol/saas/client/openapi/models/exasol_database_clusters.py @@ -20,32 +20,30 @@ @_attrs_define class ExasolDatabaseClusters: - """ - Attributes: - total (int): - running (int): - """ + """ + Attributes: + total (int): + running (int): + """ total: int running: int - def to_dict(self) -> dict[str, Any]: total = self.total running = self.running - field_dict: dict[str, Any] = {} - field_dict.update({ - "total": total, - "running": running, - }) + field_dict.update( + { + "total": total, + "running": running, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return exasol_database_clusters - diff --git a/exasol/saas/client/openapi/models/exasol_database_integrations_item.py b/exasol/saas/client/openapi/models/exasol_database_integrations_item.py index 66d2e83..25eab98 100644 --- a/exasol/saas/client/openapi/models/exasol_database_integrations_item.py +++ b/exasol/saas/client/openapi/models/exasol_database_integrations_item.py @@ -21,19 +21,18 @@ @_attrs_define class ExasolDatabaseIntegrationsItem: - """ - Attributes: - id (str): - name (str): - url (Union[Unset, str]): - """ + """ + Attributes: + id (str): + name (str): + url (Union[Unset, str]): + """ id: str name: str url: Union[Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> dict[str, Any]: id = self.id @@ -41,20 +40,19 @@ def to_dict(self) -> dict[str, Any]: url = self.url - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({ - "id": id, - "name": name, - }) + field_dict.update( + { + "id": id, + "name": name, + } + ) if url is not UNSET: field_dict["url"] = url return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -70,7 +68,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: url=url, ) - exasol_database_integrations_item.additional_properties = d return exasol_database_integrations_item diff --git a/exasol/saas/client/openapi/models/exasol_database_settings.py b/exasol/saas/client/openapi/models/exasol_database_settings.py index 547b195..0e85ee4 100644 --- a/exasol/saas/client/openapi/models/exasol_database_settings.py +++ b/exasol/saas/client/openapi/models/exasol_database_settings.py @@ -20,15 +20,15 @@ @_attrs_define class ExasolDatabaseSettings: - """ - Attributes: - offload_enabled (bool): - auto_updates_enabled (bool): - auto_updates_hard_disabled (bool): - num_nodes (int): - stream_type (str): - stream_description (str): - """ + """ + Attributes: + offload_enabled (bool): + auto_updates_enabled (bool): + auto_updates_hard_disabled (bool): + num_nodes (int): + stream_type (str): + stream_description (str): + """ offload_enabled: bool auto_updates_enabled: bool @@ -37,7 +37,6 @@ class ExasolDatabaseSettings: stream_type: str stream_description: str - def to_dict(self) -> dict[str, Any]: offload_enabled = self.offload_enabled @@ -51,21 +50,20 @@ def to_dict(self) -> dict[str, Any]: stream_description = self.stream_description - field_dict: dict[str, Any] = {} - field_dict.update({ - "offloadEnabled": offload_enabled, - "autoUpdatesEnabled": auto_updates_enabled, - "autoUpdatesHardDisabled": auto_updates_hard_disabled, - "numNodes": num_nodes, - "streamType": stream_type, - "streamDescription": stream_description, - }) + field_dict.update( + { + "offloadEnabled": offload_enabled, + "autoUpdatesEnabled": auto_updates_enabled, + "autoUpdatesHardDisabled": auto_updates_hard_disabled, + "numNodes": num_nodes, + "streamType": stream_type, + "streamDescription": stream_description, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -91,4 +89,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return exasol_database_settings - diff --git a/exasol/saas/client/openapi/models/extension.py b/exasol/saas/client/openapi/models/extension.py index 3839f5c..7224bc3 100644 --- a/exasol/saas/client/openapi/models/extension.py +++ b/exasol/saas/client/openapi/models/extension.py @@ -17,10 +17,7 @@ ) if TYPE_CHECKING: - from ..models.extension_version import ExtensionVersion - - - + from ..models.extension_version import ExtensionVersion T = TypeVar("T", bound="Extension") @@ -28,24 +25,24 @@ @_attrs_define class Extension: - """ - Attributes: - id (str): - name (str): - description (str): - category_id (str): - installable_versions (list['ExtensionVersion']): - """ + """ + Attributes: + id (str): + name (str): + description (str): + category_id (str): + installable_versions (list['ExtensionVersion']): + """ id: str name: str description: str category_id: str - installable_versions: list['ExtensionVersion'] - + installable_versions: list["ExtensionVersion"] def to_dict(self) -> dict[str, Any]: from ..models.extension_version import ExtensionVersion + id = self.id name = self.name @@ -59,25 +56,23 @@ def to_dict(self) -> dict[str, Any]: installable_versions_item = installable_versions_item_data.to_dict() installable_versions.append(installable_versions_item) - - - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - "description": description, - "categoryId": category_id, - "installableVersions": installable_versions, - }) + field_dict.update( + { + "id": id, + "name": name, + "description": description, + "categoryId": category_id, + "installableVersions": installable_versions, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.extension_version import ExtensionVersion + d = src_dict.copy() id = d.pop("id") @@ -89,14 +84,13 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: installable_versions = [] _installable_versions = d.pop("installableVersions") - for installable_versions_item_data in (_installable_versions): - installable_versions_item = ExtensionVersion.from_dict(installable_versions_item_data) - - + for installable_versions_item_data in _installable_versions: + installable_versions_item = ExtensionVersion.from_dict( + installable_versions_item_data + ) installable_versions.append(installable_versions_item) - extension = cls( id=id, name=name, @@ -106,4 +100,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return extension - diff --git a/exasol/saas/client/openapi/models/extension_detail.py b/exasol/saas/client/openapi/models/extension_detail.py index 384d5f9..efd6d65 100644 --- a/exasol/saas/client/openapi/models/extension_detail.py +++ b/exasol/saas/client/openapi/models/extension_detail.py @@ -17,10 +17,7 @@ ) if TYPE_CHECKING: - from ..models.extension_parameter_definitions import ExtensionParameterDefinitions - - - + from ..models.extension_parameter_definitions import ExtensionParameterDefinitions T = TypeVar("T", bound="ExtensionDetail") @@ -28,22 +25,22 @@ @_attrs_define class ExtensionDetail: - """ - Attributes: - id (str): - version (str): - parameter_definitions (list['ExtensionParameterDefinitions']): - """ + """ + Attributes: + id (str): + version (str): + parameter_definitions (list['ExtensionParameterDefinitions']): + """ id: str version: str - parameter_definitions: list['ExtensionParameterDefinitions'] - + parameter_definitions: list["ExtensionParameterDefinitions"] def to_dict(self) -> dict[str, Any]: from ..models.extension_parameter_definitions import ( ExtensionParameterDefinitions, ) + id = self.id version = self.version @@ -53,25 +50,23 @@ def to_dict(self) -> dict[str, Any]: parameter_definitions_item = parameter_definitions_item_data.to_dict() parameter_definitions.append(parameter_definitions_item) - - - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "version": version, - "parameterDefinitions": parameter_definitions, - }) + field_dict.update( + { + "id": id, + "version": version, + "parameterDefinitions": parameter_definitions, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.extension_parameter_definitions import ( ExtensionParameterDefinitions, ) + d = src_dict.copy() id = d.pop("id") @@ -79,14 +74,13 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: parameter_definitions = [] _parameter_definitions = d.pop("parameterDefinitions") - for parameter_definitions_item_data in (_parameter_definitions): - parameter_definitions_item = ExtensionParameterDefinitions.from_dict(parameter_definitions_item_data) - - + for parameter_definitions_item_data in _parameter_definitions: + parameter_definitions_item = ExtensionParameterDefinitions.from_dict( + parameter_definitions_item_data + ) parameter_definitions.append(parameter_definitions_item) - extension_detail = cls( id=id, version=version, @@ -94,4 +88,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return extension_detail - diff --git a/exasol/saas/client/openapi/models/extension_instance.py b/exasol/saas/client/openapi/models/extension_instance.py index 4d6bb39..c04f20e 100644 --- a/exasol/saas/client/openapi/models/extension_instance.py +++ b/exasol/saas/client/openapi/models/extension_instance.py @@ -20,32 +20,30 @@ @_attrs_define class ExtensionInstance: - """ - Attributes: - id (str): - name (str): - """ + """ + Attributes: + id (str): + name (str): + """ id: str name: str - def to_dict(self) -> dict[str, Any]: id = self.id name = self.name - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - }) + field_dict.update( + { + "id": id, + "name": name, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return extension_instance - diff --git a/exasol/saas/client/openapi/models/extension_parameter_definitions.py b/exasol/saas/client/openapi/models/extension_parameter_definitions.py index 6cdf66c..1e0ffde 100644 --- a/exasol/saas/client/openapi/models/extension_parameter_definitions.py +++ b/exasol/saas/client/openapi/models/extension_parameter_definitions.py @@ -21,18 +21,17 @@ @_attrs_define class ExtensionParameterDefinitions: - """ - Attributes: - id (str): - name (str): - raw_definition (Union[Unset, Any]): - """ + """ + Attributes: + id (str): + name (str): + raw_definition (Union[Unset, Any]): + """ id: str name: str raw_definition: Union[Unset, Any] = UNSET - def to_dict(self) -> dict[str, Any]: id = self.id @@ -40,19 +39,18 @@ def to_dict(self) -> dict[str, Any]: raw_definition = self.raw_definition - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - }) + field_dict.update( + { + "id": id, + "name": name, + } + ) if raw_definition is not UNSET: field_dict["rawDefinition"] = raw_definition return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -69,4 +67,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return extension_parameter_definitions - diff --git a/exasol/saas/client/openapi/models/extension_parameter_value.py b/exasol/saas/client/openapi/models/extension_parameter_value.py index b889000..a37f0fd 100644 --- a/exasol/saas/client/openapi/models/extension_parameter_value.py +++ b/exasol/saas/client/openapi/models/extension_parameter_value.py @@ -20,32 +20,30 @@ @_attrs_define class ExtensionParameterValue: - """ - Attributes: - id (str): - value (str): - """ + """ + Attributes: + id (str): + value (str): + """ id: str value: str - def to_dict(self) -> dict[str, Any]: id = self.id value = self.value - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "value": value, - }) + field_dict.update( + { + "id": id, + "value": value, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return extension_parameter_value - diff --git a/exasol/saas/client/openapi/models/extension_version.py b/exasol/saas/client/openapi/models/extension_version.py index 66686b1..c0f4103 100644 --- a/exasol/saas/client/openapi/models/extension_version.py +++ b/exasol/saas/client/openapi/models/extension_version.py @@ -20,20 +20,19 @@ @_attrs_define class ExtensionVersion: - """ - Attributes: - version (str): - latest (bool): - deprecated (bool): - installed (bool): - """ + """ + Attributes: + version (str): + latest (bool): + deprecated (bool): + installed (bool): + """ version: str latest: bool deprecated: bool installed: bool - def to_dict(self) -> dict[str, Any]: version = self.version @@ -43,19 +42,18 @@ def to_dict(self) -> dict[str, Any]: installed = self.installed - field_dict: dict[str, Any] = {} - field_dict.update({ - "version": version, - "latest": latest, - "deprecated": deprecated, - "installed": installed, - }) + field_dict.update( + { + "version": version, + "latest": latest, + "deprecated": deprecated, + "installed": installed, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -75,4 +73,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return extension_version - diff --git a/exasol/saas/client/openapi/models/file.py b/exasol/saas/client/openapi/models/file.py index 91a88d9..105f78d 100644 --- a/exasol/saas/client/openapi/models/file.py +++ b/exasol/saas/client/openapi/models/file.py @@ -24,23 +24,22 @@ @_attrs_define class File: - """ - Attributes: - name (str): - type_ (str): - path (str): - last_modified (datetime.datetime): - size (Union[Unset, int]): - children (Union[Unset, list['File']]): - """ + """ + Attributes: + name (str): + type_ (str): + path (str): + last_modified (datetime.datetime): + size (Union[Unset, int]): + children (Union[Unset, list['File']]): + """ name: str type_: str path: str last_modified: datetime.datetime size: Union[Unset, int] = UNSET - children: Union[Unset, list['File']] = UNSET - + children: Union[Unset, list["File"]] = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -60,16 +59,15 @@ def to_dict(self) -> dict[str, Any]: children_item = children_item_data.to_dict() children.append(children_item) - - - field_dict: dict[str, Any] = {} - field_dict.update({ - "name": name, - "type": type_, - "path": path, - "lastModified": last_modified, - }) + field_dict.update( + { + "name": name, + "type": type_, + "path": path, + "lastModified": last_modified, + } + ) if size is not UNSET: field_dict["size"] = size if children is not UNSET: @@ -77,8 +75,6 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -90,21 +86,15 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: last_modified = isoparse(d.pop("lastModified")) - - - size = d.pop("size", UNSET) children = [] _children = d.pop("children", UNSET) - for children_item_data in (_children or []): + for children_item_data in _children or []: children_item = File.from_dict(children_item_data) - - children.append(children_item) - file = cls( name=name, type_=type_, @@ -115,4 +105,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return file - diff --git a/exasol/saas/client/openapi/models/patch_user.py b/exasol/saas/client/openapi/models/patch_user.py index d698792..c441e72 100644 --- a/exasol/saas/client/openapi/models/patch_user.py +++ b/exasol/saas/client/openapi/models/patch_user.py @@ -18,10 +18,7 @@ ) if TYPE_CHECKING: - from ..models.patch_user_databases import PatchUserDatabases - - - + from ..models.patch_user_databases import PatchUserDatabases T = TypeVar("T", bound="PatchUser") @@ -29,20 +26,20 @@ @_attrs_define class PatchUser: - """ - Attributes: - role_id (Union[Unset, str]): - databases (Union[Unset, PatchUserDatabases]): - db_username (Union[Unset, str]): - """ + """ + Attributes: + role_id (Union[Unset, str]): + databases (Union[Unset, PatchUserDatabases]): + db_username (Union[Unset, str]): + """ role_id: Union[Unset, str] = UNSET - databases: Union[Unset, 'PatchUserDatabases'] = UNSET + databases: Union[Unset, "PatchUserDatabases"] = UNSET db_username: Union[Unset, str] = UNSET - def to_dict(self) -> dict[str, Any]: from ..models.patch_user_databases import PatchUserDatabases + role_id = self.role_id databases: Union[Unset, dict[str, Any]] = UNSET @@ -51,10 +48,8 @@ def to_dict(self) -> dict[str, Any]: db_username = self.db_username - field_dict: dict[str, Any] = {} - field_dict.update({ - }) + field_dict.update({}) if role_id is not UNSET: field_dict["roleID"] = role_id if databases is not UNSET: @@ -64,24 +59,20 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.patch_user_databases import PatchUserDatabases + d = src_dict.copy() role_id = d.pop("roleID", UNSET) _databases = d.pop("databases", UNSET) databases: Union[Unset, PatchUserDatabases] - if isinstance(_databases, Unset): + if isinstance(_databases, Unset): databases = UNSET else: databases = PatchUserDatabases.from_dict(_databases) - - - db_username = d.pop("dbUsername", UNSET) patch_user = cls( @@ -91,4 +82,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return patch_user - diff --git a/exasol/saas/client/openapi/models/patch_user_databases.py b/exasol/saas/client/openapi/models/patch_user_databases.py index f7cac10..c281ebc 100644 --- a/exasol/saas/client/openapi/models/patch_user_databases.py +++ b/exasol/saas/client/openapi/models/patch_user_databases.py @@ -21,49 +21,40 @@ @_attrs_define class PatchUserDatabases: - """ - Attributes: - delete (list[str]): - add (list[str]): - """ + """ + Attributes: + delete (list[str]): + add (list[str]): + """ delete: list[str] add: list[str] - def to_dict(self) -> dict[str, Any]: delete = self.delete - - add = self.add - - - field_dict: dict[str, Any] = {} - field_dict.update({ - "delete": delete, - "add": add, - }) + field_dict.update( + { + "delete": delete, + "add": add, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() delete = cast(list[str], d.pop("delete")) - add = cast(list[str], d.pop("add")) - patch_user_databases = cls( delete=delete, add=add, ) return patch_user_databases - diff --git a/exasol/saas/client/openapi/models/platform.py b/exasol/saas/client/openapi/models/platform.py index 388ed34..7fc6030 100644 --- a/exasol/saas/client/openapi/models/platform.py +++ b/exasol/saas/client/openapi/models/platform.py @@ -20,32 +20,30 @@ @_attrs_define class Platform: - """ - Attributes: - id (str): - name (str): - """ + """ + Attributes: + id (str): + name (str): + """ id: str name: str - def to_dict(self) -> dict[str, Any]: id = self.id name = self.name - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - }) + field_dict.update( + { + "id": id, + "name": name, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return platform - diff --git a/exasol/saas/client/openapi/models/region.py b/exasol/saas/client/openapi/models/region.py index 4b8c7f5..d8d7884 100644 --- a/exasol/saas/client/openapi/models/region.py +++ b/exasol/saas/client/openapi/models/region.py @@ -20,20 +20,19 @@ @_attrs_define class Region: - """ - Attributes: - id (str): - name (str): - price_multiplier (float): - storage_price (float): - """ + """ + Attributes: + id (str): + name (str): + price_multiplier (float): + storage_price (float): + """ id: str name: str price_multiplier: float storage_price: float - def to_dict(self) -> dict[str, Any]: id = self.id @@ -43,19 +42,18 @@ def to_dict(self) -> dict[str, Any]: storage_price = self.storage_price - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - "priceMultiplier": price_multiplier, - "storagePrice": storage_price, - }) + field_dict.update( + { + "id": id, + "name": name, + "priceMultiplier": price_multiplier, + "storagePrice": storage_price, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -75,4 +73,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return region - diff --git a/exasol/saas/client/openapi/models/scale_cluster.py b/exasol/saas/client/openapi/models/scale_cluster.py index d3623d6..49a7252 100644 --- a/exasol/saas/client/openapi/models/scale_cluster.py +++ b/exasol/saas/client/openapi/models/scale_cluster.py @@ -20,27 +20,25 @@ @_attrs_define class ScaleCluster: - """ - Attributes: - size (str): - """ + """ + Attributes: + size (str): + """ size: str - def to_dict(self) -> dict[str, Any]: size = self.size - field_dict: dict[str, Any] = {} - field_dict.update({ - "size": size, - }) + field_dict.update( + { + "size": size, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -51,4 +49,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return scale_cluster - diff --git a/exasol/saas/client/openapi/models/schedule.py b/exasol/saas/client/openapi/models/schedule.py index 31e3a51..732daa7 100644 --- a/exasol/saas/client/openapi/models/schedule.py +++ b/exasol/saas/client/openapi/models/schedule.py @@ -19,11 +19,8 @@ ) if TYPE_CHECKING: - from ..models.cluster_action_scale import ClusterActionScale - from ..models.cluster_action_start_stop import ClusterActionStartStop - - - + from ..models.cluster_action_scale import ClusterActionScale + from ..models.cluster_action_start_stop import ClusterActionStartStop T = TypeVar("T", bound="Schedule") @@ -31,17 +28,17 @@ @_attrs_define class Schedule: - """ - Attributes: - action (ScheduleActionType0): - cron_rule (str): cron rule in format: - id (Union[Unset, str]): - createdby_id (Union[Unset, str]): - createdby_first_name (Union[Unset, str]): - createdby_last_name (Union[Unset, str]): - cluster_name (Union[Unset, str]): - payload (Union['ClusterActionScale', 'ClusterActionStartStop', Unset]): - """ + """ + Attributes: + action (ScheduleActionType0): + cron_rule (str): cron rule in format: + id (Union[Unset, str]): + createdby_id (Union[Unset, str]): + createdby_first_name (Union[Unset, str]): + createdby_last_name (Union[Unset, str]): + cluster_name (Union[Unset, str]): + payload (Union['ClusterActionScale', 'ClusterActionStartStop', Unset]): + """ action: ScheduleActionType0 cron_rule: str @@ -50,17 +47,16 @@ class Schedule: createdby_first_name: Union[Unset, str] = UNSET createdby_last_name: Union[Unset, str] = UNSET cluster_name: Union[Unset, str] = UNSET - payload: Union['ClusterActionScale', 'ClusterActionStartStop', Unset] = UNSET - + payload: Union["ClusterActionScale", "ClusterActionStartStop", Unset] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.cluster_action_scale import ClusterActionScale from ..models.cluster_action_start_stop import ClusterActionStartStop + action: str if isinstance(self.action, ScheduleActionType0): action = self.action.value - cron_rule = self.cron_rule id = self.id @@ -81,13 +77,13 @@ def to_dict(self) -> dict[str, Any]: else: payload = self.payload.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update({ - "action": action, - "cronRule": cron_rule, - }) + field_dict.update( + { + "action": action, + "cronRule": cron_rule, + } + ) if id is not UNSET: field_dict["id"] = id if createdby_id is not UNSET: @@ -103,25 +99,22 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.cluster_action_scale import ClusterActionScale from ..models.cluster_action_start_stop import ClusterActionStartStop + d = src_dict.copy() + def _parse_action(data: object) -> ScheduleActionType0: if not isinstance(data, str): raise TypeError() action_type_0 = ScheduleActionType0(data) - - return action_type_0 action = _parse_action(d.pop("action")) - cron_rule = d.pop("cronRule") id = d.pop("id", UNSET) @@ -134,7 +127,9 @@ def _parse_action(data: object) -> ScheduleActionType0: cluster_name = d.pop("clusterName", UNSET) - def _parse_payload(data: object) -> Union['ClusterActionScale', 'ClusterActionStartStop', Unset]: + def _parse_payload( + data: object, + ) -> Union["ClusterActionScale", "ClusterActionStartStop", Unset]: if isinstance(data, Unset): return data try: @@ -142,22 +137,17 @@ def _parse_payload(data: object) -> Union['ClusterActionScale', 'ClusterActionSt raise TypeError() payload_type_0 = ClusterActionScale.from_dict(data) - - return payload_type_0 - except: # noqa: E722 + except: # noqa: E722 pass if not isinstance(data, dict): raise TypeError() payload_type_1 = ClusterActionStartStop.from_dict(data) - - return payload_type_1 payload = _parse_payload(d.pop("payload", UNSET)) - schedule = cls( action=action, cron_rule=cron_rule, @@ -170,4 +160,3 @@ def _parse_payload(data: object) -> Union['ClusterActionScale', 'ClusterActionSt ) return schedule - diff --git a/exasol/saas/client/openapi/models/set_auto_updates_database.py b/exasol/saas/client/openapi/models/set_auto_updates_database.py index cbea19a..a1ba7d8 100644 --- a/exasol/saas/client/openapi/models/set_auto_updates_database.py +++ b/exasol/saas/client/openapi/models/set_auto_updates_database.py @@ -20,27 +20,25 @@ @_attrs_define class SetAutoUpdatesDatabase: - """ - Attributes: - auto_updates_enabled (bool): - """ + """ + Attributes: + auto_updates_enabled (bool): + """ auto_updates_enabled: bool - def to_dict(self) -> dict[str, Any]: auto_updates_enabled = self.auto_updates_enabled - field_dict: dict[str, Any] = {} - field_dict.update({ - "autoUpdatesEnabled": auto_updates_enabled, - }) + field_dict.update( + { + "autoUpdatesEnabled": auto_updates_enabled, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -51,4 +49,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return set_auto_updates_database - diff --git a/exasol/saas/client/openapi/models/update_allowed_ip.py b/exasol/saas/client/openapi/models/update_allowed_ip.py index 045eec3..166bfec 100644 --- a/exasol/saas/client/openapi/models/update_allowed_ip.py +++ b/exasol/saas/client/openapi/models/update_allowed_ip.py @@ -20,32 +20,30 @@ @_attrs_define class UpdateAllowedIP: - """ - Attributes: - name (str): - cidr_ip (str): - """ + """ + Attributes: + name (str): + cidr_ip (str): + """ name: str cidr_ip: str - def to_dict(self) -> dict[str, Any]: name = self.name cidr_ip = self.cidr_ip - field_dict: dict[str, Any] = {} - field_dict.update({ - "name": name, - "cidrIp": cidr_ip, - }) + field_dict.update( + { + "name": name, + "cidrIp": cidr_ip, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return update_allowed_ip - diff --git a/exasol/saas/client/openapi/models/update_cluster.py b/exasol/saas/client/openapi/models/update_cluster.py index 0a06fbc..fee8ef0 100644 --- a/exasol/saas/client/openapi/models/update_cluster.py +++ b/exasol/saas/client/openapi/models/update_cluster.py @@ -18,11 +18,8 @@ ) if TYPE_CHECKING: - from ..models.auto_stop import AutoStop - from ..models.cluster_settings_update import ClusterSettingsUpdate - - - + from ..models.auto_stop import AutoStop + from ..models.cluster_settings_update import ClusterSettingsUpdate T = TypeVar("T", bound="UpdateCluster") @@ -30,21 +27,21 @@ @_attrs_define class UpdateCluster: - """ - Attributes: - name (Union[Unset, str]): - auto_stop (Union[Unset, AutoStop]): - settings (Union[Unset, ClusterSettingsUpdate]): - """ + """ + Attributes: + name (Union[Unset, str]): + auto_stop (Union[Unset, AutoStop]): + settings (Union[Unset, ClusterSettingsUpdate]): + """ name: Union[Unset, str] = UNSET - auto_stop: Union[Unset, 'AutoStop'] = UNSET - settings: Union[Unset, 'ClusterSettingsUpdate'] = UNSET - + auto_stop: Union[Unset, "AutoStop"] = UNSET + settings: Union[Unset, "ClusterSettingsUpdate"] = UNSET def to_dict(self) -> dict[str, Any]: from ..models.auto_stop import AutoStop from ..models.cluster_settings_update import ClusterSettingsUpdate + name = self.name auto_stop: Union[Unset, dict[str, Any]] = UNSET @@ -55,10 +52,8 @@ def to_dict(self) -> dict[str, Any]: if not isinstance(self.settings, Unset): settings = self.settings.to_dict() - field_dict: dict[str, Any] = {} - field_dict.update({ - }) + field_dict.update({}) if name is not UNSET: field_dict["name"] = name if auto_stop is not UNSET: @@ -68,35 +63,28 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.auto_stop import AutoStop from ..models.cluster_settings_update import ClusterSettingsUpdate + d = src_dict.copy() name = d.pop("name", UNSET) _auto_stop = d.pop("autoStop", UNSET) auto_stop: Union[Unset, AutoStop] - if isinstance(_auto_stop, Unset): + if isinstance(_auto_stop, Unset): auto_stop = UNSET else: auto_stop = AutoStop.from_dict(_auto_stop) - - - _settings = d.pop("settings", UNSET) settings: Union[Unset, ClusterSettingsUpdate] - if isinstance(_settings, Unset): + if isinstance(_settings, Unset): settings = UNSET else: settings = ClusterSettingsUpdate.from_dict(_settings) - - - update_cluster = cls( name=name, auto_stop=auto_stop, @@ -104,4 +92,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return update_cluster - diff --git a/exasol/saas/client/openapi/models/update_database.py b/exasol/saas/client/openapi/models/update_database.py index 7b4c5af..eae6aeb 100644 --- a/exasol/saas/client/openapi/models/update_database.py +++ b/exasol/saas/client/openapi/models/update_database.py @@ -20,29 +20,27 @@ @_attrs_define class UpdateDatabase: - """ - Attributes: - name (str): - """ + """ + Attributes: + name (str): + """ name: str additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - def to_dict(self) -> dict[str, Any]: name = self.name - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) - field_dict.update({ - "name": name, - }) + field_dict.update( + { + "name": name, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -52,7 +50,6 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: name=name, ) - update_database.additional_properties = d return update_database diff --git a/exasol/saas/client/openapi/models/update_profile.py b/exasol/saas/client/openapi/models/update_profile.py index c415078..c511e7b 100644 --- a/exasol/saas/client/openapi/models/update_profile.py +++ b/exasol/saas/client/openapi/models/update_profile.py @@ -20,32 +20,30 @@ @_attrs_define class UpdateProfile: - """ - Attributes: - first_name (str): - last_name (str): - """ + """ + Attributes: + first_name (str): + last_name (str): + """ first_name: str last_name: str - def to_dict(self) -> dict[str, Any]: first_name = self.first_name last_name = self.last_name - field_dict: dict[str, Any] = {} - field_dict.update({ - "firstName": first_name, - "lastName": last_name, - }) + field_dict.update( + { + "firstName": first_name, + "lastName": last_name, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return update_profile - diff --git a/exasol/saas/client/openapi/models/upload_file.py b/exasol/saas/client/openapi/models/upload_file.py index d599fb6..0f87005 100644 --- a/exasol/saas/client/openapi/models/upload_file.py +++ b/exasol/saas/client/openapi/models/upload_file.py @@ -20,27 +20,25 @@ @_attrs_define class UploadFile: - """ - Attributes: - url (str): - """ + """ + Attributes: + url (str): + """ url: str - def to_dict(self) -> dict[str, Any]: url = self.url - field_dict: dict[str, Any] = {} - field_dict.update({ - "url": url, - }) + field_dict.update( + { + "url": url, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -51,4 +49,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return upload_file - diff --git a/exasol/saas/client/openapi/models/usage.py b/exasol/saas/client/openapi/models/usage.py index cde177f..e18657b 100644 --- a/exasol/saas/client/openapi/models/usage.py +++ b/exasol/saas/client/openapi/models/usage.py @@ -17,10 +17,7 @@ ) if TYPE_CHECKING: - from ..models.usage_additional_property_item import UsageAdditionalPropertyItem - - - + from ..models.usage_additional_property_item import UsageAdditionalPropertyItem T = TypeVar("T", bound="Usage") @@ -28,15 +25,15 @@ @_attrs_define class Usage: - """ - """ - - additional_properties: dict[str, list['UsageAdditionalPropertyItem']] = _attrs_field(init=False, factory=dict) + """ """ + additional_properties: dict[str, list["UsageAdditionalPropertyItem"]] = ( + _attrs_field(init=False, factory=dict) + ) def to_dict(self) -> dict[str, Any]: from ..models.usage_additional_property_item import UsageAdditionalPropertyItem - + field_dict: dict[str, Any] = {} for prop_name, prop in self.additional_properties.items(): field_dict[prop_name] = [] @@ -44,28 +41,23 @@ def to_dict(self) -> dict[str, Any]: additional_property_item = additional_property_item_data.to_dict() field_dict[prop_name].append(additional_property_item) - - return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.usage_additional_property_item import UsageAdditionalPropertyItem - d = src_dict.copy() - usage = cls( - ) + d = src_dict.copy() + usage = cls() additional_properties = {} for prop_name, prop_dict in d.items(): additional_property = [] _additional_property = prop_dict - for additional_property_item_data in (_additional_property): - additional_property_item = UsageAdditionalPropertyItem.from_dict(additional_property_item_data) - - + for additional_property_item_data in _additional_property: + additional_property_item = UsageAdditionalPropertyItem.from_dict( + additional_property_item_data + ) additional_property.append(additional_property_item) @@ -78,10 +70,10 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: def additional_keys(self) -> list[str]: return list(self.additional_properties.keys()) - def __getitem__(self, key: str) -> list['UsageAdditionalPropertyItem']: + def __getitem__(self, key: str) -> list["UsageAdditionalPropertyItem"]: return self.additional_properties[key] - def __setitem__(self, key: str, value: list['UsageAdditionalPropertyItem']) -> None: + def __setitem__(self, key: str, value: list["UsageAdditionalPropertyItem"]) -> None: self.additional_properties[key] = value def __delitem__(self, key: str) -> None: diff --git a/exasol/saas/client/openapi/models/usage_additional_property_item.py b/exasol/saas/client/openapi/models/usage_additional_property_item.py index a5d5c15..8423a92 100644 --- a/exasol/saas/client/openapi/models/usage_additional_property_item.py +++ b/exasol/saas/client/openapi/models/usage_additional_property_item.py @@ -18,10 +18,7 @@ ) if TYPE_CHECKING: - from ..models.usage_cluster import UsageCluster - - - + from ..models.usage_cluster import UsageCluster T = TypeVar("T", bound="UsageAdditionalPropertyItem") @@ -29,22 +26,22 @@ @_attrs_define class UsageAdditionalPropertyItem: - """ - Attributes: - id (str): - name (str): - clusters (list['UsageCluster']): - used_storage (Union[Unset, float]): - """ + """ + Attributes: + id (str): + name (str): + clusters (list['UsageCluster']): + used_storage (Union[Unset, float]): + """ id: str name: str - clusters: list['UsageCluster'] + clusters: list["UsageCluster"] used_storage: Union[Unset, float] = UNSET - def to_dict(self) -> dict[str, Any]: from ..models.usage_cluster import UsageCluster + id = self.id name = self.name @@ -54,27 +51,25 @@ def to_dict(self) -> dict[str, Any]: clusters_item = clusters_item_data.to_dict() clusters.append(clusters_item) - - used_storage = self.used_storage - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - "clusters": clusters, - }) + field_dict.update( + { + "id": id, + "name": name, + "clusters": clusters, + } + ) if used_storage is not UNSET: field_dict["usedStorage"] = used_storage return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.usage_cluster import UsageCluster + d = src_dict.copy() id = d.pop("id") @@ -82,14 +77,11 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: clusters = [] _clusters = d.pop("clusters") - for clusters_item_data in (_clusters): + for clusters_item_data in _clusters: clusters_item = UsageCluster.from_dict(clusters_item_data) - - clusters.append(clusters_item) - used_storage = d.pop("usedStorage", UNSET) usage_additional_property_item = cls( @@ -100,4 +92,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return usage_additional_property_item - diff --git a/exasol/saas/client/openapi/models/usage_cluster.py b/exasol/saas/client/openapi/models/usage_cluster.py index 5fdb69f..35384ce 100644 --- a/exasol/saas/client/openapi/models/usage_cluster.py +++ b/exasol/saas/client/openapi/models/usage_cluster.py @@ -21,16 +21,16 @@ @_attrs_define class UsageCluster: - """ - Attributes: - id (str): - size (str): - name (str): - compute (Union[Unset, float]): - out_same_region (Union[Unset, float]): - out_different_region (Union[Unset, float]): - out_internet (Union[Unset, float]): - """ + """ + Attributes: + id (str): + size (str): + name (str): + compute (Union[Unset, float]): + out_same_region (Union[Unset, float]): + out_different_region (Union[Unset, float]): + out_internet (Union[Unset, float]): + """ id: str size: str @@ -40,7 +40,6 @@ class UsageCluster: out_different_region: Union[Unset, float] = UNSET out_internet: Union[Unset, float] = UNSET - def to_dict(self) -> dict[str, Any]: id = self.id @@ -56,13 +55,14 @@ def to_dict(self) -> dict[str, Any]: out_internet = self.out_internet - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "size": size, - "name": name, - }) + field_dict.update( + { + "id": id, + "size": size, + "name": name, + } + ) if compute is not UNSET: field_dict["compute"] = compute if out_same_region is not UNSET: @@ -74,8 +74,6 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -104,4 +102,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return usage_cluster - diff --git a/exasol/saas/client/openapi/models/user.py b/exasol/saas/client/openapi/models/user.py index 2a34153..a3efb50 100644 --- a/exasol/saas/client/openapi/models/user.py +++ b/exasol/saas/client/openapi/models/user.py @@ -21,11 +21,8 @@ ) if TYPE_CHECKING: - from ..models.user_database import UserDatabase - from ..models.user_role import UserRole - - - + from ..models.user_database import UserDatabase + from ..models.user_role import UserRole T = TypeVar("T", bound="User") @@ -33,37 +30,37 @@ @_attrs_define class User: - """ - Attributes: - email (str): - id (str): - created_at (datetime.datetime): - created_by (str): - status (UserStatus): - roles (list['UserRole']): - is_deletable (bool): - first_name (Union[Unset, str]): - last_name (Union[Unset, str]): - databases (Union[Unset, list['UserDatabase']]): - db_username (Union[Unset, str]): - """ + """ + Attributes: + email (str): + id (str): + created_at (datetime.datetime): + created_by (str): + status (UserStatus): + roles (list['UserRole']): + is_deletable (bool): + first_name (Union[Unset, str]): + last_name (Union[Unset, str]): + databases (Union[Unset, list['UserDatabase']]): + db_username (Union[Unset, str]): + """ email: str id: str created_at: datetime.datetime created_by: str status: UserStatus - roles: list['UserRole'] + roles: list["UserRole"] is_deletable: bool first_name: Union[Unset, str] = UNSET last_name: Union[Unset, str] = UNSET - databases: Union[Unset, list['UserDatabase']] = UNSET + databases: Union[Unset, list["UserDatabase"]] = UNSET db_username: Union[Unset, str] = UNSET - def to_dict(self) -> dict[str, Any]: from ..models.user_database import UserDatabase from ..models.user_role import UserRole + email = self.email id = self.id @@ -79,8 +76,6 @@ def to_dict(self) -> dict[str, Any]: roles_item = roles_item_data.to_dict() roles.append(roles_item) - - is_deletable = self.is_deletable first_name = self.first_name @@ -94,21 +89,20 @@ def to_dict(self) -> dict[str, Any]: databases_item = databases_item_data.to_dict() databases.append(databases_item) - - db_username = self.db_username - field_dict: dict[str, Any] = {} - field_dict.update({ - "email": email, - "id": id, - "createdAt": created_at, - "createdBy": created_by, - "status": status, - "roles": roles, - "isDeletable": is_deletable, - }) + field_dict.update( + { + "email": email, + "id": id, + "createdAt": created_at, + "createdBy": created_by, + "status": status, + "roles": roles, + "isDeletable": is_deletable, + } + ) if first_name is not UNSET: field_dict["firstName"] = first_name if last_name is not UNSET: @@ -120,12 +114,11 @@ def to_dict(self) -> dict[str, Any]: return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: from ..models.user_database import UserDatabase from ..models.user_role import UserRole + d = src_dict.copy() email = d.pop("email") @@ -133,26 +126,17 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: created_at = isoparse(d.pop("createdAt")) - - - created_by = d.pop("createdBy") status = UserStatus(d.pop("status")) - - - roles = [] _roles = d.pop("roles") - for roles_item_data in (_roles): + for roles_item_data in _roles: roles_item = UserRole.from_dict(roles_item_data) - - roles.append(roles_item) - is_deletable = d.pop("isDeletable") first_name = d.pop("firstName", UNSET) @@ -161,14 +145,11 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: databases = [] _databases = d.pop("databases", UNSET) - for databases_item_data in (_databases or []): + for databases_item_data in _databases or []: databases_item = UserDatabase.from_dict(databases_item_data) - - databases.append(databases_item) - db_username = d.pop("dbUsername", UNSET) user = cls( @@ -186,4 +167,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return user - diff --git a/exasol/saas/client/openapi/models/user_database.py b/exasol/saas/client/openapi/models/user_database.py index 7b84478..57ecc39 100644 --- a/exasol/saas/client/openapi/models/user_database.py +++ b/exasol/saas/client/openapi/models/user_database.py @@ -20,32 +20,30 @@ @_attrs_define class UserDatabase: - """ - Attributes: - id (str): - name (str): - """ + """ + Attributes: + id (str): + name (str): + """ id: str name: str - def to_dict(self) -> dict[str, Any]: id = self.id name = self.name - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - }) + field_dict.update( + { + "id": id, + "name": name, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return user_database - diff --git a/exasol/saas/client/openapi/models/user_role.py b/exasol/saas/client/openapi/models/user_role.py index e5b5066..97eb135 100644 --- a/exasol/saas/client/openapi/models/user_role.py +++ b/exasol/saas/client/openapi/models/user_role.py @@ -20,32 +20,30 @@ @_attrs_define class UserRole: - """ - Attributes: - id (str): - name (str): - """ + """ + Attributes: + id (str): + name (str): + """ id: str name: str - def to_dict(self) -> dict[str, Any]: id = self.id name = self.name - field_dict: dict[str, Any] = {} - field_dict.update({ - "id": id, - "name": name, - }) + field_dict.update( + { + "id": id, + "name": name, + } + ) return field_dict - - @classmethod def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: d = src_dict.copy() @@ -59,4 +57,3 @@ def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T: ) return user_role - diff --git a/exasol/saas/client/openapi/types.py b/exasol/saas/client/openapi/types.py index b352508..4d1de41 100644 --- a/exasol/saas/client/openapi/types.py +++ b/exasol/saas/client/openapi/types.py @@ -1,4 +1,4 @@ -""" Contains some shared types for properties """ +"""Contains some shared types for properties""" from collections.abc import MutableMapping from http import HTTPStatus @@ -25,14 +25,14 @@ def __bool__(self) -> Literal[False]: @define class File: - """ Contains information for file uploads """ + """Contains information for file uploads""" payload: BinaryIO file_name: Optional[str] = None mime_type: Optional[str] = None def to_tuple(self) -> FileJsonType: - """ Return a tuple representation that httpx will accept for multipart/form-data """ + """Return a tuple representation that httpx will accept for multipart/form-data""" return self.file_name, self.payload, self.mime_type @@ -41,7 +41,7 @@ def to_tuple(self) -> FileJsonType: @define class Response(Generic[T]): - """ A response from an endpoint """ + """A response from an endpoint""" status_code: HTTPStatus content: bytes diff --git a/noxfile.py b/noxfile.py index e17c698..1565083 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,21 +1,25 @@ import json import os -import nox import re -import requests import shutil import sys -import toml # type: ignore - -from datetime import datetime, timezone -from typing import List +from datetime import ( + datetime, + timezone, +) from pathlib import Path -from nox import Session -from noxconfig import PROJECT_CONFIG -from exasol.saas.client import SAAS_HOST +from typing import List + +import nox +import requests +import toml # type: ignore # imports all nox task provided by the toolbox from exasol.toolbox.nox.tasks import * +from nox import Session + +from exasol.saas.client import SAAS_HOST +from noxconfig import PROJECT_CONFIG # default actions to be run if nothing is explicitly specified with the -s option nox.options.sessions = ["project:fix"] @@ -42,28 +46,32 @@ def _download_openapi_json() -> Path: def filter_messages(buffer: str) -> str: ignored_messages = [ "Generating tmp", - ("WARNING parsing .*\n\n" - "Invalid response status code default" - " \(not a valid HTTP status code\)," - " response will be omitted from generated client" - "\n\n\n"), - ("If you believe this was a mistake or this tool is missing" - " a feature you need, please open an issue at .*"), + ( + "WARNING parsing .*\n\n" + "Invalid response status code default" + r" \(not a valid HTTP status code\)," + " response will be omitted from generated client" + "\n\n\n" + ), + ( + "If you believe this was a mistake or this tool is missing" + " a feature you need, please open an issue at .*" + ), ] for m in ignored_messages: buffer = re.sub(m, "", buffer) i = buffer.find("\n") first = buffer[:i] - buffer = buffer[i+1:].strip() - return f'{first}\n{buffer}' if buffer else "" + buffer = buffer[i + 1 :].strip() + return f"{first}\n{buffer}" if buffer else "" def dependencies(filename: str) -> List[str]: def unlimit_max(lib, version): - version_spec = re.sub(r",.*$", "", version) - return f"{lib}@{version_spec}" + version_spec = re.sub(r",.*$", "", version) + return f"{lib}@{version_spec}" - with open(filename, "r") as stream: + with open(filename) as stream: _toml = toml.load(stream) return [ unlimit_max(lib, version) @@ -89,10 +97,13 @@ def generate_api(session: Session): out = session.run( "openapi-python-client", "generate", - "--path", str(filename), + "--path", + str(filename), "--overwrite", - "--config", "openapi_config.yml", - "--output-path", "tmp", + "--config", + "openapi_config.yml", + "--output-path", + "tmp", silent=local_build, ) if local_build: @@ -130,6 +141,4 @@ def get_project_short_tag(session: Session): return if line.startswith("error-tags:"): header = True - raise RuntimeError( - f"Could not read project short tag from file {config_file}" - ) + raise RuntimeError(f"Could not read project short tag from file {config_file}") diff --git a/test/integration/conftest.py b/test/integration/conftest.py index 9f4fffd..b8b2228 100644 --- a/test/integration/conftest.py +++ b/test/integration/conftest.py @@ -1,14 +1,13 @@ -import pytest import os - from pathlib import Path -from exasol.saas.client import ( - openapi, -) + +import pytest + +from exasol.saas.client import openapi from exasol.saas.client.api_access import ( + OpenApiAccess, create_saas_client, timestamp_name, - OpenApiAccess, ) @@ -41,7 +40,9 @@ def api_access(saas_host, saas_pat, saas_account_id) -> OpenApiAccess: @pytest.fixture(scope="session") -def saas_database(api_access, database_name) -> openapi.models.exasol_database.ExasolDatabase: +def saas_database( + api_access, database_name +) -> openapi.models.exasol_database.ExasolDatabase: """ Note: The SaaS instance database returned by this fixture initially will not be operational. The startup takes about 20 minutes. diff --git a/test/integration/connection_test.py b/test/integration/connection_test.py index 525b96d..0f6695f 100644 --- a/test/integration/connection_test.py +++ b/test/integration/connection_test.py @@ -1,37 +1,47 @@ -import pytest import pyexasol +import pytest + from exasol.saas.client.api_access import get_connection_params @pytest.mark.slow -def test_get_connection_params_with_id(saas_host, saas_pat, saas_account_id, - operational_saas_database_id, - allow_connection): +def test_get_connection_params_with_id( + saas_host, saas_pat, saas_account_id, operational_saas_database_id, allow_connection +): """ This integration test checks that opening a pyexasol connection to a SaaS DB with known id and executing a query works. """ - connection_params = get_connection_params(host=saas_host, - account_id=saas_account_id, - pat=saas_pat, - database_id=operational_saas_database_id) + connection_params = get_connection_params( + host=saas_host, + account_id=saas_account_id, + pat=saas_pat, + database_id=operational_saas_database_id, + ) with pyexasol.connect(**connection_params) as pyconn: - result = pyconn.execute('SELECT 1;').fetchall() + result = pyconn.execute("SELECT 1;").fetchall() assert result == [(1,)] @pytest.mark.slow -def test_get_connection_params_with_name(saas_host, saas_pat, saas_account_id, - operational_saas_database_id, database_name, - allow_connection): +def test_get_connection_params_with_name( + saas_host, + saas_pat, + saas_account_id, + operational_saas_database_id, + database_name, + allow_connection, +): """ This integration test checks that opening a pyexasol connection to a SaaS DB with known name and executing a query works. """ - connection_params = get_connection_params(host=saas_host, - account_id=saas_account_id, - pat=saas_pat, - database_name=database_name) + connection_params = get_connection_params( + host=saas_host, + account_id=saas_account_id, + pat=saas_pat, + database_name=database_name, + ) with pyexasol.connect(**connection_params) as pyconn: - result = pyconn.execute('SELECT 1;').fetchall() + result = pyconn.execute("SELECT 1;").fetchall() assert result == [(1,)] diff --git a/test/integration/databases_test.py b/test/integration/databases_test.py index 1492f54..b6399d6 100644 --- a/test/integration/databases_test.py +++ b/test/integration/databases_test.py @@ -1,10 +1,16 @@ -import pytest +from datetime import ( + datetime, + timedelta, +) -from exasol.saas.client import PROMISING_STATES +import pytest from tenacity import RetryError -from datetime import datetime, timedelta -from exasol.saas.client.api_access import wait_for_delete_clearance, get_connection_params +from exasol.saas.client import PROMISING_STATES +from exasol.saas.client.api_access import ( + get_connection_params, + wait_for_delete_clearance, +) def test_lifecycle(api_access, database_name): @@ -22,8 +28,7 @@ def test_lifecycle(api_access, database_name): with testee.database(database_name, ignore_delete_failure=True) as db: start = datetime.now() # verify state and clusters of created database - assert db.status in PROMISING_STATES and \ - db.clusters.total == 1 + assert db.status in PROMISING_STATES and db.clusters.total == 1 # verify database is listed assert db.id in testee.list_database_ids() @@ -49,5 +54,4 @@ def test_get_connection(api_access, database_name): with api_access.database(database_name) as db: clusters = api_access.clusters(db.id) connection = api_access.get_connection(db.id, clusters[0].id) - assert connection.db_username is not None and \ - connection.port == 8563 + assert connection.db_username is not None and connection.port == 8563 diff --git a/test/unit/test_placeholder.py b/test/unit/test_placeholder.py index dc2ded3..9fb9833 100644 --- a/test/unit/test_placeholder.py +++ b/test/unit/test_placeholder.py @@ -1,4 +1,5 @@ -""" unit tests """ +"""unit tests""" + def test_placeholder(): - """ doc """ + """doc""" From 5fc1bc7496d4889fb46ed10be17c124f61355771 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 13:44:05 +0200 Subject: [PATCH 08/13] Fix lint:typing issue from reformatting --- exasol/saas/client/api_access.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exasol/saas/client/api_access.py b/exasol/saas/client/api_access.py index 699c6b3..add632c 100644 --- a/exasol/saas/client/api_access.py +++ b/exasol/saas/client/api_access.py @@ -109,7 +109,7 @@ def _get_database_id( lambda db: (db.name == database_name) # type: ignore and (db.deleted_at is UNSET) # type: ignore and (db.deleted_by is UNSET), - dbs, + dbs, # type: ignore ) ) # type: ignore if not dbs: From c0384c92da6921e72aa22951a5b4b02cc0eee398 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 13:45:23 +0200 Subject: [PATCH 09/13] Fix formatting missed with lint:typing fix; whitespace issue --- exasol/saas/client/api_access.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exasol/saas/client/api_access.py b/exasol/saas/client/api_access.py index add632c..3257d33 100644 --- a/exasol/saas/client/api_access.py +++ b/exasol/saas/client/api_access.py @@ -109,7 +109,7 @@ def _get_database_id( lambda db: (db.name == database_name) # type: ignore and (db.deleted_at is UNSET) # type: ignore and (db.deleted_by is UNSET), - dbs, # type: ignore + dbs, # type: ignore ) ) # type: ignore if not dbs: From 2300148040c06ca0cfe31a4845e2f11aa8b1b9b3 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 13:58:19 +0200 Subject: [PATCH 10/13] Fix workflow output value --- .github/workflows/run-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 712132d..2a36ff9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -42,9 +42,8 @@ jobs: - name: Set coverage name id: coverage-suffix - if: ${{ ! inputs.slow-tests }} run: | - if [ "${{ inputs.slow-tests }}" == "true" ]; then + if [[ "${{ inputs.slow-tests }}" == "true" ]]; then echo value='fast' >> "$GITHUB_OUTPUT" else echo value='slow' >> "$GITHUB_OUTPUT" From 408fdbbf43c2ef4d026efd397c1887ae6b0937e1 Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 14:07:05 +0200 Subject: [PATCH 11/13] Switch generate_api to run project:fix command to align with ci check --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 1565083..27dd388 100644 --- a/noxfile.py +++ b/noxfile.py @@ -115,7 +115,7 @@ def generate_api(session: Session): if local_build: session.run("poetry", "add", *dependencies("tmp/pyproject.toml")) shutil.rmtree("tmp") - session.run("isort", "-q", DEST_DIR) + fix(session) @nox.session(name="api:check-outdated", python=False) From ce3601d7ddfca97a229e420871ea52bd211c41aa Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 14:09:31 +0200 Subject: [PATCH 12/13] Switch run-tests to use pytest markers step for setting --- .github/workflows/run-tests.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 2a36ff9..5c16973 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -19,7 +19,9 @@ jobs: - name: Set pytest markers id: pytest-markers if: ${{ ! inputs.slow-tests }} - run: echo slow-tests='-m "not slow"' >> "$GITHUB_OUTPUT" + run: | + echo slow-tests='-m "not slow"' >> "$GITHUB_OUTPUT" + echo coverage-suffix='fast' >> "$GITHUB_OUTPUT" - name: SCM Checkout uses: actions/checkout@v4 @@ -40,18 +42,9 @@ jobs: export PROJECT_SHORT_TAG=$(poetry run -- nox -s project:get-short-tag) poetry run -- nox -s test:coverage -- - - name: Set coverage name - id: coverage-suffix - run: | - if [[ "${{ inputs.slow-tests }}" == "true" ]]; then - echo value='fast' >> "$GITHUB_OUTPUT" - else - echo value='slow' >> "$GITHUB_OUTPUT" - fi - - name: Upload Artifacts uses: actions/upload-artifact@v4.6.2 with: - name: coverage-python${{ inputs.python-version }}-${{ steps.coverage-suffix.outputs.value }} + name: coverage-python${{ inputs.python-version }}-${{ steps.pytest-markers.outputs.coverage-suffix }} path: .coverage include-hidden-files: true \ No newline at end of file From 474f6d3053245180bf6cbabe21048e7b1f2e61ab Mon Sep 17 00:00:00 2001 From: Ariel Schulz Date: Wed, 23 Apr 2025 14:09:52 +0200 Subject: [PATCH 13/13] Switch run-tests to use pytest markers step for setting --- .github/workflows/run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5c16973..2fc150e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -21,7 +21,7 @@ jobs: if: ${{ ! inputs.slow-tests }} run: | echo slow-tests='-m "not slow"' >> "$GITHUB_OUTPUT" - echo coverage-suffix='fast' >> "$GITHUB_OUTPUT" + echo coverage-suffix='-fast' >> "$GITHUB_OUTPUT" - name: SCM Checkout uses: actions/checkout@v4 @@ -45,6 +45,6 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4.6.2 with: - name: coverage-python${{ inputs.python-version }}-${{ steps.pytest-markers.outputs.coverage-suffix }} + name: coverage-python${{ inputs.python-version }}${{ steps.pytest-markers.outputs.coverage-suffix }} path: .coverage include-hidden-files: true \ No newline at end of file